summaryrefslogtreecommitdiffstats
path: root/src/H5Gint.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/H5Gint.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/H5Gint.c')
-rw-r--r--src/H5Gint.c45
1 files changed, 7 insertions, 38 deletions
diff --git a/src/H5Gint.c b/src/H5Gint.c
index 04b21a5..ea8288c 100644
--- a/src/H5Gint.c
+++ b/src/H5Gint.c
@@ -28,10 +28,7 @@
/* Module Setup */
/****************/
-#define H5G_PACKAGE /*suppress error about including H5Gpkg */
-
-/* Interface initialization */
-#define H5_INTERFACE_INIT_FUNC H5G_init_int_interface
+#include "H5Gmodule.h" /* This source code file is part of the H5G module */
/***********/
@@ -119,34 +116,6 @@ H5FL_DEFINE(H5_obj_t);
-/*--------------------------------------------------------------------------
-NAME
- H5G_init_int_interface -- Initialize interface-specific information
-USAGE
- herr_t H5G_init_int_interface()
-RETURNS
- Non-negative on success/Negative on failure
-DESCRIPTION
- Initializes any interface-specific data or routines. (Just calls
- H5G__init() currently).
-
---------------------------------------------------------------------------*/
-static herr_t
-H5G_init_int_interface(void)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Funnel all work to H5G__init() */
- if(H5G__init() < 0)
- HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "interface initialization failed")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5G_init_int_interface() */
-
-
/*-------------------------------------------------------------------------
* Function: H5G__create_named
*
@@ -167,7 +136,7 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id,
{
H5O_obj_create_t ocrt_info; /* Information for object creation */
H5G_obj_create_t gcrt_info; /* Information for group creation */
- H5G_t *ret_value; /* Return value */
+ H5G_t *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -225,7 +194,7 @@ H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id)
{
H5G_t *grp = NULL; /*new group */
unsigned oloc_init = 0; /* Flag to indicate that the group object location was created successfully */
- H5G_t *ret_value; /* Return value */
+ H5G_t *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -302,7 +271,7 @@ H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id,
H5O_loc_t grp_oloc; /* Opened object object location */
hbool_t loc_found = FALSE; /* Location at 'name' found */
H5O_type_t obj_type; /* Type of object at location */
- H5G_t *ret_value; /* Return value */
+ H5G_t *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -363,7 +332,7 @@ H5G_open(const H5G_loc_t *loc, hid_t dxpl_id)
{
H5G_t *grp = NULL; /* Group opened */
H5G_shared_t *shared_fo; /* Shared group object */
- H5G_t *ret_value; /* Return value */
+ H5G_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -814,7 +783,7 @@ H5G_iterate(hid_t loc_id, const char *group_name,
hid_t gid = -1; /* ID of group to iterate over */
H5G_t *grp = NULL; /* Pointer to group data structure to iterate over */
H5G_iter_appcall_ud_t udata; /* User data for callback */
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1084,7 +1053,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type,
H5G_loc_t loc; /* Location of group passed in */
H5G_loc_t start_loc; /* Location of starting group */
unsigned rc; /* Reference count of object */
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));