aboutsummaryrefslogtreecommitdiff
path: root/unfinished
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 /unfinished
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 'unfinished')
-rw-r--r--unfinished/separate.c4
-rw-r--r--unfinished/slide.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/unfinished/separate.c b/unfinished/separate.c
index b064f18..fdee409 100644
--- a/unfinished/separate.c
+++ b/unfinished/separate.c
@@ -189,7 +189,7 @@ struct solver_scratch {
/*
* Tracks connectedness between squares.
*/
- int *dsf;
+ DSF *dsf;
/*
* size[dsf_canonify(dsf, yx)] tracks the size of the
@@ -514,7 +514,7 @@ static unsigned char *generate(int w, int h, int k, random_state *rs)
gen_lock = snewn(wh, bool);
do {
- int *dsf = divvy_rectangle(w, h, k, rs);
+ DSF *dsf = divvy_rectangle(w, h, k, rs);
/*
* Go through the dsf and find the indices of all the
diff --git a/unfinished/slide.c b/unfinished/slide.c
index d607b39..f1a057e 100644
--- a/unfinished/slide.c
+++ b/unfinished/slide.c
@@ -294,7 +294,7 @@ static char *board_text_format(int w, int h, unsigned char *data,
bool *forcefield)
{
int wh = w*h;
- int *dsf = snew_dsf(wh);
+ DSF *dsf = snew_dsf(wh);
int i, x, y;
int retpos, retlen = (w*2+2)*(h*2+1)+1;
char *ret = snewn(retlen, char);
@@ -648,7 +648,7 @@ static void generate_board(int w, int h, int *rtx, int *rty, int *minmoves,
unsigned char *board, *board2;
bool *forcefield;
bool *tried_merge;
- int *dsf;
+ DSF *dsf;
int *list, nlist, pos;
int tx, ty;
int i, j;
@@ -2083,7 +2083,7 @@ static void draw_tile(drawing *dr, game_drawstate *ds,
draw_update(dr, tx, ty, TILESIZE, TILESIZE);
}
-static unsigned long find_piecepart(int w, int h, int *dsf, int x, int y)
+static unsigned long find_piecepart(int w, int h, DSF *dsf, int x, int y)
{
int i = y*w+x;
int canon = dsf_canonify(dsf, i);
@@ -2119,7 +2119,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
{
int w = state->w, h = state->h, wh = w*h;
unsigned char *board;
- int *dsf;
+ DSF *dsf;
int x, y, mainanchor, mainpos, dragpos, solvepos, solvesrc, solvedst;
/*