summaryrefslogtreecommitdiffstats
path: root/src/H5Oshared.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/H5Oshared.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/H5Oshared.c')
-rw-r--r--src/H5Oshared.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index 1444e03..0024d8d 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -28,6 +28,10 @@
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
#define H5O_PACKAGE /*suppress error about including H5Opkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5O_shared_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
@@ -67,11 +71,6 @@ const H5O_class_t H5O_SHARED[1] = {{
/* New version, with just address of object as link for object header sharing */
#define H5O_SHARED_VERSION 2
-/* Interface initialization */
-#define PABLO_MASK H5O_shared_mask
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5O_shared_read
@@ -158,7 +157,7 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, const H5O_shared_t *shared, int adj
{
int ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5O_shared_link_adj,FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_shared_link_adj);
/* check args */
assert(f);
@@ -214,7 +213,7 @@ H5O_shared_decode (H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *buf, H5O_share
unsigned flags, version;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5O_shared_decode, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_shared_decode);
/* Check args */
assert (f);
@@ -287,9 +286,8 @@ H5O_shared_encode (H5F_t *f, uint8_t *buf/*out*/, const void *_mesg)
{
const H5O_shared_t *mesg = (const H5O_shared_t *)_mesg;
unsigned flags;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_shared_encode, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_encode);
/* Check args */
assert (f);
@@ -323,8 +321,7 @@ H5O_shared_encode (H5F_t *f, uint8_t *buf/*out*/, const void *_mesg)
H5F_addr_encode (f, &buf, mesg->u.ent.header);
#endif /* OLD_WAY */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -353,7 +350,7 @@ H5O_shared_copy(const void *_mesg, void *_dest)
H5O_shared_t *dest = (H5O_shared_t *) _dest;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5O_shared_copy, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_shared_copy);
/* check args */
assert(mesg);
@@ -393,7 +390,7 @@ H5O_shared_size (H5F_t *f, const void *_mesg)
const H5O_shared_t *shared = (const H5O_shared_t *) _mesg;
size_t ret_value;
- FUNC_ENTER_NOAPI(H5O_shared_size, 0);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_size);
ret_value = 1 + /*version */
1 + /*the flags field */
@@ -401,7 +398,6 @@ H5O_shared_size (H5F_t *f, const void *_mesg)
(H5F_SIZEOF_ADDR(f)+4) : /*sharing via global heap */
H5F_SIZEOF_ADDR(f)); /*sharing by another obj hdr */
-done:
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -426,7 +422,7 @@ H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg)
const H5O_shared_t *shared = (const H5O_shared_t *) _mesg;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_shared_delete, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_shared_delete);
/* check args */
assert(f);
@@ -462,7 +458,7 @@ H5O_shared_link(H5F_t *f, hid_t dxpl_id, const void *_mesg)
const H5O_shared_t *shared = (const H5O_shared_t *) _mesg;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_shared_link, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_shared_link);
/* check args */
assert(f);
@@ -496,9 +492,8 @@ H5O_shared_debug (H5F_t UNUSED *f, hid_t dxpl_id, const void *_mesg,
FILE *stream, int indent, int fwidth)
{
const H5O_shared_t *mesg = (const H5O_shared_t *)_mesg;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_shared_debug, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_debug);
/* Check args */
assert (f);
@@ -525,6 +520,5 @@ H5O_shared_debug (H5F_t UNUSED *f, hid_t dxpl_id, const void *_mesg,
HADDR_UNDEF);
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}