summaryrefslogtreecommitdiffstats
path: root/src/H5Pint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-31 21:31:36 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-31 21:31:36 (GMT)
commita42ea0be91c25d90427678d548bcff17b032d2ca (patch)
treed00896d7f1bf6cc2b9696c30d675461ccf00149e /src/H5Pint.c
parent0cff4f0d146e6beafa4c6b6d4047e489719670f6 (diff)
parentbeb6f83cfd696e835970091f730a23db31381455 (diff)
downloadhdf5-a42ea0be91c25d90427678d548bcff17b032d2ca.zip
hdf5-a42ea0be91c25d90427678d548bcff17b032d2ca.tar.gz
hdf5-a42ea0be91c25d90427678d548bcff17b032d2ca.tar.bz2
[svn-r25502] merge from trunk.
Diffstat (limited to 'src/H5Pint.c')
-rw-r--r--src/H5Pint.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/H5Pint.c b/src/H5Pint.c
index 9eb1568..53bdf3f 100644
--- a/src/H5Pint.c
+++ b/src/H5Pint.c
@@ -515,28 +515,27 @@ done:
int
H5P_term_interface(void)
{
- int nlist=0;
- int nclass=0;
- int n=0;
+ int n = 0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
if(H5_interface_initialize_g) {
+ int64_t nlist, nclass;
+
/* Destroy HDF5 library property classes & lists */
/* Check if there are any open property list classes or lists */
nclass = H5I_nmembers(H5I_GENPROP_CLS);
nlist = H5I_nmembers(H5I_GENPROP_LST);
- n=nclass+nlist;
/* If there are any open classes or groups, attempt to get rid of them. */
- if(n) {
+ if((nclass + nlist) > 0) {
/* Clear the lists */
- if(nlist>0) {
- H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE);
+ if(nlist > 0) {
+ (void)H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE);
/* Reset the default property lists, if they've been closed */
- if(H5I_nmembers(H5I_GENPROP_LST)==0) {
+ if(H5I_nmembers(H5I_GENPROP_LST) == 0) {
H5P_LST_FILE_CREATE_ID_g =
H5P_LST_FILE_ACCESS_ID_g =
H5P_LST_DATASET_CREATE_ID_g =
@@ -555,11 +554,11 @@ H5P_term_interface(void)
} /* end if */
/* Only attempt to close the classes after all the lists are closed */
- if(nlist==0 && nclass>0) {
- H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE);
+ if(nlist == 0 && nclass > 0) {
+ (void)H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE);
/* Reset the default property lists, if they've been closed */
- if(H5I_nmembers(H5I_GENPROP_CLS)==0) {
+ if(H5I_nmembers(H5I_GENPROP_CLS) == 0) {
H5P_CLS_ROOT_g =
H5P_CLS_OBJECT_CREATE_g =
H5P_CLS_FILE_CREATE_g =
@@ -597,6 +596,8 @@ H5P_term_interface(void)
H5P_CLS_FILE_MOUNT_ID_g = (-1);
} /* end if */
} /* end if */
+
+ n++; /*H5I*/
} else {
/* Close public interface */
n += H5P__term_pub_interface();
@@ -604,16 +605,19 @@ H5P_term_interface(void)
/* Close deprecated interface */
n += H5P__term_deprec_interface();
- H5I_dec_type_ref(H5I_GENPROP_LST);
+ /* Destroy the property list and class id groups */
+ (void)H5I_dec_type_ref(H5I_GENPROP_LST);
n++; /*H5I*/
- H5I_dec_type_ref(H5I_GENPROP_CLS);
+ (void)H5I_dec_type_ref(H5I_GENPROP_CLS);
n++; /*H5I*/
+ /* Mark closed */
H5_interface_initialize_g = 0;
- }
- }
+ } /* end else */
+ } /* end if */
+
FUNC_LEAVE_NOAPI(n)
-}
+} /* end H5P_term_interface() */
/*--------------------------------------------------------------------------