diff options
author | Chris Robinson <[email protected]> | 2019-08-04 11:59:14 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-04 11:59:14 -0700 |
commit | 2fa2c35bdc2a09d5e856bb12ad6dff556bbe65a8 (patch) | |
tree | 4a6c7a5f2a80ad7870e9028e48b8b99e558042f5 /common/alnumeric.h | |
parent | 7897de31d0f75f4ac1d91fe8c470953e9f54d151 (diff) |
Modify LIKELY and UNLIKELY to not need extra parenthesis
Diffstat (limited to 'common/alnumeric.h')
-rw-r--r-- | common/alnumeric.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/alnumeric.h b/common/alnumeric.h index 950eebe1..7035715c 100644 --- a/common/alnumeric.h +++ b/common/alnumeric.h @@ -246,11 +246,11 @@ inline int float2int(float f) noexcept shift = ((conv.i>>23)&0xff) - (127+23); /* Over/underflow */ - if(UNLIKELY(shift >= 31 || shift < -23)) + if UNLIKELY(shift >= 31 || shift < -23) return 0; mant = (conv.i&0x7fffff) | 0x800000; - if(LIKELY(shift < 0)) + if LIKELY(shift < 0) return (mant >> -shift) * sign; return (mant << shift) * sign; @@ -293,7 +293,7 @@ inline float fast_roundf(float f) noexcept sign = (conv.i>>31)&0x01; expo = (conv.i>>23)&0xff; - if(UNLIKELY(expo >= 150/*+23*/)) + if UNLIKELY(expo >= 150/*+23*/) { /* An exponent (base-2) of 23 or higher is incapable of sub-integral * precision, so it's already an integral value. We don't need to worry |