summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2008-07-06 15:18:50 +0200
committerWilly Tarreau <w@1wt.eu>2008-09-02 10:49:43 +0200
commit3ff2c1d9b8d6492de3f4624f42617464efefd7b1 (patch)
tree0773d5c21e7a4d38c50c3e8920068cc1a304f306
parent66c9f287c2c2d016eb12cb3ab12cd80b5c225f5e (diff)
downloadhaproxy-3ff2c1d9b8d6492de3f4624f42617464efefd7b1.tar.gz
[BUILD] silent a warning in unlikely() with gcc 4.x
The unlikely() implementation for gcc 4.x spits out a warning when a pointer is passed. Add a cast to unsigned long. (cherry picked from commit 75875a7c8c7348e90e373c007bafdedcc6253ab4)
-rw-r--r--include/common/ebtree.h2
-rw-r--r--include/common/standard.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/common/ebtree.h b/include/common/ebtree.h
index 1a5ce8650..38cd0b533 100644
--- a/include/common/ebtree.h
+++ b/include/common/ebtree.h
@@ -322,7 +322,7 @@ static inline int fls64(unsigned long long x)
* only work with ints and booleans though.
*/
#define likely(x) (x)
-#define unlikely(x) (__builtin_expect((x), 0))
+#define unlikely(x) (__builtin_expect((unsigned long)(x), 0))
#endif
#endif
diff --git a/include/common/standard.h b/include/common/standard.h
index a120f56bd..2a2c8f66c 100644
--- a/include/common/standard.h
+++ b/include/common/standard.h
@@ -61,7 +61,7 @@
* only work with ints and booleans though.
*/
#define likely(x) (x)
-#define unlikely(x) (__builtin_expect((x), 0))
+#define unlikely(x) (__builtin_expect((unsigned long)(x), 0))
#endif
#endif