teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame 0045-shared-condition-fix-gcc5-warning.patch

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