Booleans should be represented by
0 for false and -1 for true (or 0xFFFF for unsigned ints). This way & still works like and, | works like or, but unlike using 1 for true it also makes bitwise inversion operator ~ flip boolean values correctly.