diff options
author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-05-14 02:11:11 +0200 |
---|---|---|
committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-05-14 02:21:22 +0200 |
commit | 5208931b32709b5c1258cd48cdbcd59a355d5ff8 (patch) | |
tree | 9a433d801ead02bb1dd2152bf072e7f4ea24a995 /lib/openbsd-tree.c | |
parent | Merge pull request #4320 from donaldsharp/re_monotime (diff) | |
download | frr-5208931b32709b5c1258cd48cdbcd59a355d5ff8.tar.xz frr-5208931b32709b5c1258cd48cdbcd59a355d5ff8.zip |
lib: Add const to openbsd-tree functions
A few of the functions in openbsd's RB tree implementation
needed to have const in their parameters.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'lib/openbsd-tree.c')
-rw-r--r-- | lib/openbsd-tree.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/openbsd-tree.c b/lib/openbsd-tree.c index eadef9902..ddcc59fa8 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; |