daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
1ff636
From 2ee0903b0a00dd4a13af8a26ee5fb435c9895568 Mon Sep 17 00:00:00 2001
1ff636
From: Daniel Mack <daniel@zonque.org>
1ff636
Date: Fri, 27 Feb 2015 20:05:26 +0100
1ff636
Subject: [PATCH] shared/condition: fix gcc5 warning
1ff636
MIME-Version: 1.0
1ff636
Content-Type: text/plain; charset=UTF-8
1ff636
Content-Transfer-Encoding: 8bit
1ff636
1ff636
Fixes the warning below.
1ff636
1ff636
src/shared/condition.c: In function ‘condition_new’:
1ff636
src/shared/condition.c:47:27: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
1ff636
         assert(!parameter == (type == CONDITION_NULL));
1ff636
                           ^
1ff636
src/shared/macro.h:42:44: note: in definition of macro ‘_unlikely_’
1ff636
 #define _unlikely_(x) (__builtin_expect(!!(x),0))
1ff636
                                            ^
1ff636
src/shared/macro.h:226:22: note: in expansion of macro ‘assert_se’
1ff636
 #define assert(expr) assert_se(expr)
1ff636
                      ^
1ff636
src/shared/condition.c:47:9: note: in expansion of macro ‘assert’
1ff636
         assert(!parameter == (type == CONDITION_NULL));
1ff636
         ^
1ff636
1ff636
(cherry picked from commit 8a9c6071cb7467170010f0287672c987981bdf9c)
1ff636
---
1ff636
 src/shared/condition.c | 2 +-
1ff636
 1 file changed, 1 insertion(+), 1 deletion(-)
1ff636
1ff636
diff --git a/src/shared/condition.c b/src/shared/condition.c
Pablo Greco 48fc63
index da7560f05f..796cc520d7 100644
1ff636
--- a/src/shared/condition.c
1ff636
+++ b/src/shared/condition.c
1ff636
@@ -46,7 +46,7 @@ Condition* condition_new(ConditionType type, const char *parameter, bool trigger
1ff636
 
1ff636
         assert(type >= 0);
1ff636
         assert(type < _CONDITION_TYPE_MAX);
1ff636
-        assert(!parameter == (type == CONDITION_NULL));
1ff636
+        assert((!parameter) == (type == CONDITION_NULL));
1ff636
 
1ff636
         c = new0(Condition, 1);
1ff636
         if (!c)