Fix bitfield warning

This commit is contained in:
msuih 2019-11-10 07:48:42 +02:00 committed by Ivan
parent 0ff5938b1f
commit 1af948a7d4

View File

@ -16,7 +16,7 @@ struct bf_base
static constexpr uint bitsize = N;
// All ones mask
static constexpr utype mask1 = static_cast<utype>(UINTMAX_MAX);
static constexpr utype mask1 = static_cast<utype>(~static_cast<utype>(0));
// Value mask
static constexpr utype vmask = mask1 >> (bitmax - bitsize);