From bb561ee3b18be69e52b17cedde50eac96ea409da Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 20 Apr 2023 13:35:58 +0100 Subject: Use a dedicated free function to free dsfs. No functional change: currently, this just wraps the previous sfree call. --- filling.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'filling.c') diff --git a/filling.c b/filling.c index 7e74e2d..6814a1a 100644 --- a/filling.c +++ b/filling.c @@ -464,7 +464,7 @@ retry: for (i = 0; i < sz; ++i) board[i] = dsf_size(dsf, i); merge_ones(board, w, h); - sfree(dsf); + dsf_free(dsf); } static void merge(int *dsf, int *connected, int a, int b) { @@ -1118,11 +1118,11 @@ static bool solver(const int *orig, int w, int h, char **solution) { (*solution)[sz + 1] = '\0'; } - sfree(ss.dsf); + dsf_free(ss.dsf); sfree(ss.board); sfree(ss.connected); sfree(ss.bm); - sfree(ss.bmdsf); + dsf_free(ss.bmdsf); sfree(ss.bmminsize); return !ss.nempty; @@ -1226,7 +1226,7 @@ static void minimize_clue_set(int *board, int w, int h, random_state *rs) } } sfree(next); - sfree(dsf); + dsf_free(dsf); /* * Now go through individual cells, in the same shuffled order, @@ -1617,7 +1617,7 @@ static game_state *execute_move(const game_state *state, const char *move) int *dsf = make_dsf(NULL, new_state->board, w, h); int i; for (i = 0; i < sz && new_state->board[i] == dsf_size(dsf, i); ++i); - sfree(dsf); + dsf_free(dsf); if (i == sz) new_state->completed = true; } @@ -1717,7 +1717,7 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds) sfree(ds->v); sfree(ds->flags); sfree(ds->border_scratch); - sfree(ds->dsf_scratch); + dsf_free(ds->dsf_scratch); sfree(ds); } -- cgit v1.1