36 lines
1.5 KiB
Plaintext
36 lines
1.5 KiB
Plaintext
|
$OpenBSD: patch-src_avl_avl_c,v 1.1.1.1 2003/07/26 11:38:50 sturm Exp $
|
||
|
--- src/avl/avl.c.orig 2003-07-26 09:07:59.000000000 +0200
|
||
|
+++ src/avl/avl.c 2003-07-26 09:10:35.000000000 +0200
|
||
|
@@ -987,11 +987,11 @@ avl_verify_balance (avl_node * node)
|
||
|
long lh = avl_verify_balance (node->left);
|
||
|
long rh = avl_verify_balance (node->right);
|
||
|
if ((rh - lh) != AVL_GET_BALANCE(node)) {
|
||
|
- fprintf (stderr, "invalid balance at node %d\n", (int) node->key);
|
||
|
+ fprintf (stderr, "invalid balance at node %ld\n", (long) node->key);
|
||
|
exit(1);
|
||
|
}
|
||
|
if (((lh - rh) > 1) || ((lh - rh) < -1)) {
|
||
|
- fprintf (stderr, "unbalanced at node %d\n", (int) node->key);
|
||
|
+ fprintf (stderr, "unbalanced at node %ld\n", (long) node->key);
|
||
|
exit(1);
|
||
|
}
|
||
|
return (1 + AVL_MAX (lh, rh));
|
||
|
@@ -1002,7 +1002,7 @@ static void
|
||
|
avl_verify_parent (avl_node * node, avl_node * parent)
|
||
|
{
|
||
|
if (node->parent != parent) {
|
||
|
- fprintf (stderr, "invalid parent at node %d\n", (int) node->key);
|
||
|
+ fprintf (stderr, "invalid parent at node %ld\n", (long) node->key);
|
||
|
exit(1);
|
||
|
}
|
||
|
if (node->left) {
|
||
|
@@ -1027,7 +1027,7 @@ avl_verify_rank (avl_node * node)
|
||
|
num_right = avl_verify_rank (node->right);
|
||
|
}
|
||
|
if (AVL_GET_RANK (node) != num_left + 1) {
|
||
|
- fprintf (stderr, "invalid rank at node %d\n", (int) node->key);
|
||
|
+ fprintf (stderr, "invalid rank at node %ld\n", (long) node->key);
|
||
|
exit (1);
|
||
|
}
|
||
|
return (num_left + num_right + 1);
|