The operator ^ is the bitwise-xor (see &, | ). The result for a bit pair is,
0 ^ 0 == 0
0 ^ 1 == 1
1 ^ 0 == 1
1 ^ 1 == 0
So the expression,
( x ^ 0x1 )
inverts/flips the 0th bit of x (leaving other bits unchanged).
Consider whether x can have values besides 0x0 and 0x1? When x is a single bit field, it can have only values 0x0 and 0x1, but when x is an int (char/short/long/etc), bits besides bit0 can affect the result of the expression.
The expression as given allows bits beside bit0 to affect the result,
if ( 0 != ( x ^ 0x1 ) )
Which has equivalent truthiness as this (simpler) expression,
if ( x ^ 0x1 )
Note that this expression would examine only bit0,
if( 0x1 & ( x ^ 0x1 ) )
So the expression as presented is really combining two expression checks,
if( ( x & ~0x1 ) //look at all bits besides bit0
|| ( x ^ 0x1 ) ) //combine with the xor expression for bit0
Did the author intend to only check bit0, and have meant to use this expression,
if( 0x1 & ( x ^ 0x1 ) )
Or did the author intend to comingle the values for bit1-bitN and the xor of bit0?