summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-09-14 03:58:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-09-14 03:58:59 (GMT)
commit102337449220dfc29be1cce29147704b9c760832 (patch)
tree2f57d117f2bd934eac2768be18dcc866619f390f /src/H5Fint.c
parentf16361d5f1dc70c344d8143270aa4aeaa867f244 (diff)
downloadhdf5-102337449220dfc29be1cce29147704b9c760832.zip
hdf5-102337449220dfc29be1cce29147704b9c760832.tar.gz
hdf5-102337449220dfc29be1cce29147704b9c760832.tar.bz2
[svn-r27768] Description:
Complete revamp of package initialization/shutdown mechanism in the library. Each package now has a single init/term routine. This new way should avoid packages being re-initialized during library shutdown and is also be _much_ more proactive about giving feedback for resource leaks internal to the library. Introduces a new "module" header file for packages in the library (e.g src/H5Fmodule.h) which sets up some necessary package configuration macros for the FUNC_ENTER/LEAVE macros. (The VFL drivers have their own slightly modified version of this header, src/H5FDdrvr_module.h) Also cleaned up a bunch of resources leaks all across the library and tests, along with addressing many warnings, as I encountered them. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel Linux/64 3.10.x (kituo) w/serial & parallel Linux/64 2.6.x (ostrich) w/serial
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c39
1 files changed, 6 insertions, 33 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 0e77349..209eadd 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -17,10 +17,7 @@
/* Module Setup */
/****************/
-#define H5F_PACKAGE /*suppress error about including H5Fpkg */
-
-/* Interface initialization */
-#define H5_INTERFACE_INIT_FUNC H5F_init_interface
+#include "H5Fmodule.h" /* This source code file is part of the H5F module */
/***********/
@@ -103,30 +100,6 @@ H5FL_DEFINE(H5F_file_t);
/*-------------------------------------------------------------------------
- * Function: H5F_init_interface
- *
- * Purpose: Initialize interface-specific information.
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Robb Matzke
- * Friday, November 20, 1998
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5F_init_interface(void)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_init_interface() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5F_get_access_plist
*
* Purpose: Returns a copy of the file access property list of the
@@ -533,7 +506,7 @@ H5F_is_hdf5(const char *name)
{
H5FD_t *file = NULL; /* Low-level file struct */
haddr_t sig_addr; /* Addess of hdf5 file signature */
- htri_t ret_value; /* Return value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -581,7 +554,7 @@ done:
H5F_t *
H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
{
- H5F_t *f = NULL, *ret_value;
+ H5F_t *f = NULL, *ret_value = NULL;
FUNC_ENTER_NOAPI_NOINIT
@@ -955,7 +928,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
H5FD_class_t *drvr; /*file driver class info */
H5P_genplist_t *a_plist; /*file access property list */
H5F_close_degree_t fc_degree; /*file close degree */
- H5F_t *ret_value; /*actual return value */
+ H5F_t *ret_value = NULL; /*actual return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1454,7 +1427,7 @@ done:
hid_t
H5F_get_id(H5F_t *file, hbool_t app_ref)
{
- hid_t ret_value;
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1978,7 +1951,7 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
{
H5FD_t *fd_ptr; /* file driver */
haddr_t eoa; /* End of file address */
- ssize_t ret_value; /* Return value */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI_NOINIT