src/macros.h
changeset 7932 6c3d71e8a129
parent 7931 b0a46cd92225
child 7937 1e7a22ea20d4
equal deleted inserted replaced
7931:b0a46cd92225 7932:6c3d71e8a129
   277  *
   277  *
   278  * @param x The varliable to toggle the bit
   278  * @param x The varliable to toggle the bit
   279  * @param y The bit position to toggle
   279  * @param y The bit position to toggle
   280  * @return The new value of the old value with the bit toggled
   280  * @return The new value of the old value with the bit toggled
   281  */
   281  */
   282 template<typename T> static inline T TOGGLEBIT(T& x, const uint8 y)
   282 template<typename T> static inline T ToggleBit(T& x, const uint8 y)
   283 {
   283 {
   284 	return x ^= (T)1U << y;
   284 	return x = (T)(x ^ (T)(1U << y));
   285 }
   285 }
   286 
   286 
   287 
   287 
   288 /* checking more bits. Maybe unneccessary, but easy to use */
   288 /* checking more bits. Maybe unneccessary, but easy to use */
   289 /**
   289 /**