aboutsummaryrefslogtreecommitdiff
path: root/dsf.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2006-10-29 09:34:09 +0000
committerSimon Tatham <anakin@pobox.com>2006-10-29 09:34:09 +0000
commitb7356cd209eb6a0b8bb153e34a9c1a5831884c7b (patch)
tree69fb3adaf7663581703572e0252987572546eec5 /dsf.c
parentb9547673c6462bf73e642328300479df6df71d7b (diff)
downloadpuzzles-b7356cd209eb6a0b8bb153e34a9c1a5831884c7b.zip
puzzles-b7356cd209eb6a0b8bb153e34a9c1a5831884c7b.tar.gz
puzzles-b7356cd209eb6a0b8bb153e34a9c1a5831884c7b.tar.bz2
puzzles-b7356cd209eb6a0b8bb153e34a9c1a5831884c7b.tar.xz
r6880 accidentally backed out r6780. That's what I get for accepting
source files from Mike rather than patches, and not adequately checking the result... [originally from svn r6882] [r6780 == f05c25347d66821d928668a7e87dffbf3ffed027] [r6880 == b9547673c6462bf73e642328300479df6df71d7b]
Diffstat (limited to 'dsf.c')
-rw-r--r--dsf.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/dsf.c b/dsf.c
index f4deb1e..207357d 100644
--- a/dsf.c
+++ b/dsf.c
@@ -60,17 +60,23 @@ done:
sfree(inverse_elements);
}
-int *snew_dsf(int size)
+void dsf_init(int *dsf, int size)
{
int i;
- int *ret;
-
- ret = snewn(size, int);
+
for (i = 0; i < size; i++) {
/* Bottom bit of each element of this array stores whether that element
* is opposite to its parent, which starts off as false */
- ret[i] = i << 1;
+ dsf[i] = i << 1;
}
+}
+
+int *snew_dsf(int size)
+{
+ int *ret;
+
+ ret = snewn(size, int);
+ dsf_init(ret, size);
/*print_dsf(ret, size); */