aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-11 20:23:46 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-11 20:23:46 +0000
commit4277b0e9265ca24d324e210ded904f1588b24df1 (patch)
treea022c52e7a9311407e62cabd8b91d27703b62d9d /src/common/compat.h
parentd9aa57253d7baebda2409c4f10b2989bacab3572 (diff)
downloadtor-4277b0e9265ca24d324e210ded904f1588b24df1.tar.gz
tor-4277b0e9265ca24d324e210ded904f1588b24df1.zip
Remove some cargo-cult gcc hacks around tor_assert and predict_unlikely; instead, use the standard convert-to-boolean hack of "svn st"
svn:r17597
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index df3cfba952..336c8cd136 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -143,7 +143,7 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
* except that it tells the compiler that the branch will be taken most of the
* time. This can generate slightly better code with some CPUs.
*/
-#define PREDICT_LIKELY(exp) __builtin_expect((exp), 1)
+#define PREDICT_LIKELY(exp) __builtin_expect(!!(exp), 1)
/** Macro: Evaluates to <b>exp</b> and hints the compiler that the value
* of <b>exp</b> will probably be false.
*
@@ -151,7 +151,7 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
* except that it tells the compiler that the branch will usually not be
* taken. This can generate slightly better code with some CPUs.
*/
-#define PREDICT_UNLIKELY(exp) __builtin_expect((exp), 0)
+#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
#else
#define ATTR_NORETURN
#define ATTR_PURE