From ef11aa889bf101e6b980eeece63a7e24b0354fc2 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 6 Nov 2008 19:54:05 -0800 Subject: [PATCH] rbtree: drop "const" from search function Having the search argument and result be "const" is nice in theory, but causes problems in practice. Signed-off-by: H. Peter Anvin --- rbtree.c | 4 ++-- rbtree.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rbtree.c b/rbtree.c index 7e13bffb..618b4f8d 100644 --- a/rbtree.c +++ b/rbtree.c @@ -12,9 +12,9 @@ #include "rbtree.h" -const struct rbtree *rb_search(const struct rbtree *tree, uint64_t key) +struct rbtree *rb_search(struct rbtree *tree, uint64_t key) { - const struct rbtree *best = NULL; + struct rbtree *best = NULL; while (tree) { if (tree->key == key) diff --git a/rbtree.h b/rbtree.h index d24daf35..e6d5c824 100644 --- a/rbtree.h +++ b/rbtree.h @@ -14,6 +14,6 @@ struct rbtree { }; struct rbtree *rb_insert(struct rbtree *, struct rbtree *); -const struct rbtree *rb_search(const struct rbtree *, uint64_t); +struct rbtree *rb_search(struct rbtree *, uint64_t); #endif /* NASM_RBTREE_H */ -- 2.11.4.GIT