mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 08:25:45 -07:00
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]
This commit is contained in:
@ -361,7 +361,7 @@ static int solver_normal(struct latin_solver *solver, void *vctx)
|
||||
#define SOLVER(upper,title,func,lower) func,
|
||||
static usersolver_t const group_solvers[] = { DIFFLIST(SOLVER) };
|
||||
|
||||
static int solver(game_params *params, digit *grid, int maxdiff)
|
||||
static int solver(const game_params *params, digit *grid, int maxdiff)
|
||||
{
|
||||
int w = params->w;
|
||||
int ret;
|
||||
@ -595,7 +595,7 @@ static const struct groups groups[] = {
|
||||
|
||||
/* ----- data generated by group.gap ends ----- */
|
||||
|
||||
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, a = w*w;
|
||||
@ -810,7 +810,7 @@ static char *validate_grid_desc(const char **pdesc, int range, int area)
|
||||
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, a = w*w;
|
||||
const char *p = desc;
|
||||
|
Reference in New Issue
Block a user