From c0ddcdaf16837ad9c6dd0139b4aa4e55b5621a4b Mon Sep 17 00:00:00 2001 From: "mats.palmgren%bredband.net" Date: Thu, 9 Nov 2006 17:41:03 +0000 Subject: [PATCH] Make NS_LIKELY/NS_UNLIKELY accept pointers etc. b=340244 r+sr=darin --- xpcom/base/nscore.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h index 9d3e71a42e2c..042cbb2eb42f 100644 --- a/xpcom/base/nscore.h +++ b/xpcom/base/nscore.h @@ -459,8 +459,8 @@ typedef PRUint32 nsrefcnt; */ #if defined(__GNUC__) && (__GNUC__ > 2) -#define NS_LIKELY(x) (__builtin_expect((x), 1)) -#define NS_UNLIKELY(x) (__builtin_expect((x), 0)) +#define NS_LIKELY(x) (__builtin_expect(!!(x), 1)) +#define NS_UNLIKELY(x) (__builtin_expect(!!(x), 0)) #else #define NS_LIKELY(x) (x) #define NS_UNLIKELY(x) (x)