aboutsummaryrefslogtreecommitdiffstats
path: root/com32/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-07-23 22:15:53 -0400
committerH. Peter Anvin <hpa@zytor.com>2008-07-23 22:15:53 -0400
commit97c2f2b35677f999ced3d8649bfc7d441b1dc4e4 (patch)
tree784b37a36adaecbc2c007846d659c19dd099f4c8 /com32/include
parent81e4821f2a9507238cfda0c665933eb8a23c9c5b (diff)
downloadsyslinux.git-97c2f2b35677f999ced3d8649bfc7d441b1dc4e4.tar.gz
syslinux.git-97c2f2b35677f999ced3d8649bfc7d441b1dc4e4.tar.xz
syslinux.git-97c2f2b35677f999ced3d8649bfc7d441b1dc4e4.zip
klibc/compiler.h: booleanize likely/unlikely
__likely() and __unlikely() should explicitly booleanize their arguments.
Diffstat (limited to 'com32/include')
-rw-r--r--com32/include/klibc/compiler.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/com32/include/klibc/compiler.h b/com32/include/klibc/compiler.h
index 9f5d36e2..984071f7 100644
--- a/com32/include/klibc/compiler.h
+++ b/com32/include/klibc/compiler.h
@@ -94,11 +94,11 @@
/* likely/unlikely */
#if defined(__GNUC__) && (__GNUC_MAJOR__ > 2 || (__GNUC_MAJOR__ == 2 && __GNUC_MINOR__ >= 95))
-# define __likely(x) __builtin_expect((x), 1)
-# define __unlikely(x) __builtin_expect((x), 0)
+# define __likely(x) __builtin_expect(!!(x), 1)
+# define __unlikely(x) __builtin_expect(!!(x), 0)
#else
-# define __likely(x) (x)
-# define __unlikely(x) (x)
+# define __likely(x) (!!(x))
+# define __unlikely(x) (!!(x))
#endif
/* Possibly unused function */