aboutsummaryrefslogtreecommitdiff
path: root/pearl.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 /pearl.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 'pearl.c')
-rw-r--r--pearl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pearl.c b/pearl.c
index ef2cd0a..0c44d14 100644
--- a/pearl.c
+++ b/pearl.c
@@ -296,7 +296,8 @@ static int pearl_solve(int w, int h, char *clues, char *result,
{
int W = 2*w+1, H = 2*h+1;
short *workspace;
- int *dsf, *dsfsize;
+ DSF *dsf;
+ int *dsfsize;
int x, y, b, d;
int ret = -1;
@@ -1531,7 +1532,7 @@ static char nbits[16] = { 0, 1, 1, 2,
/* Returns false if the state is invalid. */
static bool dsf_update_completion(game_state *state, int ax, int ay, char dir,
- int *dsf)
+ DSF *dsf)
{
int w = state->shared->w /*, h = state->shared->h */;
int ac = ay*w+ax, bx, by, bc;
@@ -1556,7 +1557,8 @@ static bool check_completion(game_state *state, bool mark)
{
int w = state->shared->w, h = state->shared->h, x, y, i, d;
bool had_error = false;
- int *dsf, *component_state;
+ DSF *dsf;
+ int *component_state;
int nsilly, nloop, npath, largest_comp, largest_size, total_pathsize;
enum { COMP_NONE, COMP_LOOP, COMP_PATH, COMP_SILLY, COMP_EMPTY };