equal
deleted
inserted
replaced
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 /** |