aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2018-11-13 21:41:45 +0000
committerSimon Tatham <anakin@pobox.com>2018-11-13 21:48:24 +0000
commit33b55db48e9573c6c825e3a222ff968f6a0bd4f4 (patch)
tree307ff8d8d8a42e31830afe22aa47820f6caecc97
parent836a5c4ea742cc2ab23537993e8c54b251ae803b (diff)
downloadpuzzles-33b55db48e9573c6c825e3a222ff968f6a0bd4f4.zip
puzzles-33b55db48e9573c6c825e3a222ff968f6a0bd4f4.tar.gz
puzzles-33b55db48e9573c6c825e3a222ff968f6a0bd4f4.tar.bz2
puzzles-33b55db48e9573c6c825e3a222ff968f6a0bd4f4.tar.xz
Adopt C99 bool in the tree234 API.
The only affected function here is splitpos234, which I don't think these puzzles are even using at the moment.
-rw-r--r--devel.but4
-rw-r--r--tree234.c2
-rw-r--r--tree234.h4
3 files changed, 6 insertions, 4 deletions
diff --git a/devel.but b/devel.but
index 0a0f1cd..9f95ad7 100644
--- a/devel.but
+++ b/devel.but
@@ -4044,13 +4044,13 @@ Returns the number of elements currently in the tree.
\S{utils-splitpos234} \cw{splitpos234()}
-\c tree234 *splitpos234(tree234 *t, int index, int before);
+\c tree234 *splitpos234(tree234 *t, int index, bool before);
Splits the input tree into two pieces at a given position, and
creates a new tree containing all the elements on one side of that
position.
-If \c{before} is \cw{TRUE}, then all the items at or after position
+If \c{before} is \cw{true}, then all the items at or after position
\c{index} are left in the input tree, and the items before that
point are returned in the new tree. Otherwise, the reverse happens:
all the items at or after \c{index} are moved into the new tree, and
diff --git a/tree234.c b/tree234.c
index 4b3151e..879096b 100644
--- a/tree234.c
+++ b/tree234.c
@@ -1376,7 +1376,7 @@ static node234 *split234_internal(tree234 *t, int index) {
t->root = halves[1];
return halves[0];
}
-tree234 *splitpos234(tree234 *t, int index, int before) {
+tree234 *splitpos234(tree234 *t, int index, bool before) {
tree234 *ret;
node234 *n;
int count;
diff --git a/tree234.h b/tree234.h
index f75c8f7..33869b5 100644
--- a/tree234.h
+++ b/tree234.h
@@ -28,6 +28,8 @@
#ifndef TREE234_H
#define TREE234_H
+#include <stdbool.h>
+
/*
* This typedef is opaque outside tree234.c itself.
*/
@@ -172,7 +174,7 @@ int count234(tree234 *t);
* in the tree that satisfy the relation are returned; the
* remainder are left.
*/
-tree234 *splitpos234(tree234 *t, int index, int before);
+tree234 *splitpos234(tree234 *t, int index, bool before);
tree234 *split234(tree234 *t, void *e, cmpfn234 cmp, int rel);
/*