28 inline uint64_t
bfabs(int64_t value)
29 {
return value >= 0 ?
static_cast<uint64_t
>(value) : static_cast<uint64_t>(-value); }
34 auto abs_offset =
bfabs(offset);
37 return value + abs_offset;
39 if (value >= abs_offset)
40 return value - abs_offset;
42 ABORT(
"attempted add an offset that would result in overflow");
uint64_t add_offset(uint64_t value, int64_t offset)
uint64_t bfabs(int64_t value)