Use false instead of 0 for a boolean
This commit is contained in:
parent
f7ab7b45f7
commit
c8e8ac42ab
@ -12,9 +12,9 @@
|
|||||||
* required to be true, but it can result in more optimal code for the true
|
* 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.
|
* path at the expense of a less optimal false path.
|
||||||
*/
|
*/
|
||||||
#define LIKELY(x) __builtin_expect(!!(x), !0)
|
#define LIKELY(x) __builtin_expect(!!(x), !false)
|
||||||
/* The opposite of LIKELY, optimizing the case where the condition is false. */
|
/* The opposite of LIKELY, optimizing the case where the condition is false. */
|
||||||
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
|
#define UNLIKELY(x) __builtin_expect(!!(x), false)
|
||||||
/* Unlike LIKELY, ASSUME requires the condition to be true or else it invokes
|
/* Unlike LIKELY, ASSUME requires the condition to be true or else it invokes
|
||||||
* undefined behavior. It's essentially an assert without actually checking the
|
* undefined behavior. It's essentially an assert without actually checking the
|
||||||
* condition at run-time, allowing for stronger optimizations than LIKELY.
|
* condition at run-time, allowing for stronger optimizations than LIKELY.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user