summaryrefslogtreecommitdiff
path: root/src/helpers.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers.hpp')
-rw-r--r--src/helpers.hpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/helpers.hpp b/src/helpers.hpp
index 5f378803a..fb5aeb5f8 100644
--- a/src/helpers.hpp
+++ b/src/helpers.hpp
@@ -138,25 +138,19 @@ template <typename Tenum_t> struct TinyEnumT
}
};
-template <typename T> FORCEINLINE T ClrBitT(T t, int bit_index)
+template <typename T> void ClrBitT(T &t, int bit_index)
{
- int val = t;
- CLRBIT(val, bit_index);
- return (T)val;
+ t = (T)(t & ~((T)1 << bit_index));
}
-template <typename T> FORCEINLINE T SetBitT(T t, int bit_index)
+template <typename T> void SetBitT(T &t, int bit_index)
{
- int val = t;
- SETBIT(val, bit_index);
- return (T)val;
+ t = (T)(t | ((T)1 << bit_index));
}
-template <typename T> FORCEINLINE T ToggleBitT(T t, int bit_index)
+template <typename T> void ToggleBitT(T &t, int bit_index)
{
- int val = t;
- TOGGLEBIT(val, bit_index);
- return (T)val;
+ t = (T)(t ^ ((T)1 << bit_index));
}
#endif /* HELPERS_HPP */