aboutsummaryrefslogtreecommitdiffstats
path: root/common/opthelpers.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-04 11:59:14 -0700
committerChris Robinson <[email protected]>2019-08-04 11:59:14 -0700
commit2fa2c35bdc2a09d5e856bb12ad6dff556bbe65a8 (patch)
tree4a6c7a5f2a80ad7870e9028e48b8b99e558042f5 /common/opthelpers.h
parent7897de31d0f75f4ac1d91fe8c470953e9f54d151 (diff)
Modify LIKELY and UNLIKELY to not need extra parenthesis
Diffstat (limited to 'common/opthelpers.h')
-rw-r--r--common/opthelpers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/opthelpers.h b/common/opthelpers.h
index c83229f5..58578c15 100644
--- a/common/opthelpers.h
+++ b/common/opthelpers.h
@@ -12,9 +12,9 @@
* required to be true, but it can result in more optimal code for the true
* path at the expense of a less optimal false path.
*/
-#define LIKELY(x) __builtin_expect(!!(x), !false)
+#define LIKELY(x) (__builtin_expect(!!(x), !false))
/* The opposite of LIKELY, optimizing the case where the condition is false. */
-#define UNLIKELY(x) __builtin_expect(!!(x), false)
+#define UNLIKELY(x) (__builtin_expect(!!(x), false))
/* Unlike LIKELY, ASSUME requires the condition to be true or else it invokes
* undefined behavior. It's essentially an assert without actually checking the
* condition at run-time, allowing for stronger optimizations than LIKELY.