diff --git a/Source/Core/Common/BitField.h b/Source/Core/Common/BitField.h index 5ee505e102..65f9c8d3f5 100644 --- a/Source/Core/Common/BitField.h +++ b/Source/Core/Common/BitField.h @@ -146,7 +146,7 @@ public: if (std::numeric_limits::is_signed) { std::size_t shift = 8 * sizeof(T) - bits; - return (T)(((storage & GetMask()) << (shift - position)) >> shift); + return (T)((storage << (shift - position)) >> shift); } else { @@ -173,7 +173,7 @@ private: __forceinline StorageType GetMask() const { - return ((~(StorageTypeU)0) >> (8 * sizeof(T) - bits)) << position; + return (((StorageTypeU)~0) >> (8 * sizeof(T) - bits)) << position; } StorageType storage;