aboutsummaryrefslogtreecommitdiffstats
path: root/src/rbtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rbtree.c')
-rw-r--r--src/rbtree.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rbtree.c b/src/rbtree.c
index 07e1041a..9b7fe83c 100644
--- a/src/rbtree.c
+++ b/src/rbtree.c
@@ -289,7 +289,7 @@ void rb_erase(struct rb_node *node, struct rb_root *root)
/*
* This function returns the first node (in sort order) of the tree.
*/
-struct rb_node *rb_first(struct rb_root *root)
+struct rb_node *rb_first(const struct rb_root *root)
{
struct rb_node *n;
@@ -301,7 +301,7 @@ struct rb_node *rb_first(struct rb_root *root)
return n;
}
-struct rb_node *rb_last(struct rb_root *root)
+struct rb_node *rb_last(const struct rb_root *root)
{
struct rb_node *n;
@@ -313,7 +313,7 @@ struct rb_node *rb_last(struct rb_root *root)
return n;
}
-struct rb_node *rb_next(struct rb_node *node)
+struct rb_node *rb_next(const struct rb_node *node)
{
struct rb_node *parent;
@@ -326,7 +326,7 @@ struct rb_node *rb_next(struct rb_node *node)
node = node->rb_right;
while (node->rb_left)
node=node->rb_left;
- return node;
+ return (struct rb_node *)node;
}
/* No right-hand children. Everything down and left is
@@ -341,7 +341,7 @@ struct rb_node *rb_next(struct rb_node *node)
return parent;
}
-struct rb_node *rb_prev(struct rb_node *node)
+struct rb_node *rb_prev(const struct rb_node *node)
{
struct rb_node *parent;
@@ -354,7 +354,7 @@ struct rb_node *rb_prev(struct rb_node *node)
node = node->rb_left;
while (node->rb_right)
node=node->rb_right;
- return node;
+ return (struct rb_node *)node;
}
/* No left-hand children. Go up till we find an ancestor which