7 static void checkBitFieldLength(
size_t length)
9 if (length == 0 || length > 64)
10 throw CppRuntimeException(
"Asking for bound of bitfield with invalid length ") << length <<
"!";
15 checkBitFieldLength(length);
18 return -
static_cast<int64_t
>((UINT64_C(1) << (length - 1)) - 1) - 1;
25 checkBitFieldLength(length);
28 return (UINT64_C(1) << (length - 1)) - 1;
30 return length == 64 ? UINT64_MAX : ((UINT64_C(1) << length) - 1);
uint64_t getBitFieldUpperBound(size_t length, bool isSigned)
int64_t getBitFieldLowerBound(size_t length, bool isSigned)