summaryrefslogtreecommitdiff
path: root/src/fcint.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-25 18:12:07 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-08-25 18:12:07 -0400
commitff7d314ab5f04d3ad54d5165b81d87894d7a8dfe (patch)
treeb713d982b48852b201e5566cecddcf3e1bad3b1f /src/fcint.h
parente117d6768c5cf5ae37405d03ed6d3b076e713dde (diff)
downloadfontconfig-ff7d314ab5f04d3ad54d5165b81d87894d7a8dfe.tar.gz
Fix up FC_LIKELY macros
__builtin_expect returns the same type as the expression, so enforce that we pass in a boolean expression. Pointed out by Emmanuele Bassi.
Diffstat (limited to 'src/fcint.h')
-rw-r--r--src/fcint.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fcint.h b/src/fcint.h
index fb173b5..a3b192d 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -61,8 +61,8 @@
#define FC_LIKELY(expr) (expr)
#define FC_UNLIKELY(expr) (expr)
#else
-#define FC_LIKELY(expr) (__builtin_expect (expr, 1))
-#define FC_UNLIKELY(expr) (__builtin_expect (expr, 0))
+#define FC_LIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 1))
+#define FC_UNLIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 0))
#endif
#ifdef _WIN32