[systemd-commits] 2 commits - src/shared src/test

Daniel Mack zonque at kemper.freedesktop.org
Tue Feb 24 07:26:55 PST 2015


 src/shared/unit-name.c  |    2 +-
 src/test/test-hashmap.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4b3eff61640672bf0b19cb8cdd88ce5e84dcda1c
Author: Daniel Mack <daniel at zonque.org>
Date:   Tue Feb 24 16:24:14 2015 +0100

    test-hashmap: fix gcc5 warning
    
    gcc5 spits out a warning about test-hashmap.c:
    
      CC       src/test/test-hashmap.o
    src/test/test-hashmap.c: In function ‘test_string_compare_func’:
    src/test/test-hashmap.c:76:79: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]

diff --git a/src/test/test-hashmap.c b/src/test/test-hashmap.c
index 40be084..767cbd9 100644
--- a/src/test/test-hashmap.c
+++ b/src/test/test-hashmap.c
@@ -73,7 +73,7 @@ static void test_trivial_compare_func(void) {
 }
 
 static void test_string_compare_func(void) {
-        assert_se(!string_compare_func("fred", "wilma") == 0);
+        assert_se(string_compare_func("fred", "wilma") != 0);
         assert_se(string_compare_func("fred", "fred") == 0);
 }
 

commit f9bf3e260c480f7b660bec3f78a13f52a46ec34d
Author: Daniel Mack <daniel at zonque.org>
Date:   Tue Feb 24 16:18:43 2015 +0100

    shared/unit-name: fix gcc5 warning
    
    Fix the following gcc5 warning:
    
      CC       src/shared/libsystemd_shared_la-unit-name.lo
    src/shared/unit-name.c: In function 'unit_name_is_valid':
    src/shared/unit-name.c:102:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
                     if (!template_ok == TEMPLATE_VALID && at+1 == e)
                                      ^

diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index 0cc06f4..86d6ce3 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -99,7 +99,7 @@ bool unit_name_is_valid(const char *n, enum template_valid template_ok) {
                 if (at == n)
                         return false;
 
-                if (!template_ok == TEMPLATE_VALID && at+1 == e)
+                if (template_ok != TEMPLATE_VALID && at+1 == e)
                         return false;
         }
 



More information about the systemd-commits mailing list