diff --git a/Utilities/BitField.h b/Utilities/BitField.h index a433ca907c..2d1a036603 100644 --- a/Utilities/BitField.h +++ b/Utilities/BitField.h @@ -18,6 +18,9 @@ struct bf_base // Value mask static constexpr utype vmask = static_cast(~utype{} >> (bitmax - bitsize)); + // All ones mask + static constexpr utype mask1 = static_cast(~utype{}); + protected: type m_data; }; @@ -36,7 +39,7 @@ struct bf_t : bf_base // Get bitmask of size N, at I pos static constexpr utype data_mask() { - return static_cast(static_cast(~utype{} >> (bf_t::bitmax - bf_t::bitsize)) << bitpos); + return static_cast(static_cast(bf_t::mask1 >> (bf_t::bitmax - bf_t::bitsize)) << bitpos); } // Bitfield extraction helper