summaryrefslogtreecommitdiffstats
path: root/src/H5Dint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-09-16 14:15:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-09-16 14:15:13 (GMT)
commit9f028ea4589cfd21ce610050c75895ed69b2ee08 (patch)
tree9eea3e34c3604d6506d6b2d3ee9af6244e659ec0 /src/H5Dint.c
parent6fb5f819a51f27ffc44b21e2d0e44808ba71da17 (diff)
downloadhdf5-9f028ea4589cfd21ce610050c75895ed69b2ee08.zip
hdf5-9f028ea4589cfd21ce610050c75895ed69b2ee08.tar.gz
hdf5-9f028ea4589cfd21ce610050c75895ed69b2ee08.tar.bz2
[svn-r19399] Description:
Bring r19398 from trunk to 1.8 branch: Clean up the internal usage H5I_dec_ref() to eliminate the sequence of flags that has been creeping in. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r--src/H5Dint.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 446d040..d4097b5 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -560,8 +560,8 @@ H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type)
done:
if(ret_value == NULL)
if(new_dset != NULL) {
- if(new_dset->dcpl_id != 0)
- (void)H5I_dec_ref(new_dset->dcpl_id, FALSE, FALSE);
+ if(new_dset->dcpl_id != 0 && H5I_dec_ref(new_dset->dcpl_id) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't decrement temporary datatype ID")
new_dset = H5FL_FREE(H5D_shared_t, new_dset);
} /* end if */
@@ -1060,10 +1060,8 @@ done:
} /* end if */
if(new_dset->shared->space && H5S_close(new_dset->shared->space) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace")
- if(new_dset->shared->type) {
- if(H5I_dec_ref(new_dset->shared->type_id, FALSE, FALSE) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype")
- } /* end if */
+ if(new_dset->shared->type && H5I_dec_ref(new_dset->shared->type_id) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype")
if(H5F_addr_defined(new_dset->oloc.addr)) {
if(H5O_close(&(new_dset->oloc)) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header")
@@ -1072,7 +1070,7 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CANTDELETE, NULL, "unable to delete object header")
} /* end if */
} /* end if */
- if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id, FALSE, FALSE) < 0)
+ if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list")
new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared);
} /* end if */
@@ -1319,7 +1317,7 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
if(dataset->shared->type) {
if(dataset->shared->type_id > 0) {
- if(H5I_dec_ref(dataset->shared->type_id, FALSE, FALSE) < 0)
+ if(H5I_dec_ref(dataset->shared->type_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype")
} /* end if */
else {
@@ -1427,8 +1425,8 @@ H5D_close(H5D_t *dataset)
* Release datatype, dataspace and creation property list -- there isn't
* much we can do if one of these fails, so we just continue.
*/
- free_failed = (unsigned)(H5I_dec_ref(dataset->shared->type_id, FALSE, FALSE) < 0 || H5S_close(dataset->shared->space) < 0 ||
- H5I_dec_ref(dataset->shared->dcpl_id, FALSE, FALSE) < 0);
+ free_failed = (unsigned)(H5I_dec_ref(dataset->shared->type_id) < 0 || H5S_close(dataset->shared->space) < 0 ||
+ H5I_dec_ref(dataset->shared->dcpl_id) < 0);
/* Remove the dataset from the list of opened objects in the file */
if(H5FO_top_decr(dataset->oloc.file, dataset->oloc.addr) < 0)