Arthur Schwarz wrote:
I've just looked at GUI_Options.cpp again and wonder if the following code is
correct:

  perlcs->cs.style &= perlcs->cs.style ^ (DWORD) SvIV(ST(next_i));

Looks fine to me:

&= (assignment operator) has lower precedence than ^ (Bitwise exclusive or) - see perldoc perlop

So it is the same as:

a = a & ( a ^ b)

And drawing up the logic table:

a b  a^b (a^b)&a
- -  --- -------
0 0   1     0
0 1   0     0
1 0   1     1
1 1   0     0

So the result is 1 only if a is 1 and b is 0, which is exactly what we're looking for.

You're right that other options are possible (for example a &= ~b, which would be my first choice), but it's not broken. I haven't tried comparing speeds.

Regards,
Rob.

Reply via email to