diff options
| author | Simon Tatham <anakin@pobox.com> | 2023-04-20 14:06:43 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2023-04-20 17:23:21 +0100 |
| commit | 89c438e149a91fffa74b2669f7e0cd05abc3420f (patch) | |
| tree | a307d0c2dde7c2868e32a840497d44051d9b4630 /solo.c | |
| parent | 7abf85a9c6b460698994d9cfa538b7b26fed5e87 (diff) | |
| download | puzzles-89c438e149a91fffa74b2669f7e0cd05abc3420f.zip puzzles-89c438e149a91fffa74b2669f7e0cd05abc3420f.tar.gz puzzles-89c438e149a91fffa74b2669f7e0cd05abc3420f.tar.bz2 puzzles-89c438e149a91fffa74b2669f7e0cd05abc3420f.tar.xz | |
Declare all dsfs as a dedicated type name 'DSF'.
In this commit, 'DSF' is simply a typedef for 'int', so that the new
declaration form 'DSF *' translates to the same type 'int *' that dsfs
have always had. So all we're doing here is mechanically changing type
declarations throughout the code.
Diffstat (limited to 'solo.c')
| -rw-r--r-- | solo.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -3226,7 +3226,7 @@ static char *encode_solve_move(int cr, digit *grid) return ret; } -static void dsf_to_blocks(int *dsf, struct block_structure *blocks, +static void dsf_to_blocks(DSF *dsf, struct block_structure *blocks, int min_expected, int max_expected) { int cr = blocks->c * blocks->r, area = cr * cr; @@ -3689,7 +3689,7 @@ static char *new_game_desc(const game_params *params, random_state *rs, * constructing the block structure. */ if (r == 1) { /* jigsaw mode */ - int *dsf = divvy_rectangle(cr, cr, cr, rs); + DSF *dsf = divvy_rectangle(cr, cr, cr, rs); dsf_to_blocks (dsf, blocks, cr, cr); @@ -3908,12 +3908,12 @@ static const char *spec_to_grid(const char *desc, digit *grid, int area) * end of the block spec, and return an error string or NULL if everything * is OK. The DSF is stored in *PDSF. */ -static const char *spec_to_dsf(const char **pdesc, int **pdsf, +static const char *spec_to_dsf(const char **pdesc, DSF **pdsf, int cr, int area) { const char *desc = *pdesc; int pos = 0; - int *dsf; + DSF *dsf; *pdsf = dsf = snew_dsf(area); @@ -4013,7 +4013,7 @@ static const char *validate_block_desc(const char **pdesc, int cr, int area, int min_nr_squares, int max_nr_squares) { const char *err; - int *dsf; + DSF *dsf; err = spec_to_dsf(pdesc, &dsf, cr, area); if (err) { @@ -4166,7 +4166,7 @@ static game_state *new_game(midend *me, const game_params *params, if (r == 1) { const char *err; - int *dsf; + DSF *dsf; assert(*desc == ','); desc++; err = spec_to_dsf(&desc, &dsf, cr, area); @@ -4184,7 +4184,7 @@ static game_state *new_game(midend *me, const game_params *params, if (params->killer) { const char *err; - int *dsf; + DSF *dsf; assert(*desc == ','); desc++; err = spec_to_dsf(&desc, &dsf, cr, area); |