[util] Fix a non-explicit-typed shift in sized_uint

In basic_types.h, `sized_uint<N>` was shifting a mask by the bit width
of the type, which meant it wouldn't work for 64 bit types.
This commit is contained in:
Justin C. Miller
2023-08-05 17:43:14 -07:00
parent 28379dc0f6
commit b239bb6df2

View File

@@ -68,7 +68,7 @@ template <> struct sized_uint_type<32> { using type = uint32_t; };
template <> struct sized_uint_type<64> { using type = uint64_t; };
template <unsigned N> struct sized_uint {
static constexpr uint64_t mask = ((1<<N)-1);
static constexpr uint64_t mask = ((1ull<<N)-1);
static constexpr unsigned bits = N;
using type = typename sized_uint_type<N>::type;
};