summaryrefslogtreecommitdiffstats
path: root/src/H5TB.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-13 21:02:33 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-13 21:02:33 (GMT)
commitf3b26a8ce9798d8ce8c4b845b407778b4084b6d4 (patch)
tree1aa150d3465fda27d6c9dc2c4e6794524fb82635 /src/H5TB.c
parent19704681e19ad6e3d10d36f3337143c887f2baac (diff)
downloadhdf5-f3b26a8ce9798d8ce8c4b845b407778b4084b6d4.zip
hdf5-f3b26a8ce9798d8ce8c4b845b407778b4084b6d4.tar.gz
hdf5-f3b26a8ce9798d8ce8c4b845b407778b4084b6d4.tar.bz2
[svn-r8514] Purpose:
Code optimization Description: Eliminate some trivial functions with macros that perform the same operation. Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.9 (sleipnir) w/parallel
Diffstat (limited to 'src/H5TB.c')
-rw-r--r--src/H5TB.c146
1 files changed, 2 insertions, 144 deletions
diff --git a/src/H5TB.c b/src/H5TB.c
index 5055a15..b74f9df 100644
--- a/src/H5TB.c
+++ b/src/H5TB.c
@@ -67,8 +67,6 @@
* ITM **H5TB_dins( ITM ***tree, ITM *item, void *key );
* ITM **H5TB_ins( ITM ***root, ITM *item, void *key, int (*cmp)(), int arg );
* ITM *H5TB_rem( ITM ***root, ITM **node, void **kp );
- * ITM **H5TB_first( ITM **root ), **H5TB_last( ITM **root );
- * ITM **H5TB_next( ITM **node ), **H5TB_prev( ITM **node );
* ITM ***H5TB_dfree( ITM ***tree, void (*df)(ITM *), void (*kf)(void *) );
* void H5TB_free( ITM ***root, void (*df)(ITM *), void (*kf)(void *) );
*/
@@ -89,12 +87,10 @@
#define Max(a,b) ( (a) > (b) ? (a) : (b) )
/* Local Function Prototypes */
-static H5TB_NODE * H5TB_end(H5TB_NODE * root, int side);
static H5TB_NODE *H5TB_ffind(H5TB_NODE * root, const void * key, unsigned fast_compare,
H5TB_NODE ** pp);
static herr_t H5TB_balance(H5TB_NODE ** root, H5TB_NODE * ptr, int side, int added);
static H5TB_NODE *H5TB_swapkid(H5TB_NODE ** root, H5TB_NODE * ptr, int side);
-static H5TB_NODE *H5TB_nbr(H5TB_NODE * ptr, int side);
#ifdef H5TB_DEBUG
static herr_t H5TB_printNode(H5TB_NODE * node, void(*key_dump)(void *,void *));
@@ -945,144 +941,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5TB_first
- *
- * Purpose: Retrieves a pointer to node from the tree with the lowest(first)
- * key value. If the tree is empy NULL is returned. Examples:
- * node= H5TB_first(*tree);
- * node= H5TB_first(root);
- *
- * Return: Success: Pointer to a valid H5TB node
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Friday, May 6, 2000
- *
- * Modifications:
- *
- * Notes:
- *
- *-------------------------------------------------------------------------
- */
-H5TB_NODE *
-H5TB_first(H5TB_NODE * root)
-{
- H5TB_NODE *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5TB_first,NULL);
-
- /* Set return value */
- ret_value=H5TB_end(root, LEFT);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5TB_first() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5TB_last
- *
- * Purpose: Retrieves a pointer to node from the tree with the highest(last)
- * key value. If the tree is empy NULL is returned. Examples:
- * node= H5TB_last(tree->root);
- * node= H5TB_last(node); (* Last node in a sub-tree *)
- *
- * Return: Success: Pointer to a valid H5TB node
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Friday, May 6, 2000
- *
- * Modifications:
- *
- * Notes:
- *
- *-------------------------------------------------------------------------
- */
-H5TB_NODE *
-H5TB_last(H5TB_NODE * root)
-{
- H5TB_NODE *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5TB_last,NULL);
-
- /* Set return value */
- ret_value=H5TB_end(root, RIGHT);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5TB_last() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5TB_next
- *
- * Purpose: Returns a pointer the node from the tree with the next highest
- * key value relative to the node pointed to by `node'. If `node' points the
- * last node of the tree, NULL is returned.
- *
- * Return: Success: Pointer to a valid H5TB node
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Friday, May 6, 2000
- *
- * Modifications:
- *
- * Notes:
- *
- *-------------------------------------------------------------------------
- */
-H5TB_NODE *
-H5TB_next(H5TB_NODE * node)
-{
- H5TB_NODE *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5TB_next,NULL);
-
- /* Set return value */
- ret_value=H5TB_nbr(node, RIGHT);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5TB_next() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5TB_prev
- *
- * Purpose: Returns a pointer the node from the tree with the previous lowest
- * key value relative to the node pointed to by `node'. If `node' points the
- * first node of the tree, NULL is returned.
- *
- * Return: Success: Pointer to a valid H5TB node
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Friday, May 6, 2000
- *
- * Modifications:
- *
- * Notes:
- *
- *-------------------------------------------------------------------------
- */
-H5TB_NODE *
-H5TB_prev(H5TB_NODE * node)
-{
- H5TB_NODE *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5TB_prev,NULL);
-
- /* Set return value */
- ret_value=H5TB_nbr(node, LEFT);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5TB_prev() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5TB_dfree
*
* Purpose: Frees up an entire tree. `fd' is a pointer to a function that
@@ -1387,7 +1245,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5TB_NODE *
+H5TB_NODE *
H5TB_end(H5TB_NODE * root, int side)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TB_end);
@@ -1402,7 +1260,7 @@ H5TB_end(H5TB_NODE * root, int side)
} /* end H5TB_end() */
/* Returns pointer to neighboring node (to LEFT or RIGHT): */
-static H5TB_NODE *
+H5TB_NODE *
H5TB_nbr(H5TB_NODE * ptr, int side)
{
H5TB_NODE *ret_value; /* Return value */