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] --- map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'map.c') diff --git a/map.c b/map.c index af7c0af..34a9536 100644 --- a/map.c +++ b/map.c @@ -1393,7 +1393,7 @@ static int map_solver(struct solver_scratch *sc, * Game generation main function. */ -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) { struct solver_scratch *sc = NULL; @@ -1704,7 +1704,7 @@ static char *new_game_desc(game_params *params, random_state *rs, return ret; } -static char *parse_edge_list(game_params *params, char **desc, int *map) +static char *parse_edge_list(const game_params *params, char **desc, int *map) { int w = params->w, h = params->h, wh = w*h, n = params->n; int i, k, pos, state; @@ -1780,7 +1780,7 @@ static char *parse_edge_list(game_params *params, char **desc, int *map) return NULL; } -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, n = params->n; int area; -- cgit v1.1