aboutsummaryrefslogtreecommitdiff
path: root/divvy.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 /divvy.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 'divvy.c')
-rw-r--r--divvy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/divvy.c b/divvy.c
index d21bd23..6e22cd8 100644
--- a/divvy.c
+++ b/divvy.c
@@ -260,9 +260,10 @@ static bool addremcommon(int w, int h, int x, int y, int *own, int val)
* In both of the above suggested use cases, the user would
* probably want w==h==k, but that isn't a requirement.
*/
-int *divvy_rectangle_attempt(int w, int h, int k, random_state *rs)
+DSF *divvy_rectangle_attempt(int w, int h, int k, random_state *rs)
{
- int *order, *queue, *tmp, *own, *sizes, *addable, *retdsf, *tmpdsf;
+ int *order, *queue, *tmp, *own, *sizes, *addable;
+ DSF *retdsf, *tmpdsf;
bool *removable;
int wh = w*h;
int i, j, n, x, y, qhead, qtail;
@@ -654,9 +655,9 @@ int *divvy_rectangle_attempt(int w, int h, int k, random_state *rs)
return retdsf;
}
-int *divvy_rectangle(int w, int h, int k, random_state *rs)
+DSF *divvy_rectangle(int w, int h, int k, random_state *rs)
{
- int *ret;
+ DSF *ret;
do {
ret = divvy_rectangle_attempt(w, h, k, rs);