[librsvg] rsvg-styles: Fix badly structured comparisons



commit ac59670ca8d8f648f1718cd25b68b97a0feb0baf
Author: Philip Withnall <withnall endlessm com>
Date:   Thu Nov 30 10:41:58 2017 +0000

    rsvg-styles: Fix badly structured comparisons
    
    It looks like someone ported from g_strcmp0() to g_str_equal() at some
    point and forgot to remove the return value comparison, leaving two
    comparisons against the g_str_equal() return value in the condition.
    
    Drop one of the comparisons, hoping it’s the right one based on the
    context.
    
    Spotted with -Wlogical-not-parentheses.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791017

 rsvg-styles.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/rsvg-styles.c b/rsvg-styles.c
index efba208..2625048 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -700,7 +700,7 @@ rsvg_parse_style_pair (RsvgState * state,
         state->has_visible = TRUE;
         if (g_str_equal (value, "none"))
             state->visible = FALSE;
-        else if (!g_str_equal (value, "inherit") != 0)
+        else if (!g_str_equal (value, "inherit"))
             state->visible = TRUE;
         else
             state->has_visible = FALSE;
@@ -708,7 +708,7 @@ rsvg_parse_style_pair (RsvgState * state,
         state->has_space_preserve = TRUE;
         if (g_str_equal (value, "default"))
             state->space_preserve = FALSE;
-        else if (!g_str_equal (value, "preserve") == 0)
+        else if (g_str_equal (value, "preserve"))
             state->space_preserve = TRUE;
         else
             state->space_preserve = FALSE;
@@ -716,7 +716,7 @@ rsvg_parse_style_pair (RsvgState * state,
         state->has_visible = TRUE;
         if (g_str_equal (value, "visible"))
             state->visible = TRUE;
-        else if (!g_str_equal (value, "inherit") != 0)
+        else if (!g_str_equal (value, "inherit"))
             state->visible = FALSE;     /* collapse or hidden */
         else
             state->has_visible = FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]