[dia] [warningectomy] variable 'flip' is used uninitialized whenever ...



commit 7ff3cbb07369c0bca9d19b957d45dc9dd1c40aee
Author: Hans Breuer <hans breuer org>
Date:   Thu Oct 2 00:23:48 2014 +0200

    [warningectomy] variable 'flip' is used uninitialized whenever ...
    
    path-math.c:579:14: warning: variable 'flip' is used uninitialized whenever 'if' condition is false 
[-Wsometimes-uninitialized]
      } else if (distance_point_point (&eseg->p3,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    path-math.c:590:7: note: uninitialized use occurs here
      if (flip) {
          ^~~~
    path-math.c:579:10: note: remove the 'if' if its condition is always true
      } else if (distance_point_point (&eseg->p3,
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    path-math.c:569:16: note: initialize the variable 'flip' to silence this warning
      gboolean flip;
                   ^
                    = 0

 lib/path-math.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/lib/path-math.c b/lib/path-math.c
index df4b292..22f3673 100644
--- a/lib/path-math.c
+++ b/lib/path-math.c
@@ -585,6 +585,7 @@ _append_segments (GArray  *path,
     bp.type = BEZ_MOVE_TO;
     bp.p1 = sseg->p0;
     g_array_append_val (path, bp);
+    flip = FALSE;
   }
 
   if (flip) {


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