aboutsummaryrefslogtreecommitdiff
path: root/palisade.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-04-20 14:06:43 +0100
committerSimon Tatham <anakin@pobox.com>2023-04-20 17:23:21 +0100
commit89c438e149a91fffa74b2669f7e0cd05abc3420f (patch)
treea307d0c2dde7c2868e32a840497d44051d9b4630 /palisade.c
parent7abf85a9c6b460698994d9cfa538b7b26fed5e87 (diff)
downloadpuzzles-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 'palisade.c')
-rw-r--r--palisade.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/palisade.c b/palisade.c
index 5acfaa4..b76a467 100644
--- a/palisade.c
+++ b/palisade.c
@@ -186,7 +186,7 @@ typedef struct solver_ctx {
const game_params *params; /* also in shared_state */
clue *clues; /* also in shared_state */
borderflag *borders; /* also in game_state */
- int *dsf; /* particular to the solver */
+ DSF *dsf; /* particular to the solver */
} solver_ctx;
/* Deductions:
@@ -506,7 +506,7 @@ static bool solver_equivalent_edges(solver_ctx *ctx)
}
/* build connected components in `dsf', along the lines of `borders'. */
-static void build_dsf(int w, int h, borderflag *border, int *dsf, bool black)
+static void build_dsf(int w, int h, borderflag *border, DSF *dsf, bool black)
{
int x, y;
@@ -527,7 +527,7 @@ static bool is_solved(const game_params *params, clue *clues,
{
int w = params->w, h = params->h, wh = w*h, k = params->k;
int i, x, y;
- int *dsf = snew_dsf(wh);
+ DSF *dsf = snew_dsf(wh);
build_dsf(w, h, border, dsf, true);
@@ -631,7 +631,8 @@ static char *new_game_desc(const game_params *params, random_state *rs,
char *soln = snewa(*aux, wh + 2);
int *shuf = snewn(wh, int);
- int *dsf = NULL, i, r, c;
+ DSF *dsf = NULL;
+ int i, r, c;
int attempts = 0;
@@ -1171,7 +1172,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
{
int w = state->shared->params.w, h = state->shared->params.h, wh = w*h;
int r, c, flash = ((int) (flashtime * 5 / FLASH_TIME)) % 2;
- int *black_border_dsf = snew_dsf(wh), *yellow_border_dsf = snew_dsf(wh);
+ DSF *black_border_dsf = snew_dsf(wh), *yellow_border_dsf = snew_dsf(wh);
int k = state->shared->params.k;
if (!ds->grid) {