mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-25 02:18:55 +02:00
Use G_LIKELY without surrounding parentheses in g_assert() and
* glib/gmessages.h: Use G_LIKELY without surrounding parentheses in g_assert() and g_return_[val]_if_fail() so that we always trigger the gcc warning about "assignment used as truth value". * glib/gmacros.h: Always put parentheses in G_LIKELY and G_UNLIKELY.
This commit is contained in:
@@ -222,8 +222,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)
|
||||
|
Reference in New Issue
Block a user