summaryrefslogtreecommitdiffstats
path: root/src/H5AC.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/H5AC.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/H5AC.c')
-rw-r--r--src/H5AC.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 7d83bbb..5742a80 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -36,6 +36,9 @@
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5AC_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5AC_mask
@@ -56,11 +59,6 @@
#include "H5FPprivate.h" /* Flexible PHDF5 */
#endif /* H5_HAVE_FPHDF5 */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5AC_init_interface
-static herr_t H5AC_init_interface(void);
-
/*
* Private macros
*/
@@ -194,12 +192,10 @@ H5AC_init_interface(void)
unsigned block_before_meta_write; /* "block before meta write" property value */
unsigned library_internal=1; /* "library internal" property value */
H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode property value */
-#endif /* H5_HAVE_PARALLEL */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5AC_init_interface)
-#ifdef H5_HAVE_PARALLEL
/* Sanity check */
assert(H5P_CLS_DATASET_XFER_g!=(-1));
@@ -272,17 +268,22 @@ H5AC_init_interface(void)
xfer_mode=H5FD_MPIO_INDEPENDENT;
if (H5P_set(xfer_plist,H5D_XFER_IO_XFER_MODE_NAME,&xfer_mode)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
#else /* H5_HAVE_PARALLEL */
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5AC_init_interface)
+
/* Sanity check */
assert(H5P_LST_DATASET_XFER_g!=(-1));
H5AC_dxpl_id=H5P_DATASET_XFER_DEFAULT;
H5AC_noblock_dxpl_id=H5P_DATASET_XFER_DEFAULT;
H5AC_ind_dxpl_id=H5P_DATASET_XFER_DEFAULT;
-#endif /* H5_HAVE_PARALLEL */
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
+#endif /* H5_HAVE_PARALLEL */
} /* end H5AC_init_interface() */
@@ -310,7 +311,7 @@ H5AC_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5AC_term_interface)
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
#ifdef H5_HAVE_PARALLEL
if(H5AC_dxpl_id>0 || H5AC_noblock_dxpl_id>0 || H5AC_ind_dxpl_id>0) {
/* Indicate more work to do */
@@ -328,7 +329,7 @@ H5AC_term_interface(void)
H5AC_ind_dxpl_id=(-1);
/* Reset interface initialization flag */
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
} /* end else */
} /* end if */
else
@@ -340,7 +341,7 @@ H5AC_term_interface(void)
#endif /* H5_HAVE_PARALLEL */
/* Reset interface initialization flag */
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
} /* end if */
FUNC_LEAVE_NOAPI(n)