[glib/wip/sadiq/likely] gmacros: Fix G_[UN]LIKELY to not mask -Wparentheses



commit c5511e8cc2c4586e04fe124f951cca8d5187f11c
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Thu Oct 4 17:38:27 2018 +0530

    gmacros: Fix G_[UN]LIKELY to not mask -Wparentheses
    
    A double paren forces the compiler to assume that the
    statement is right.  That may not be the case

 glib/gmacros.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/gmacros.h b/glib/gmacros.h
index 0432d9cad..8ef65dad2 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -427,8 +427,8 @@
       _g_boolean_var_ = 0;                      \
    _g_boolean_var_;                             \
 })
-#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 1))
-#define G_UNLIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 0))
+#define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1))
+#define G_UNLIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 0))
 #else
 #define G_LIKELY(expr) (expr)
 #define G_UNLIKELY(expr) (expr)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]