diff options
| author | Simon Tatham <anakin@pobox.com> | 2017-10-01 14:45:12 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2017-10-01 16:35:40 +0100 |
| commit | a58c1b216bb1d4547f7b2ef2703fe2d0cd3b5cac (patch) | |
| tree | b9bcdc589ffe1f72e2510237b6e1524f5b96085c /map.c | |
| parent | 3276376d1be74b66970b88c3e941dcedf8d22474 (diff) | |
| download | puzzles-a58c1b216bb1d4547f7b2ef2703fe2d0cd3b5cac.zip puzzles-a58c1b216bb1d4547f7b2ef2703fe2d0cd3b5cac.tar.gz puzzles-a58c1b216bb1d4547f7b2ef2703fe2d0cd3b5cac.tar.bz2 puzzles-a58c1b216bb1d4547f7b2ef2703fe2d0cd3b5cac.tar.xz | |
Make the code base clean under -Wwrite-strings.
I've also added that warning option and -Werror to the build script,
so that I'll find out if I break this property in future.
Diffstat (limited to 'map.c')
| -rw-r--r-- | map.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -873,7 +873,7 @@ static const char colnames[FOUR] = { 'R', 'Y', 'G', 'B' }; static int place_colour(struct solver_scratch *sc, int *colouring, int index, int colour #ifdef SOLVER_DIAGNOSTICS - , char *verb + , const char *verb #endif ) { @@ -920,7 +920,7 @@ static char *colourset(char *buf, int set) { int i; char *p = buf; - char *sep = ""; + const char *sep = ""; for (i = 0; i < FOUR; i++) if (set & (1 << i)) { @@ -1214,7 +1214,8 @@ static int map_solver(struct solver_scratch *sc, (sc->possible[k] & currc)) { #ifdef SOLVER_DIAGNOSTICS if (verbose) { - char buf[80], *sep = ""; + char buf[80]; + const char *sep = ""; int r; printf("%*sforcing chain, colour %s, ", @@ -1699,8 +1700,8 @@ static char *new_game_desc(const game_params *params, random_state *rs, return ret; } -static char *parse_edge_list(const game_params *params, const char **desc, - int *map) +static const char *parse_edge_list(const game_params *params, + const char **desc, int *map) { int w = params->w, h = params->h, wh = w*h, n = params->n; int i, k, pos, state; @@ -1781,7 +1782,7 @@ static const char *validate_desc(const game_params *params, const char *desc) int w = params->w, h = params->h, wh = w*h, n = params->n; int area; int *map; - char *ret; + const char *ret; map = snewn(2*wh, int); ret = parse_edge_list(params, &desc, map); @@ -1841,7 +1842,7 @@ static game_state *new_game(midend *me, const game_params *params, p = desc; { - char *ret; + const char *ret; ret = parse_edge_list(params, &p, state->map->map); assert(!ret); } |