aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--internal.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 210287c3ff..8462bd171c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jul 29 11:07:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * internal.h (LIKELY, UNLIKELY): make a boolean to enforce 1 or 0.
+
Wed Jul 29 10:44:43 2015 Alex Dowad <alexinbeijing@gmail.com>
* gc.c: document argument passed to finalizer proc.
diff --git a/internal.h b/internal.h
index 58ff89763c..a9b3ee4824 100644
--- a/internal.h
+++ b/internal.h
@@ -25,8 +25,8 @@ extern "C" {
/* likely */
#if __GNUC__ >= 3
-#define LIKELY(x) (__builtin_expect((x), 1))
-#define UNLIKELY(x) (__builtin_expect((x), 0))
+#define LIKELY(x) (__builtin_expect(!(x), 0))
+#define UNLIKELY(x) (__builtin_expect(!(x), 1))
#else /* __GNUC__ >= 3 */
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)