aboutsummaryrefslogtreecommitdiff
path: root/slant.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 /slant.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 'slant.c')
-rw-r--r--slant.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/slant.c b/slant.c
index e2d354e..a53813a 100644
--- a/slant.c
+++ b/slant.c
@@ -244,7 +244,7 @@ struct solver_scratch {
* Disjoint set forest which tracks the connected sets of
* points.
*/
- int *connected;
+ DSF *connected;
/*
* Counts the number of possible exits from each connected set
@@ -265,7 +265,7 @@ struct solver_scratch {
* Another disjoint set forest. This one tracks _squares_ which
* are known to slant in the same direction.
*/
- int *equiv;
+ DSF *equiv;
/*
* Stores slash values which we know for an equivalence class.
@@ -336,7 +336,7 @@ static void free_scratch(struct solver_scratch *sc)
* Wrapper on dsf_merge() which updates the `exits' and `border'
* arrays.
*/
-static void merge_vertices(int *connected,
+static void merge_vertices(DSF *connected,
struct solver_scratch *sc, int i, int j)
{
int exits = -1;
@@ -382,7 +382,7 @@ static void decr_exits(struct solver_scratch *sc, int i)
static void fill_square(int w, int h, int x, int y, int v,
signed char *soln,
- int *connected, struct solver_scratch *sc)
+ DSF *connected, struct solver_scratch *sc)
{
int W = w+1 /*, H = h+1 */;
@@ -997,7 +997,8 @@ static void slant_generate(int w, int h, signed char *soln, random_state *rs)
{
int W = w+1, H = h+1;
int x, y, i;
- int *connected, *indices;
+ DSF *connected;
+ int *indices;
/*
* Clear the output.