daandemeyer / rpms / systemd

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