mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
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:
@ -951,7 +951,7 @@ static int gg_best_clue(game_state *state, int *scratch, digit *latin)
|
||||
{
|
||||
int ls = state->order * state->order * 5;
|
||||
int maxposs = 0, minclues = 5, best = -1, i, j;
|
||||
int nposs, nclues, loc, x, y;
|
||||
int nposs, nclues, loc;
|
||||
|
||||
#ifdef STANDALONE_SOLVER
|
||||
if (solver_show_working) {
|
||||
@ -964,7 +964,6 @@ static int gg_best_clue(game_state *state, int *scratch, digit *latin)
|
||||
if (!gg_place_clue(state, scratch[i], latin, 1)) continue;
|
||||
|
||||
loc = scratch[i] / 5;
|
||||
x = loc % state->order; y = loc / state->order;
|
||||
for (j = nposs = 0; j < state->order; j++) {
|
||||
if (state->hints[loc*state->order + j]) nposs++;
|
||||
}
|
||||
@ -975,9 +974,11 @@ static int gg_best_clue(game_state *state, int *scratch, digit *latin)
|
||||
(nposs == maxposs && nclues < minclues)) {
|
||||
best = i; maxposs = nposs; minclues = nclues;
|
||||
#ifdef STANDALONE_SOLVER
|
||||
if (solver_show_working)
|
||||
if (solver_show_working) {
|
||||
int x = loc % state->order, y = loc / state->order;
|
||||
printf("gg_best_clue: b%d (%d,%d) new best [%d poss, %d clues].\n",
|
||||
best, x+1, y+1, nposs, nclues);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user