summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-09-16 14:02:19 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-09-16 14:02:19 (GMT)
commit1914737e0658d642c1ef2e48c6162fa7cc400c64 (patch)
treed514c5e86096148b10b67f5e178dce87a7625d4d /src/H5T.c
parente5575571d4faaee78c67fc7dbae7d8229b1bfb94 (diff)
downloadhdf5-1914737e0658d642c1ef2e48c6162fa7cc400c64.zip
hdf5-1914737e0658d642c1ef2e48c6162fa7cc400c64.tar.gz
hdf5-1914737e0658d642c1ef2e48c6162fa7cc400c64.tar.bz2
[svn-r19398] Descriptino:
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/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, 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 Mac OS X/32 10.6.4 (amazon) in debug mode Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 2057a2a..1f962f0 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1719,11 +1719,11 @@ H5Tclose(hid_t type_id)
/* Check args */
if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
- if(H5T_STATE_IMMUTABLE==dt->shared->state)
+ if(H5T_STATE_IMMUTABLE == dt->shared->state)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype")
/* When the reference count reaches zero the resources are freed */
- if(H5I_dec_ref(type_id, TRUE, FALSE) < 0)
+ if(H5I_dec_app_ref(type_id) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id")
done:
@@ -2341,28 +2341,28 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
old_path->dst->shared->type!=dst->shared->type) {
continue;
}
- if ((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL), FALSE))<0 ||
- (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL), FALSE))<0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data types for conv query");
+ if((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL), FALSE)) < 0 ||
+ (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL), FALSE)) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data types for conv query")
HDmemset(&cdata, 0, sizeof cdata);
cdata.command = H5T_CONV_INIT;
- if ((func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0,
- NULL, NULL, dxpl_id)<0) {
- H5I_dec_ref(tmp_sid, FALSE, FALSE);
- H5I_dec_ref(tmp_did, FALSE, FALSE);
+ if((func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0,
+ NULL, NULL, dxpl_id) < 0) {
+ H5I_dec_ref(tmp_sid);
+ H5I_dec_ref(tmp_did);
tmp_sid = tmp_did = -1;
H5E_clear_stack(NULL);
continue;
} /* end if */
/* Create a new conversion path */
- if (NULL==(new_path=H5FL_CALLOC(H5T_path_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
+ if(NULL == (new_path = H5FL_CALLOC(H5T_path_t)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
HDstrncpy(new_path->name, name, (size_t)H5T_NAMELEN);
new_path->name[H5T_NAMELEN-1] = '\0';
- if (NULL==(new_path->src=H5T_copy(old_path->src, H5T_COPY_ALL)) ||
- NULL==(new_path->dst=H5T_copy(old_path->dst, H5T_COPY_ALL)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy data types");
+ if(NULL == (new_path->src = H5T_copy(old_path->src, H5T_COPY_ALL)) ||
+ NULL == (new_path->dst=H5T_copy(old_path->dst, H5T_COPY_ALL)))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy data types")
new_path->func = func;
new_path->is_hard = FALSE;
new_path->cdata = cdata;
@@ -2389,8 +2389,8 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst,
old_path = H5FL_FREE(H5T_path_t, old_path);
/* Release temporary atoms */
- H5I_dec_ref(tmp_sid, FALSE, FALSE);
- H5I_dec_ref(tmp_did, FALSE, FALSE);
+ H5I_dec_ref(tmp_sid);
+ H5I_dec_ref(tmp_did);
tmp_sid = tmp_did = -1;
/* We don't care about any failures during the freeing process */
@@ -2408,9 +2408,9 @@ done:
new_path = H5FL_FREE(H5T_path_t, new_path);
} /* end if */
if(tmp_sid >= 0)
- H5I_dec_ref(tmp_sid, FALSE, FALSE);
+ H5I_dec_ref(tmp_sid);
if(tmp_did >= 0)
- H5I_dec_ref(tmp_did, FALSE, FALSE);
+ H5I_dec_ref(tmp_did);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value);
@@ -4409,9 +4409,9 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name,
if((func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function")
if(src_id >= 0)
- H5I_dec_ref(src_id, FALSE, FALSE);
+ H5I_dec_ref(src_id);
if(dst_id >= 0)
- H5I_dec_ref(dst_id, FALSE, FALSE);
+ H5I_dec_ref(dst_id);
src_id = dst_id = -1;
path->func = func;
path->is_hard = TRUE;
@@ -4441,8 +4441,8 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name,
path->func = H5T_g.soft[i].func;
path->is_hard = FALSE;
} /* end else */
- H5I_dec_ref(src_id, FALSE, FALSE);
- H5I_dec_ref(dst_id, FALSE, FALSE);
+ H5I_dec_ref(src_id);
+ H5I_dec_ref(dst_id);
src_id = dst_id = -1;
} /* end for */
if(!path->func)
@@ -4529,9 +4529,9 @@ done:
path = H5FL_FREE(H5T_path_t, path);
} /* end if */
if(src_id >= 0)
- H5I_dec_ref(src_id, FALSE, FALSE);
+ H5I_dec_ref(src_id);
if(dst_id >= 0)
- H5I_dec_ref(dst_id, FALSE, FALSE);
+ H5I_dec_ref(dst_id);
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5T_path_find() */