/*
avl_tree.c -- avl_ tree and linked list convenience
Copyright (C) 1998 Michael H. Buselli
- 2000,2001 Ivo Timmermans <ivo@o2w.nl>,
- 2000,2001 Guus Sliepen <guus@sliepen.eu.org>
- 2000,2001 Wessel Dankers <wsl@nl.linux.org>
+ 2000-2003 Ivo Timmermans <ivo@o2w.nl>,
+ 2000-2003 Guus Sliepen <guus@sliepen.eu.org>
+ 2000-2003 Wessel Dankers <wsl@nl.linux.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
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.13 2003/06/11 19:39:02 guus Exp $
+ $Id: avl_tree.c,v 1.1.2.16 2003/07/17 15:06:25 guus Exp $
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <xalloc.h>
+#include "system.h"
#include "avl_tree.h"
+#include "xalloc.h"
#ifdef AVL_COUNT
#define AVL_NODE_COUNT(n) ((n) ? (n)->count : 0)
#endif
#ifndef AVL_DEPTH
-int lg(unsigned int u)
+static int lg(unsigned int u) __attribute__ ((const));
+
+static int lg(unsigned int u)
{
int r = 1;
/* Internal helper functions */
-int avl_check_balance(avl_node_t *node)
+static int avl_check_balance(avl_node_t *node)
{
#ifdef AVL_DEPTH
int d;
#endif
}
-void avl_rebalance(avl_tree_t *tree, avl_node_t *node)
+static void avl_rebalance(avl_tree_t *tree, avl_node_t *node)
{
avl_node_t *child;
avl_node_t *gchild;