Quote:

Richard, I think it would be better to be consistent and use the bit-wise NOT (~) operator when turning off a flag instead of subtracting.




Yes, the last examples were demonstrations of how to manipulate the bits using simple math instead of bitwise operations, they are not how I would recommend that the operations are performed.

Using the bitwise operations means that you do not need the conditionals at all.

I hope that clarifies things.