diff --git a/loopy.c b/loopy.c index 3545976..0a22e6a 100644 --- a/loopy.c +++ b/loopy.c @@ -1370,7 +1370,7 @@ static bool game_has_unique_soln(const game_state *state, int diff) { bool ret; solver_state *sstate_new; - solver_state *sstate = new_solver_state((game_state *)state, diff); + solver_state *sstate = new_solver_state(state, diff); sstate_new = solve_game_rec(sstate); diff --git a/magnets.c b/magnets.c index 7ac97c1..f8d159a 100644 --- a/magnets.c +++ b/magnets.c @@ -551,7 +551,7 @@ static const char *validate_desc(const game_params *params, const char *desc) { const char *prob; game_state *st = new_game_int(params, desc, &prob); - if (!st) return (char*)prob; + if (!st) return prob; free_game(st); return NULL; } @@ -2590,7 +2590,7 @@ static void start_soak(game_params *p, random_state *rs) sfree(aux); } -int main(int argc, const char *argv[]) +int main(int argc, char *argv[]) { bool print = false, soak = false, solved = false; int ret; diff --git a/random.c b/random.c index fb54560..5527d6f 100644 --- a/random.c +++ b/random.c @@ -109,7 +109,7 @@ void SHA_Init(SHA_State * s) void SHA_Bytes(SHA_State * s, const void *p, int len) { - unsigned char *q = (unsigned char *) p; + const unsigned char *q = (const unsigned char *) p; uint32 wordblock[16]; uint32 lenw = len; int i; diff --git a/signpost.c b/signpost.c index cdc958e..97beefd 100644 --- a/signpost.c +++ b/signpost.c @@ -1031,8 +1031,8 @@ static void connect_numbers(game_state *state) static int compare_heads(const void *a, const void *b) { - struct head_meta *ha = (struct head_meta *)a; - struct head_meta *hb = (struct head_meta *)b; + const struct head_meta *ha = (const struct head_meta *)a; + const struct head_meta *hb = (const struct head_meta *)b; /* Heads with preferred colours first... */ if (ha->preference && !hb->preference) return -1; @@ -2421,7 +2421,7 @@ static void process_desc(char *id) thegame.free_params(p); } -int main(int argc, const char *argv[]) +int main(int argc, char *argv[]) { char *id = NULL, *desc, *aux = NULL; const char *err; diff --git a/untangle.c b/untangle.c index 34924ae..cd1762f 100644 --- a/untangle.c +++ b/untangle.c @@ -444,8 +444,8 @@ typedef struct vertex { static int vertcmpC(const void *av, const void *bv) { - const vertex *a = (vertex *)av; - const vertex *b = (vertex *)bv; + const vertex *a = (const vertex *)av; + const vertex *b = (const vertex *)bv; if (a->param < b->param) return -1;