mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 08:25:45 -07:00
Mike's changes to dsf.c alter the internal storage format of dsf
structures, meaning that ad-hoc initialisation now doesn't work. Hence, this checkin converts all ad-hoc dsf initialisations into calls to dsf_init() or snew_dsf(). At least, I _hope_ I've caught all of them. [originally from svn r6888]
This commit is contained in:
@ -1064,8 +1064,7 @@ static void map_group(game_state *state)
|
||||
struct island *is, *is_join;
|
||||
|
||||
/* Initialise dsf. */
|
||||
for (i = 0; i < wh; i++)
|
||||
dsf[i] = i;
|
||||
dsf_init(dsf, wh);
|
||||
|
||||
/* For each island, find connected islands right or down
|
||||
* and merge the dsf for the island squares as well as the
|
||||
@ -1602,9 +1601,8 @@ static game_state *new_state(game_params *params)
|
||||
ret->solved = ret->completed = 0;
|
||||
|
||||
ret->solver = snew(struct solver_state);
|
||||
ret->solver->dsf = snewn(wh, int);
|
||||
ret->solver->dsf = snew_dsf(wh);
|
||||
ret->solver->tmpdsf = snewn(wh, int);
|
||||
for (i = 0; i < wh; i++) ret->solver->dsf[i] = i;
|
||||
|
||||
ret->solver->refcount = 1;
|
||||
|
||||
|
Reference in New Issue
Block a user