chiark / gitweb /
Add pointless initialisations to placate a gcc warning.
authorSimon Tatham <anakin@pobox.com>
Fri, 1 Jun 2012 18:41:23 +0000 (18:41 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 1 Jun 2012 18:41:23 +0000 (18:41 +0000)
(I'm confident these can't happen. maxb is initialised whenever we
break from the first loop with y < h, and when we don't break from
that loop the second loop which uses maxb is run zero times. But gcc
can't work that out, sigh.)

[originally from svn r9546]

bridges.c

index 5a98ac1182d607d2a60662970f784fbd389a4cce..e0bd60940c07ff33fb0690248af5b811326e390c 100644 (file)
--- a/bridges.c
+++ b/bridges.c
@@ -940,6 +940,7 @@ static void map_update_possibles(game_state *state)
         idx = x;
         s = e = -1;
         bl = 0;
+        maxb = state->params.maxb;     /* placate optimiser */
         /* Unset possible flags until we find an island. */
         for (y = 0; y < state->h; y++) {
             is_s = IDX(state, gridi, idx);
@@ -985,6 +986,7 @@ static void map_update_possibles(game_state *state)
         idx = y*w;
         s = e = -1;
         bl = 0;
+        maxb = state->params.maxb;     /* placate optimiser */
         for (x = 0; x < state->w; x++) {
             is_s = IDX(state, gridi, idx);
             if (is_s) {