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 /slant.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 'slant.c')
| -rw-r--r-- | slant.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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. |