summaryrefslogtreecommitdiffstats
path: root/src/H5TB.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-06-23 15:36:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-06-23 15:36:35 (GMT)
commit7c3df64cc4742c0316ca81aeef67bd95a5737c70 (patch)
treef6aa023c661a881b2495ea0be4e745b43eea091f /src/H5TB.c
parent19644d75931aaa79951830d85eda28de08f17180 (diff)
downloadhdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.zip
hdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.tar.gz
hdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.tar.bz2
[svn-r8731] Purpose:
Code cleanup & minor optimization Description: Re-work the way interface initialization routines are specified in the library to avoid the overhead of checking for them in routines where there is no interface initialization routine. This cleans up warnings with gcc 3.4, reduces the library binary size a bit (about 2-3%) and should speedup the library's execution slightly. Platforms tested: FreeBSD 4.10 (sleipnir) w/gcc34 h5committest
Diffstat (limited to 'src/H5TB.c')
-rw-r--r--src/H5TB.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/src/H5TB.c b/src/H5TB.c
index 98ded27..164380f 100644
--- a/src/H5TB.c
+++ b/src/H5TB.c
@@ -84,7 +84,9 @@
* void H5TB_free( ITM ***root, void (*df)(ITM *), void (*kf)(void *) );
*/
-/* $Id$ */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5TB_mask
#include "H5private.h" /*library */
#include "H5Eprivate.h" /*error handling */
@@ -117,10 +119,6 @@ H5FL_DEFINE_STATIC(H5TB_NODE);
/* Declare a free list to manage the H5TB_TREE struct */
H5FL_DEFINE_STATIC(H5TB_TREE);
-#define PABLO_MASK H5TB_mask
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5TB_strcmp
@@ -414,7 +412,7 @@ H5TB_dfind(H5TB_TREE * tree, const void * key, H5TB_NODE ** pp)
{
H5TB_NODE *ret_value;
- FUNC_ENTER_NOAPI(H5TB_dfind, NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dfind);
assert(tree);
@@ -429,7 +427,6 @@ H5TB_dfind(H5TB_TREE * tree, const void * key, H5TB_NODE ** pp)
ret_value=NULL;
} /* end else */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_dfind() */
@@ -471,7 +468,7 @@ H5TB_find(H5TB_NODE * root, const void * key,
int side;
H5TB_NODE *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_find, NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_find);
if(ptr) {
@@ -490,7 +487,6 @@ H5TB_find(H5TB_NODE * root, const void * key,
/* Set return value */
ret_value= (0 == cmp) ? ptr : NULL;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_find() */
@@ -526,14 +522,13 @@ H5TB_dless(H5TB_TREE * tree, void * key, H5TB_NODE ** pp)
{
H5TB_NODE *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_dless,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dless);
assert(tree);
/* Set return value */
ret_value= H5TB_less(tree->root, key, tree->compar, tree->cmparg, pp);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_dless() */
@@ -576,7 +571,7 @@ H5TB_less(H5TB_NODE * root, void * key, H5TB_cmp_t compar, int arg, H5TB_NODE **
int side;
H5TB_NODE *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_less,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_less);
/* Try to find an exact match */
if (ptr) {
@@ -613,7 +608,6 @@ H5TB_less(H5TB_NODE * root, void * key, H5TB_cmp_t compar, int arg, H5TB_NODE **
/* Set return value */
ret_value= (0 == cmp) ? ptr : NULL;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_less */
@@ -645,7 +639,7 @@ H5TB_index(H5TB_NODE * root, unsigned indx)
H5TB_NODE *ptr = root;
H5TB_NODE *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_index,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_index);
if (NULL != ptr) {
/* Termination condition is if the index equals the number of children on
@@ -671,7 +665,6 @@ H5TB_index(H5TB_NODE * root, unsigned indx)
/* Set return value */
ret_value=ptr;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_index() */
@@ -702,7 +695,7 @@ H5TB_dins(H5TB_TREE * tree, void * item, void * key)
{
H5TB_NODE *ret_value; /* the node to return */
- FUNC_ENTER_NOAPI(H5TB_dins,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dins);
assert(tree);
@@ -713,7 +706,6 @@ H5TB_dins(H5TB_TREE * tree, void * item, void * key)
if (ret_value != NULL)
tree->count++;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_dins() */
@@ -1003,7 +995,7 @@ H5TB_dfree(H5TB_TREE * tree, void(*fd) (void * /* item */), void(*fk) (void * /*
{
H5TB_TREE *ret_value=NULL; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_dfree,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dfree);
if (tree != NULL) {
/* Free the actual tree */
@@ -1013,7 +1005,6 @@ H5TB_dfree(H5TB_TREE * tree, void(*fd) (void * /* item */), void(*fk) (void * /*
H5FL_FREE(H5TB_TREE,tree);
} /* end if */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_dfree() */
@@ -1049,7 +1040,7 @@ H5TB_free(H5TB_NODE ** root, void(*fd) (void * /* item */), void(*fk) (void * /*
H5TB_NODE *par, *node = *root;
void *ret_value=NULL; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_free,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_free);
/* While nodes left to be free()d */
while (NULL != *root) {
@@ -1085,7 +1076,6 @@ H5TB_free(H5TB_NODE ** root, void(*fd) (void * /* item */), void(*fk) (void * /*
} while (NULL != par); /* While moving back up tree */
} /* end while */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_free() */
@@ -1112,12 +1102,11 @@ H5TB_count(H5TB_TREE * tree)
{
long ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_count,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_count);
/* Set return value */
ret_value= (tree==NULL) ? FAIL : (long)tree->count;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_count() */
@@ -1147,7 +1136,7 @@ done:
herr_t
H5TB_dump(H5TB_TREE *tree, void (*key_dump)(void *,void *), int method)
{
- FUNC_ENTER_NOAPI(H5TB_dump,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dump);
printf("H5TB-tree dump %p:\n",tree);
printf("capacity = %ld\n\n",(long)tree->count);
@@ -1178,7 +1167,7 @@ H5TB_printNode(H5TB_NODE * node, void(*key_dump)(void *,void *))
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5TB_printNode);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TB_printNode);
if (node == NULL) {
printf("ERROR: null node pointer\n");
@@ -1222,7 +1211,7 @@ H5TB_dumpNode(H5TB_NODE *node, void (*key_dump)(void *,void *),
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5TB_dumpNode);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TB_dumpNode);
if (node == NULL)
HGOTO_DONE(FAIL);
@@ -1281,7 +1270,7 @@ done:
H5TB_NODE *
H5TB_end(H5TB_NODE * root, int side)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TB_end);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_end);
assert(root);
assert(side==LEFT || side==RIGHT);
@@ -1298,7 +1287,7 @@ H5TB_nbr(H5TB_NODE * ptr, int side)
{
H5TB_NODE *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TB_nbr);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_nbr);
if (!HasChild(ptr, side))
HGOTO_DONE (ptr->link[side]);