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. --- filling.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'filling.c') diff --git a/filling.c b/filling.c index b2f08b5..f95949c 100644 --- a/filling.c +++ b/filling.c @@ -411,7 +411,7 @@ static void make_board(int *board, int w, int h, random_state *rs) { dsf = snew_dsf(sz); retry: - dsf_init(dsf, sz); + dsf_reinit(dsf); shuffle(board, sz, sizeof (int), rs); do { @@ -946,7 +946,7 @@ static bool learn_bitmap_deductions(struct solver_state *s, int w, int h) * have a completely new n-region in it. */ for (n = 1; n <= 9; n++) { - dsf_init(dsf, sz); + dsf_reinit(dsf); /* Build the dsf */ for (y = 0; y < h; y++) @@ -1137,7 +1137,7 @@ static DSF *make_dsf(DSF *dsf, int *board, const int w, const int h) { if (!dsf) dsf = snew_dsf(w * h); else - dsf_init(dsf, w * h); + dsf_reinit(dsf); for (i = 0; i < sz; ++i) { int j; -- cgit v1.1