summaryrefslogtreecommitdiff
path: root/lib/openbsd-tree.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-05-14 08:58:17 -0400
committerGitHub <noreply@github.com>2019-05-14 08:58:17 -0400
commitd4e614e0d74a6e28bc9d5ae134ac3ccb55b2c387 (patch)
treeaba236474b3e7335d019374323fb87ef92305073 /lib/openbsd-tree.c
parentde61155aac944ee5c9d009d7c785a18265cb0d3c (diff)
parent5208931b32709b5c1258cd48cdbcd59a355d5ff8 (diff)
Merge pull request #4329 from sworleys/RB-Const
lib: Add const to openbsd-tree functions
Diffstat (limited to 'lib/openbsd-tree.c')
-rw-r--r--lib/openbsd-tree.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/openbsd-tree.c b/lib/openbsd-tree.c
index eadef9902b..ddcc59fa8f 100644
--- a/lib/openbsd-tree.c
+++ b/lib/openbsd-tree.c
@@ -435,7 +435,8 @@ void *_rb_insert(const struct rb_type *t, struct rbt_tree *rbt, void *elm)
}
/* Finds the node with the same key as elm */
-void *_rb_find(const struct rb_type *t, struct rbt_tree *rbt, const void *key)
+void *_rb_find(const struct rb_type *t, const struct rbt_tree *rbt,
+ const void *key)
{
struct rb_entry *tmp = RBH_ROOT(rbt);
void *node;
@@ -456,7 +457,8 @@ void *_rb_find(const struct rb_type *t, struct rbt_tree *rbt, const void *key)
}
/* Finds the first node greater than or equal to the search key */
-void *_rb_nfind(const struct rb_type *t, struct rbt_tree *rbt, const void *key)
+void *_rb_nfind(const struct rb_type *t, const struct rbt_tree *rbt,
+ const void *key)
{
struct rb_entry *tmp = RBH_ROOT(rbt);
void *node;
@@ -522,14 +524,14 @@ void *_rb_prev(const struct rb_type *t, void *elm)
return (rbe == NULL ? NULL : rb_e2n(t, rbe));
}
-void *_rb_root(const struct rb_type *t, struct rbt_tree *rbt)
+void *_rb_root(const struct rb_type *t, const struct rbt_tree *rbt)
{
struct rb_entry *rbe = RBH_ROOT(rbt);
return (rbe == NULL ? rbe : rb_e2n(t, rbe));
}
-void *_rb_min(const struct rb_type *t, struct rbt_tree *rbt)
+void *_rb_min(const struct rb_type *t, const struct rbt_tree *rbt)
{
struct rb_entry *rbe = RBH_ROOT(rbt);
struct rb_entry *parent = NULL;
@@ -542,7 +544,7 @@ void *_rb_min(const struct rb_type *t, struct rbt_tree *rbt)
return (parent == NULL ? NULL : rb_e2n(t, parent));
}
-void *_rb_max(const struct rb_type *t, struct rbt_tree *rbt)
+void *_rb_max(const struct rb_type *t, const struct rbt_tree *rbt)
{
struct rb_entry *rbe = RBH_ROOT(rbt);
struct rb_entry *parent = NULL;