From 8e9e21a02e9c1e6aa2dde7414298298c401d72e3 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Mon, 29 Feb 2016 16:27:23 +0100 Subject: [PATCH] Increased the maximum depth of AVL trees --- src/obiavl.c | 4 ++-- src/obiavl.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/obiavl.c b/src/obiavl.c index 900c480..0d9ac28 100644 --- a/src/obiavl.c +++ b/src/obiavl.c @@ -1447,7 +1447,7 @@ index_t obi_avl_add(OBIDMS_avl_p avl, byte_t* value) byte_t* to_compare; int comp; uint8_t n = 0; - uint8_t depth = 0; + int depth = 0; // Check if first node if (!((avl->header)->nb_items)) @@ -1508,7 +1508,7 @@ index_t obi_avl_add(OBIDMS_avl_p avl, byte_t* value) if (depth == AVL_MAX_DEPTH) { obi_set_errno(OBI_AVL_ERROR); - obidebug(1, "\nThis AVL tree has reached the maximum height (50)."); + obidebug(1, "\nThis AVL tree has reached the maximum height (%d).", AVL_MAX_DEPTH); return -1; } diff --git a/src/obiavl.h b/src/obiavl.h index 4abfe22..bc4e918 100644 --- a/src/obiavl.h +++ b/src/obiavl.h @@ -30,7 +30,7 @@ */ #define AVL_GROWTH_FACTOR (2) /**< The growth factor when an AVL tree is enlarged. */ -#define AVL_MAX_DEPTH (50) /**< The maximum depth of an AVL tree. +#define AVL_MAX_DEPTH (1000) /**< The maximum depth of an AVL tree. */ #define LEFT_CHILD(node) (avl->tree)+(node->left_child) /**< Pointer to the left child of a node in an AVL tree. */