aboutsummaryrefslogtreecommitdiff
path: root/signpost.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-04-20 14:46:46 +0100
committerSimon Tatham <anakin@pobox.com>2023-04-20 17:30:03 +0100
commit348aac4c85da21e09c29c58866d178df3204d73c (patch)
treeeff802bf3ef3b5459bbe268e35328b1155cf3472 /signpost.c
parentdad2f35502c611dae758915cfb6dface4a303550 (diff)
downloadpuzzles-348aac4c85da21e09c29c58866d178df3204d73c.zip
puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.gz
puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.bz2
puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.xz
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.
Diffstat (limited to 'signpost.c')
-rw-r--r--signpost.c6
1 files changed, 3 insertions, 3 deletions
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);