Fix warnings generated by gcc 4.6.0 about variables set but not

thereafter read. Most of these changes are just removal of pointless
stuff or trivial reorganisations; one change is actually substantive,
and fixes a bug in Keen's clue selection (the variable 'bad' was
unreferenced not because I shouldn't have set it, but because I
_should_ have referenced it!).

[originally from svn r9164]
This commit is contained in:
Simon Tatham
2011-05-04 18:22:14 +00:00
parent 4bab5e531b
commit 2efc77d2fd
14 changed files with 31 additions and 54 deletions

View File

@ -1402,6 +1402,7 @@ static int strip_unused_nums(game_state *state)
}
}
}
debug(("Stripped %d unused numbers.\n", n));
return n;
}
@ -1475,7 +1476,7 @@ static char *new_game_desc(game_params *params, random_state *rs,
char **aux, int interactive)
{
game_state *news = new_state(params), *copys;
int nsol, i, j, run, x, y, wh = params->w*params->h, num;
int i, j, run, x, y, wh = params->w*params->h, num;
char *ret, *p;
int *numindices;
@ -1499,8 +1500,7 @@ static char *new_game_desc(game_params *params, random_state *rs,
/* Take a copy, remove numbers we didn't use and check there's
* still a unique solution; if so, use the copy subsequently. */
copys = dup_game(news);
nsol = strip_unused_nums(copys);
debug(("Stripped %d unused numbers.\n", nsol));
strip_unused_nums(copys);
if (!puzzle_is_good(copys, params->difficulty)) {
debug(("Stripped grid is not good, reverting.\n"));
free_game(copys);