From 9fccb47e7c26d3c9049fd0b24947111db944970e Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 1 Jul 2017 01:53:16 +0300 Subject: [PATCH] bf_t: fix warning --- Utilities/BitField.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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