diff --git a/src/macros.h b/src/macros.h --- a/src/macros.h +++ b/src/macros.h @@ -279,9 +279,9 @@ template static inline T Clr * @param y The bit position to toggle * @return The new value of the old value with the bit toggled */ -template static inline T TOGGLEBIT(T& x, const uint8 y) +template static inline T ToggleBit(T& x, const uint8 y) { - return x ^= (T)1U << y; + return x = (T)(x ^ (T)(1U << y)); }