From 348aac4c85da21e09c29c58866d178df3204d73c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 20 Apr 2023 14:46:46 +0100 Subject: Remove size parameter from dsf init and copy functions. Now that the dsf knows its own size internally, there's no need to tell it again when one is copied or reinitialised. This makes dsf_init much more about *re*initialising a dsf, since now dsfs are always allocated using a function that will initialise them anyway. So I think it deserves a rename. --- signpost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'signpost.c') diff --git a/signpost.c b/signpost.c index 7374db8..51c49d7 100644 --- a/signpost.c +++ b/signpost.c @@ -282,7 +282,7 @@ static void strip_nums(game_state *state) { memset(state->next, -1, state->n*sizeof(int)); memset(state->prev, -1, state->n*sizeof(int)); memset(state->numsi, -1, (state->n+1)*sizeof(int)); - dsf_init(state->dsf, state->n); + dsf_reinit(state->dsf); } static bool check_nums(game_state *orig, game_state *copy, bool only_immutable) @@ -482,7 +482,7 @@ static void dup_game_to(game_state *to, const game_state *from) memcpy(to->next, from->next, to->n*sizeof(int)); memcpy(to->prev, from->prev, to->n*sizeof(int)); - dsf_copy(to->dsf, from->dsf, to->n); + dsf_copy(to->dsf, from->dsf); memcpy(to->numsi, from->numsi, (to->n+1)*sizeof(int)); } @@ -1018,7 +1018,7 @@ static void connect_numbers(game_state *state) { int i, di, dni; - dsf_init(state->dsf, state->n); + dsf_reinit(state->dsf); for (i = 0; i < state->n; i++) { if (state->next[i] != -1) { assert(state->prev[state->next[i]] == i); -- cgit v1.1