/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2010 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include "portable.h"
+#include <limits.h>
#include <stdio.h>
#include <ac/stdlib.h>
#define AVL_INTERNAL
#include "avl.h"
+/* Maximum tree depth this host's address space could support */
+#define MAX_TREE_DEPTH (sizeof(void *) * CHAR_BIT)
+
static const int avl_bfs[] = {LH, RH};
/*
int side, side_bf, shorter, nside;
/* parent stack */
- Avlnode *pptr[sizeof(void *)*8];
- unsigned char pdir[sizeof(void *)*8];
+ Avlnode *pptr[MAX_TREE_DEPTH];
+ unsigned char pdir[MAX_TREE_DEPTH];
int depth = 0;
if ( *root == NULL )