library for inclusion into tinc (http://tinc.nl.linux.org/) by
Guus Sliepen <guus@sliepen.eu.org>.
- $Id: avl_tree.c,v 1.1.2.16 2003/07/17 15:06:25 guus Exp $
+ $Id: avl_tree.c,v 1.1.2.18 2003/07/30 21:52:41 guus Exp $
*/
#include "system.h"
#endif
#ifndef AVL_DEPTH
-static int lg(unsigned int u) __attribute__ ((const));
+static int lg(unsigned int u) __attribute__ ((__const__));
static int lg(unsigned int u)
{
/* Internal helper functions */
-static int avl_check_balance(avl_node_t *node)
+static int avl_check_balance(const avl_node_t *node)
{
#ifdef AVL_DEPTH
int d;
/* Tree walking */
-void avl_foreach(avl_tree_t *tree, avl_action_t action)
+void avl_foreach(const avl_tree_t *tree, avl_action_t action)
{
avl_node_t *node, *next;
}
}
-void avl_foreach_node(avl_tree_t *tree, avl_action_t action)
+void avl_foreach_node(const avl_tree_t *tree, avl_action_t action)
{
avl_node_t *node, *next;
/* Indexing */
#ifdef AVL_COUNT
-unsigned int avl_count(avl_tree_t *tree)
+unsigned int avl_count(const avl_tree_t *tree)
{
return AVL_NODE_COUNT(tree->root);
}
}
#endif
#ifdef AVL_DEPTH
-unsigned int avl_depth(avl_tree_t *tree)
+unsigned int avl_depth(const avl_tree_t *tree)
{
return AVL_NODE_DEPTH(tree->root);
}