mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Fix unused variable warnings from clang.
If you enable -DSTRICT=ON in cmake and also build with clang, it reports a couple of variables set but not otherwise used. One was genuinely unused ('loop_found' in loop_deductions in Loopy); the other is used by debug statements that are usually but not always compiled out.
This commit is contained in:
@ -416,6 +416,8 @@ static void debug_state(game_state *state)
|
|||||||
int x, y;
|
int x, y;
|
||||||
char c = '?';
|
char c = '?';
|
||||||
|
|
||||||
|
(void)c; /* placate -Wunused-but-set-variable if debug() does nothing */
|
||||||
|
|
||||||
for (y = 0; y < state->h; y++) {
|
for (y = 0; y < state->h; y++) {
|
||||||
for (x = 0; x < state->w; x++) {
|
for (x = 0; x < state->w; x++) {
|
||||||
c = '.';
|
c = '.';
|
||||||
|
3
loopy.c
3
loopy.c
@ -2713,7 +2713,6 @@ static int loop_deductions(solver_state *sstate)
|
|||||||
game_state *state = sstate->state;
|
game_state *state = sstate->state;
|
||||||
grid *g = state->game_grid;
|
grid *g = state->game_grid;
|
||||||
int shortest_chainlen = g->num_dots;
|
int shortest_chainlen = g->num_dots;
|
||||||
bool loop_found = false;
|
|
||||||
int dots_connected;
|
int dots_connected;
|
||||||
bool progress = false;
|
bool progress = false;
|
||||||
int i;
|
int i;
|
||||||
@ -2726,7 +2725,7 @@ static int loop_deductions(solver_state *sstate)
|
|||||||
*/
|
*/
|
||||||
for (i = 0; i < g->num_edges; i++) {
|
for (i = 0; i < g->num_edges; i++) {
|
||||||
if (state->lines[i] == LINE_YES) {
|
if (state->lines[i] == LINE_YES) {
|
||||||
loop_found |= merge_dots(sstate, i);
|
merge_dots(sstate, i);
|
||||||
edgecount++;
|
edgecount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user