It's a new year.
[sgt/puzzles] / mines.c
diff --git a/mines.c b/mines.c
index 4210b56..c9bae21 100644 (file)
--- a/mines.c
+++ b/mines.c
@@ -58,7 +58,7 @@ struct mine_layout {
 
 struct game_state {
     int w, h, n, dead, won;
-    int used_solve, just_used_solve;
+    int used_solve;
     struct mine_layout *layout;               /* real mine positions */
     signed char *grid;                        /* player knowledge */
     /*
@@ -275,14 +275,16 @@ static char *validate_params(game_params *params, int full)
 /*
  * Count the bits in a word. Only needs to cope with 16 bits.
  */
-static int bitcount16(int word)
+static int bitcount16(int inword)
 {
+    unsigned int word = inword;
+
     word = ((word & 0xAAAA) >> 1) + (word & 0x5555);
     word = ((word & 0xCCCC) >> 2) + (word & 0x3333);
     word = ((word & 0xF0F0) >> 4) + (word & 0x0F0F);
     word = ((word & 0xFF00) >> 8) + (word & 0x00FF);
 
-    return word;
+    return (int)word;
 }
 
 /*
@@ -2167,7 +2169,7 @@ static game_state *new_game(midend *me, game_params *params, char *desc)
     state->h = params->h;
     state->n = params->n;
     state->dead = state->won = FALSE;
-    state->used_solve = state->just_used_solve = FALSE;
+    state->used_solve = FALSE;
 
     wh = state->w * state->h;
 
@@ -2272,7 +2274,6 @@ static game_state *dup_game(game_state *state)
     ret->dead = state->dead;
     ret->won = state->won;
     ret->used_solve = state->used_solve;
-    ret->just_used_solve = state->just_used_solve;
     ret->layout = state->layout;
     ret->layout->refcount++;
     ret->grid = snewn(ret->w * ret->h, signed char);
@@ -2573,13 +2574,12 @@ static game_state *execute_move(game_state *from, char *move)
                    ret->grid[yy*ret->w+xx] = v;
                }
            }
-       ret->used_solve = ret->just_used_solve = TRUE;
+       ret->used_solve = TRUE;
        ret->won = TRUE;
 
        return ret;
     } else {
        ret = dup_game(from);
-       ret->just_used_solve = FALSE;
 
        while (*move) {
            if (move[0] == 'F' &&
@@ -2636,7 +2636,7 @@ static void game_set_size(drawing *dr, game_drawstate *ds,
     ds->tilesize = tilesize;
 }
 
-static float *game_colours(frontend *fe, game_state *state, int *ncolours)
+static float *game_colours(frontend *fe, int *ncolours)
 {
     float *ret = snewn(3 * NCOLOURS, float);
 
@@ -3021,11 +3021,6 @@ static float game_flash_length(game_state *oldstate, game_state *newstate,
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     if (state->dead || state->won || ui->completed || !state->layout->mines)
@@ -3077,7 +3072,7 @@ const struct game thegame = {
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,                             /* wants_statusbar */
     TRUE, game_timing_state,
     BUTTON_BEATS(LEFT_BUTTON, RIGHT_BUTTON),
 };