summaryrefslogtreecommitdiffstats
path: root/src/H5Opline.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/H5Opline.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/H5Opline.c')
-rw-r--r--src/H5Opline.c51
1 files changed, 17 insertions, 34 deletions
diff --git a/src/H5Opline.c b/src/H5Opline.c
index 5240f72..3485968 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -30,10 +30,6 @@
/* Pablo mask */
#define PABLO_MASK H5O_pline_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
#define H5O_PLINE_VERSION 1
static herr_t H5O_pline_encode (H5F_t *f, uint8_t *p, const void *mesg);
@@ -93,7 +89,7 @@ H5O_pline_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p,
unsigned version;
size_t i, j, n, name_length;
- FUNC_ENTER_NOAPI(H5O_pline_decode, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_pline_decode);
/* check args */
assert(p);
@@ -184,9 +180,8 @@ H5O_pline_encode (H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg)
size_t i, j, name_length;
const char *name=NULL;
H5Z_class_t *cls=NULL;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_pline_encode, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_encode);
/* Check args */
assert (p);
@@ -229,8 +224,7 @@ H5O_pline_encode (H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg)
UINT32ENCODE(p, 0);
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -258,9 +252,9 @@ H5O_pline_copy (const void *_src, void *_dst/*out*/)
const H5O_pline_t *src = (const H5O_pline_t *)_src;
H5O_pline_t *dst = (H5O_pline_t *)_dst;
size_t i;
- H5O_pline_t *ret_value = NULL;
+ H5O_pline_t *ret_value;
- FUNC_ENTER_NOAPI(H5O_pline_copy, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_pline_copy);
if (!dst && NULL==(dst = H5FL_MALLOC (H5O_pline_t)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
@@ -330,15 +324,15 @@ static size_t
H5O_pline_size (H5F_t UNUSED *f, const void *mesg)
{
const H5O_pline_t *pline = (const H5O_pline_t*)mesg;
- size_t i, size, name_len;
+ size_t i, name_len;
const char *name = NULL;
H5Z_class_t *cls = NULL;
size_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5O_pline_size, 0);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_size);
/* Message header */
- size = 1 + /*version */
+ ret_value = 1 + /*version */
1 + /*number of filters */
6; /*reserved */
@@ -350,21 +344,17 @@ H5O_pline_size (H5F_t UNUSED *f, const void *mesg)
name_len = name ? HDstrlen(name)+1 : 0;
- size += 2 + /*filter identification number */
+ ret_value += 2 + /*filter identification number */
2 + /*name length */
2 + /*flags */
2 + /*number of client data values */
H5O_ALIGN(name_len); /*length of the filter name */
- size += pline->filter[i].cd_nelmts * 4;
+ ret_value += pline->filter[i].cd_nelmts * 4;
if (pline->filter[i].cd_nelmts % 2)
- size += 4;
+ ret_value += 4;
}
- /* Set return value */
- ret_value=size;
-
-done:
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -389,9 +379,8 @@ H5O_pline_reset (void *mesg)
{
H5O_pline_t *pline = (H5O_pline_t*)mesg;
size_t i;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_pline_reset, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_reset);
assert (pline);
@@ -403,8 +392,7 @@ H5O_pline_reset (void *mesg)
H5MM_xfree(pline->filter);
HDmemset(pline, 0, sizeof *pline);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -425,16 +413,13 @@ done:
static herr_t
H5O_pline_free (void *mesg)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5O_pline_free, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_free);
assert (mesg);
H5FL_FREE(H5O_pline_t,mesg);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -460,9 +445,8 @@ H5O_pline_debug (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE *
{
const H5O_pline_t *pline = (const H5O_pline_t *)mesg;
size_t i, j;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_pline_debug, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_debug);
/* check args */
assert(f);
@@ -506,6 +490,5 @@ H5O_pline_debug (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE *
}
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}