summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-08-15 20:07:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-08-15 20:07:18 (GMT)
commit2e4c7f1107c5d7a72c34b1f19d1a9ce5b08aa43b (patch)
tree21f20dd42522b9395d76c17fb3f2ed8ae4519e8a /src
parent2147a97e4b13f16288a4c8e7cddbfede0b11cb73 (diff)
downloadhdf5-2e4c7f1107c5d7a72c34b1f19d1a9ce5b08aa43b.zip
hdf5-2e4c7f1107c5d7a72c34b1f19d1a9ce5b08aa43b.tar.gz
hdf5-2e4c7f1107c5d7a72c34b1f19d1a9ce5b08aa43b.tar.bz2
[svn-r7373] Purpose:
Code cleanup Description: Cleanup H5Pclose code and also switch a few internal users of H5Pclose to use H5I_dec_ref instead. Platforms tested: FreeBSD 4.8 (sleipnir) too small for h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5AC.c6
-rw-r--r--src/H5D.c2
-rw-r--r--src/H5FPclient.c4
-rw-r--r--src/H5P.c9
4 files changed, 8 insertions, 13 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index cb3aa79..605808f 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -308,9 +308,9 @@ H5AC_term_interface(void)
n = 1; /* H5I */
/* Close H5AC dxpl */
- if (H5Pclose(H5AC_dxpl_id) < 0 ||
- H5Pclose(H5AC_noblock_dxpl_id) < 0 ||
- H5Pclose(H5AC_ind_dxpl_id) < 0)
+ if (H5I_dec_ref(H5AC_dxpl_id) < 0 ||
+ H5I_dec_ref(H5AC_noblock_dxpl_id) < 0 ||
+ H5I_dec_ref(H5AC_ind_dxpl_id) < 0)
H5E_clear(NULL); /*ignore error*/
else {
/* Reset static IDs */
diff --git a/src/H5D.c b/src/H5D.c
index 92b6f84..827d0a3 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1181,7 +1181,7 @@ H5Dget_create_plist(hid_t dset_id)
done:
if(ret_value<0) {
if(new_dcpl_id>0)
- (void)H5Pclose(new_dcpl_id);
+ (void)H5I_dec_ref(new_dcpl_id);
} /* end if */
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5FPclient.c b/src/H5FPclient.c
index d5bcfdb..df29015 100644
--- a/src/H5FPclient.c
+++ b/src/H5FPclient.c
@@ -870,7 +870,7 @@ H5FP_dump_to_file(H5FD_t *file, hid_t dxpl_id)
if (H5FP_read_metadata(&mdata, (int)sap_read.md_size,
(int)H5FP_sap_rank) != FAIL) {
- if (H5FD_fphdf5_write_real(file, dxpl_id, sap_read.addr,
+ if (H5FD_fphdf5_write_real(file, new_dxpl_id, sap_read.addr,
(int)sap_read.md_size, mdata) == FAIL) {
HDfree(mdata);
HGOTO_ERROR(H5E_FPHDF5, H5E_WRITEERROR, FAIL, "can't write metadata to file");
@@ -884,7 +884,7 @@ H5FP_dump_to_file(H5FD_t *file, hid_t dxpl_id)
done:
if (new_dxpl_id > 0)
- H5Pclose(new_dxpl_id);
+ H5I_dec_ref(new_dxpl_id);
FUNC_LEAVE_NOAPI(ret_value);
}
diff --git a/src/H5P.c b/src/H5P.c
index 729dc16..bd09b6a 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -5164,7 +5164,6 @@ done:
herr_t
H5Pclose(hid_t plist_id)
{
- H5P_genplist_t *plist; /* Property list created */
herr_t ret_value=SUCCEED; /* return value */
FUNC_ENTER_API(H5Pclose, FAIL);
@@ -5174,17 +5173,13 @@ H5Pclose(hid_t plist_id)
HGOTO_DONE(SUCCEED);
/* Check arguments. */
- if (NULL == (plist = H5I_object_verify(plist_id, H5I_GENPROP_LST)))
+ if (H5I_GENPROP_LST != H5I_get_type(plist_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
/* Close the property list */
- if (H5P_close(plist) < 0)
+ if (H5I_dec_ref(plist_id) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close");
- /* Remove the property list from the ID manager now */
- if (NULL == H5I_remove(plist_id))
- HGOTO_ERROR(H5E_ARGS, H5E_CANTDELETE, FAIL, "can't delete property list");
-
done:
FUNC_LEAVE_API(ret_value);
} /* H5Pclose() */