From 0b93de904a98f119b1a95d3a53029f1ed4bfb9b3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 12 Apr 2013 17:11:49 +0000 Subject: Add 'const' to the game_params arguments in validate_desc and new_desc. Oddities in the 'make test' output brought to my attention that a few puzzles have been modifying their input game_params for various reasons; they shouldn't do that, because that's the game_params held permanently by the midend and it will affect subsequent game generations if they modify it. So now those arguments are const, and all the games which previously modified their game_params now take a copy and modify that instead. [originally from svn r9830] --- flip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'flip.c') diff --git a/flip.c b/flip.c index c30e484..e42e8c0 100644 --- a/flip.c +++ b/flip.c @@ -347,7 +347,7 @@ static void addneighbours(tree234 *t, int w, int h, int cx, int cy, addsq(t, w, h, cx, cy, x, y+1, matrix); } -static char *new_game_desc(game_params *params, random_state *rs, +static char *new_game_desc(const game_params *params, random_state *rs, char **aux, int interactive) { int w = params->w, h = params->h, wh = w * h; @@ -596,7 +596,7 @@ static char *new_game_desc(game_params *params, random_state *rs, return ret; } -static char *validate_desc(game_params *params, char *desc) +static char *validate_desc(const game_params *params, char *desc) { int w = params->w, h = params->h, wh = w * h; int mlen = (wh*wh+3)/4, glen = (wh+3)/4; -- cgit v1.1