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 <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2008-11-06 19:54:05 -08:00
parent 674788166f
commit ef11aa889b
2 changed files with 3 additions and 3 deletions

View file

@ -12,9 +12,9 @@
#include "rbtree.h" #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) { while (tree) {
if (tree->key == key) if (tree->key == key)

View file

@ -14,6 +14,6 @@ struct rbtree {
}; };
struct rbtree *rb_insert(struct rbtree *, 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 */ #endif /* NASM_RBTREE_H */