From 89c438e149a91fffa74b2669f7e0cd05abc3420f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 20 Apr 2023 14:06:43 +0100 Subject: 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. --- slant.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'slant.c') 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. -- cgit v1.1