dryang / rpms / systemd

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