Fix warnings generated by gcc 4.6.0 about variables set but not
[sgt/puzzles] / grid.c
diff --git a/grid.c b/grid.c
index f7c6a5c..d7e6442 100644 (file)
--- a/grid.c
+++ b/grid.c
@@ -454,6 +454,14 @@ static void grid_trim_vigorously(grid *g)
         dots[i] = (dots[i] ? newdots++ : -1);
 
     /*
+     * Free the dynamically allocated 'dots' pointer lists in faces
+     * we're going to discard.
+     */
+    for (i = 0; i < g->num_faces; i++)
+        if (faces[i] < 0)
+            sfree(g->faces[i].dots);
+
+    /*
      * Go through and compact the arrays.
      */
     for (i = 0; i < g->num_dots; i++)
@@ -1559,9 +1567,11 @@ grid *grid_new_triangular(int width, int height, char *desc)
             f1->edges = NULL;
             f1->order = 3;
             f1->dots = snewn(f1->order, grid_dot*);
+            f1->has_incentre = FALSE;
             f2->edges = NULL;
             f2->order = 3;
             f2->dots = snewn(f2->order, grid_dot*);
+            f2->has_incentre = FALSE;
 
             /* face descriptions depend on whether the row-number is
              * odd or even */