summaryrefslogtreecommitdiffstats
path: root/src/H5Olayout.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/H5Olayout.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/H5Olayout.c')
-rw-r--r--src/H5Olayout.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 1077a37..eba35ae 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -20,6 +20,10 @@
#define H5O_PACKAGE /*suppress error about including H5Opkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5O_layout_mask
+
#include "H5private.h"
#include "H5Dprivate.h"
#include "H5Eprivate.h"
@@ -64,11 +68,6 @@ const H5O_class_t H5O_LAYOUT[1] = {{
#define H5O_LAYOUT_VERSION_2 2
#define H5O_LAYOUT_VERSION_3 3
-/* Interface initialization */
-#define PABLO_MASK H5O_layout_mask
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage the H5O_layout_t struct */
H5FL_DEFINE(H5O_layout_t);
@@ -109,7 +108,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_t
unsigned u;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5O_layout_decode, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_layout_decode);
/* check args */
assert(f);
@@ -273,7 +272,7 @@ H5O_layout_encode(H5F_t *f, uint8_t *p, const void *_mesg)
unsigned u;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_layout_encode, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_layout_encode);
/* check args */
assert(f);
@@ -351,7 +350,7 @@ H5O_layout_copy(const void *_mesg, void *_dest)
H5O_layout_t *dest = (H5O_layout_t *) _dest;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5O_layout_copy, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_layout_copy);
/* check args */
assert(mesg);
@@ -403,7 +402,7 @@ H5O_layout_meta_size(H5F_t *f, const void *_mesg)
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
size_t ret_value;
- FUNC_ENTER_NOAPI(H5O_layout_meta_size, 0);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_layout_meta_size);
/* check args */
assert(f);
@@ -469,7 +468,7 @@ H5O_layout_size(H5F_t *f, const void *_mesg)
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
size_t ret_value;
- FUNC_ENTER_NOAPI(H5O_layout_size, 0);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_size);
/* check args */
assert(f);
@@ -478,7 +477,7 @@ H5O_layout_size(H5F_t *f, const void *_mesg)
ret_value = H5O_layout_meta_size(f, mesg);
if(mesg->type==H5D_COMPACT)
ret_value += mesg->u.compact.size;/* data for compact dataset */
-done:
+
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -502,9 +501,8 @@ static herr_t
H5O_layout_reset (void *_mesg)
{
H5O_layout_t *mesg = (H5O_layout_t *) _mesg;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_layout_reset, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_reset);
if(mesg) {
/* Free the compact storage buffer */
@@ -515,8 +513,7 @@ H5O_layout_reset (void *_mesg)
mesg->type=H5D_CONTIGUOUS;
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -538,9 +535,8 @@ static herr_t
H5O_layout_free (void *_mesg)
{
H5O_layout_t *mesg = (H5O_layout_t *) _mesg;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_layout_free, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_free);
assert (mesg);
@@ -550,8 +546,7 @@ H5O_layout_free (void *_mesg)
H5FL_FREE(H5O_layout_t,mesg);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -575,7 +570,7 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg)
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_layout_delete, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_layout_delete);
/* check args */
assert(f);
@@ -628,9 +623,8 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE
{
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
unsigned u;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_layout_debug, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_debug);
/* check args */
assert(f);
@@ -664,6 +658,5 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE
"Data Size:", mesg->u.compact.size);
} /* end else */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}