mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Use a dedicated copy function to copy dsfs.
Previously we were duplicating the contents of a dsf using straight-up memcpy. Now there's a dsf_copy function wrapping the same memcpy. For the moment, this still has to take a size parameter, because the size isn't stored inside the dsf itself. But once we make a proper data type, it will be.
This commit is contained in:
@ -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));
|
||||
|
||||
memcpy(to->dsf, from->dsf, to->n*sizeof(int));
|
||||
dsf_copy(to->dsf, from->dsf, to->n);
|
||||
memcpy(to->numsi, from->numsi, (to->n+1)*sizeof(int));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user