diff options
Diffstat (limited to 'usr/src/common/avl/avl.c')
-rw-r--r-- | usr/src/common/avl/avl.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/usr/src/common/avl/avl.c b/usr/src/common/avl/avl.c index dd39c12..00cf2fa 100644 --- a/usr/src/common/avl/avl.c +++ b/usr/src/common/avl/avl.c @@ -87,11 +87,19 @@ * than the value of the indicated "avl_node_t *". */ -#include <sys/types.h> -#include <sys/param.h> -#include <sys/debug.h> -#include <sys/avl.h> -#include <sys/cmn_err.h> +#ifndef ASSERT +# include <assert.h> +# define ASSERT assert +#endif + +#define B_TRUE (1) +#define B_FALSE (0) + +#include <stddef.h> +#include <inttypes.h> + +#include "avl_impl.h" +#include "avl.h" /* * Small arrays to translate between balance (or diff) values and child indeces. @@ -809,7 +817,7 @@ avl_remove(avl_tree_t *tree, void *data) avl_remove((tree), (obj)); \ avl_add((tree), (obj)) -boolean_t +int avl_update_lt(avl_tree_t *t, void *obj) { void *neighbor; @@ -826,7 +834,7 @@ avl_update_lt(avl_tree_t *t, void *obj) return (B_FALSE); } -boolean_t +int avl_update_gt(avl_tree_t *t, void *obj) { void *neighbor; @@ -843,7 +851,7 @@ avl_update_gt(avl_tree_t *t, void *obj) return (B_FALSE); } -boolean_t +int avl_update(avl_tree_t *t, void *obj) { void *neighbor; @@ -901,14 +909,14 @@ avl_destroy(avl_tree_t *tree) /* * Return the number of nodes in an AVL tree. */ -ulong_t +size_t avl_numnodes(avl_tree_t *tree) { ASSERT(tree); return (tree->avl_numnodes); } -boolean_t +int avl_is_empty(avl_tree_t *tree) { ASSERT(tree); |