chiark / gitweb /
shared/condition: fix gcc5 warning
authorDaniel Mack <daniel@zonque.org>
Fri, 27 Feb 2015 19:05:26 +0000 (20:05 +0100)
committerDaniel Mack <daniel@zonque.org>
Fri, 27 Feb 2015 19:12:16 +0000 (20:12 +0100)
Fixes the warning below.

src/shared/condition.c: In function ‘condition_new’:
src/shared/condition.c:47:27: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
         assert(!parameter == (type == CONDITION_NULL));
                           ^
src/shared/macro.h:42:44: note: in definition of macro ‘_unlikely_’
 #define _unlikely_(x) (__builtin_expect(!!(x),0))
                                            ^
src/shared/macro.h:226:22: note: in expansion of macro ‘assert_se’
 #define assert(expr) assert_se(expr)
                      ^
src/shared/condition.c:47:9: note: in expansion of macro ‘assert’
         assert(!parameter == (type == CONDITION_NULL));
         ^

src/shared/condition.c

index f34b45f2a9cff97ec2e32bbf80e263ed2381242c..0a77607eeaa1e5244d4bf6964ae97cdfbdb1630e 100644 (file)
@@ -44,7 +44,7 @@ Condition* condition_new(ConditionType type, const char *parameter, bool trigger
 
         assert(type >= 0);
         assert(type < _CONDITION_TYPE_MAX);
-        assert(!parameter == (type == CONDITION_NULL));
+        assert((!parameter) == (type == CONDITION_NULL));
 
         c = new0(Condition, 1);
         if (!c)