aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--magnets.c1
-rw-r--r--mosaic.c6
-rw-r--r--palisade.c3
-rw-r--r--pattern.c6
-rw-r--r--samegame.c2
-rw-r--r--undead.c6
-rw-r--r--unruly.c2
7 files changed, 11 insertions, 15 deletions
diff --git a/magnets.c b/magnets.c
index 2d17cd1..a437b59 100644
--- a/magnets.c
+++ b/magnets.c
@@ -1590,6 +1590,7 @@ static int lay_dominoes(game_state *state, random_state *rs, int *scratch)
}
debug(("Laid %d dominoes, total %d dominoes.\n", nlaid, state->wh/2));
+ (void)nlaid;
game_debug(state, "Final layout");
return ret;
}
diff --git a/mosaic.c b/mosaic.c
index 7c18920..b2cb0a5 100644
--- a/mosaic.c
+++ b/mosaic.c
@@ -409,7 +409,7 @@ static void count_clues_around(const game_params *params,
static void mark_around(const game_params *params,
struct solution_cell *sol, int x, int y, int mark)
{
- int i, j, marked = 0;
+ int i, j;
struct solution_cell *curr;
for (i = -1; i < 2; i++) {
@@ -418,7 +418,6 @@ static void mark_around(const game_params *params,
if (curr) {
if (curr->cell == STATE_UNMARKED) {
curr->cell = mark;
- marked++;
}
}
}
@@ -585,7 +584,7 @@ static bool solve_game_actual(const game_params *params,
int board_size = params->height * params->width;
struct solution_cell *sol = snewn(board_size, struct solution_cell);
bool made_progress = true, error = false;
- int solved = 0, iter = 0, curr = 0;
+ int solved = 0, curr = 0;
memset(sol, 0, params->height * params->width * sizeof(*sol));
solved = 0;
@@ -607,7 +606,6 @@ static bool solve_game_actual(const game_params *params,
solved += curr;
}
}
- iter++;
}
if (sol_return) {
*sol_return = sol;
diff --git a/palisade.c b/palisade.c
index 67fb9a1..83b5983 100644
--- a/palisade.c
+++ b/palisade.c
@@ -634,8 +634,6 @@ static char *new_game_desc(const game_params *params, random_state *rs,
DSF *dsf = NULL;
int i, r, c;
- int attempts = 0;
-
for (i = 0; i < wh; ++i) shuf[i] = i;
xshuffle(shuf, wh, rs);
@@ -646,7 +644,6 @@ static char *new_game_desc(const game_params *params, random_state *rs,
soln[wh] = '\0';
do {
- ++attempts;
setmem(soln, '@', wh);
dsf_free(dsf);
diff --git a/pattern.c b/pattern.c
index 7bcca82..1eafaff 100644
--- a/pattern.c
+++ b/pattern.c
@@ -663,7 +663,7 @@ static bool solve_puzzle(const game_state *state, unsigned char *grid,
#ifndef STANDALONE_PICTURE_GENERATOR
static unsigned char *generate_soluble(random_state *rs, int w, int h)
{
- int i, j, ntries, max;
+ int i, j, max;
bool ok;
unsigned char *grid, *matrix, *workspace;
unsigned int *changed_h, *changed_w;
@@ -679,11 +679,7 @@ static unsigned char *generate_soluble(random_state *rs, int w, int h)
changed_w = snewn(max+1, unsigned int);
rowdata = snewn(max+1, int);
- ntries = 0;
-
do {
- ntries++;
-
generate(rs, w, h, grid);
/*
diff --git a/samegame.c b/samegame.c
index 5e79115..4eacc90 100644
--- a/samegame.c
+++ b/samegame.c
@@ -865,6 +865,8 @@ static void gen_grid(int w, int h, int nc, int *grid, random_state *rs)
#if defined GENERATION_DIAGNOSTICS || defined COUNT_FAILURES
printf("%d failures\n", failures);
+#else
+ (void)failures;
#endif
#ifdef GENERATION_DIAGNOSTICS
{
diff --git a/undead.c b/undead.c
index d2a07a3..38543ba 100644
--- a/undead.c
+++ b/undead.c
@@ -976,7 +976,7 @@ static int path_cmp(const void *a, const void *b) {
static char *new_game_desc(const game_params *params, random_state *rs,
char **aux, bool interactive) {
- int i,count,c,w,h,r,p,g;
+ int count,c,w,h,r,p,g;
game_state *new;
/* Variables for puzzle generation algorithm */
@@ -997,7 +997,6 @@ static char *new_game_desc(const game_params *params, random_state *rs,
char *e;
char *desc;
- i = 0;
while (true) {
new = new_state(params);
abort = false;
@@ -1257,7 +1256,6 @@ static char *new_game_desc(const game_params *params, random_state *rs,
* difficulty level, free memory and start from scratch */
sfree(old_guess);
free_game(new);
- i++;
}
/* We have a valid puzzle! */
@@ -1578,6 +1576,8 @@ static char *solve_game(const game_state *state_start, const game_state *currsta
}
/* printf("Puzzle solved at level %s, iterations %d, ambiguous %d\n", (solved_bruteforce ? "TRICKY" : "NORMAL"), iterative_depth, count_ambiguous); */
+ (void)iterative_depth;
+ (void)count_ambiguous;
move = snewn(solve_state->common->num_total * 4 +2, char);
c = move;
diff --git a/unruly.c b/unruly.c
index 191be78..18c411f 100644
--- a/unruly.c
+++ b/unruly.c
@@ -1398,6 +1398,8 @@ static char *new_game_desc(const game_params *params, random_state *rs,
temp_verbose = solver_verbose;
solver_verbose = false;
}
+#else
+ (void)attempts;
#endif
unruly_free_scratch(scratch);