7 static void checkBitFieldLength(
size_t length)
9 if (length == 0 || length > 64)
11 throw CppRuntimeException(
"Asking for bound of bitfield with invalid length ") << length <<
"!";
17 checkBitFieldLength(length);
21 return -
static_cast<int64_t
>((UINT64_C(1) << (length - 1)) - 1) - 1;
31 checkBitFieldLength(length);
35 return (UINT64_C(1) << (length - 1)) - 1;
39 return length == 64 ? UINT64_MAX : ((UINT64_C(1) << length) - 1);
int64_t getBitFieldLowerBound(size_t length, bool isSigned)
uint64_t getBitFieldUpperBound(size_t length, bool isSigned)