summaryrefslogtreecommitdiffstats
path: root/src/H5Otest.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-02-19 19:36:52 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-02-19 19:36:52 (GMT)
commit0a9ad6a46eadfb6c270bfdba114374c6cb95b063 (patch)
tree803b0ea0e4af156b20b0533d841b5d09d0c901de /src/H5Otest.c
parent0e515209b26676bcc93e1ca412ecc026ad8d6312 (diff)
downloadhdf5-0a9ad6a46eadfb6c270bfdba114374c6cb95b063.zip
hdf5-0a9ad6a46eadfb6c270bfdba114374c6cb95b063.tar.gz
hdf5-0a9ad6a46eadfb6c270bfdba114374c6cb95b063.tar.bz2
[svn-r16494] Description:
Bring r16483 back from trunk: Clean up (i.e. remove) more internal calls to H5E_clear_stack(), along with some other minor code cleanups. Tested on: Mac OS X/32 10.5.6 (amazon) (too minor to require h5committest)
Diffstat (limited to 'src/H5Otest.c')
-rw-r--r--src/H5Otest.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/H5Otest.c b/src/H5Otest.c
index 8116ffa..c2b30fa 100644
--- a/src/H5Otest.c
+++ b/src/H5Otest.c
@@ -112,9 +112,11 @@ H5O_is_attr_dense_test(hid_t oid)
/* Check for attribute info stored */
ainfo.fheap_addr = HADDR_UNDEF;
- if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo))
- /* Clear error stack from not finding attribute info */
- H5E_clear_stack(NULL);
+ if(oh->version > H5O_VERSION_1) {
+ /* Check for (& retrieve if available) attribute info */
+ if(H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message")
+ } /* end if */
/* Check if dense storage is being used */
if(H5F_addr_defined(ainfo.fheap_addr)) {
@@ -157,7 +159,7 @@ H5O_is_attr_empty_test(hid_t oid)
{
H5O_t *oh = NULL; /* Object header */
H5O_ainfo_t ainfo; /* Attribute information for object */
- H5O_ainfo_t *ainfo_ptr = NULL; /* Pointer to attribute information for object */
+ htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */
H5O_loc_t *oloc; /* Pointer to object's location */
hsize_t nattrs; /* Number of attributes */
htri_t ret_value; /* Return value */
@@ -173,17 +175,18 @@ H5O_is_attr_empty_test(hid_t oid)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header")
/* Check for attribute info stored */
- ainfo.fheap_addr = HADDR_UNDEF;
- if(oh->version > H5O_VERSION_1 && NULL == (ainfo_ptr = H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo)))
- /* Clear error stack from not finding attribute info */
- H5E_clear_stack(NULL);
+ if(oh->version > H5O_VERSION_1) {
+ /* Check for (& retrieve if available) attribute info */
+ if((ainfo_exists = H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo)) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message")
+ } /* end if */
/* Retrieve the number of attribute messages in header */
nattrs = H5O_msg_count_real(oh, H5O_MSG_ATTR);
/* Check for later version of object header format & attribute info available */
if(oh->version > H5O_VERSION_1) {
- if(ainfo_ptr) {
+ if(ainfo_exists) {
/* Check for using dense storage */
if(H5F_addr_defined(ainfo.fheap_addr)) {
/* Check for any messages in object header */
@@ -252,9 +255,11 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs)
/* Check for attribute info stored */
ainfo.fheap_addr = HADDR_UNDEF;
- if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo))
- /* Clear error stack from not finding attribute info */
- H5E_clear_stack(NULL);
+ if(oh->version > H5O_VERSION_1) {
+ /* Check for (& retrieve if available) attribute info */
+ if(H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message")
+ } /* end if */
/* Retrieve the number of attribute messages in header */
obj_nattrs = H5O_msg_count_real(oh, H5O_MSG_ATTR);
@@ -327,9 +332,11 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count)
/* Check for attribute info stored */
ainfo.fheap_addr = HADDR_UNDEF;
- if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo))
- /* Clear error stack from not finding attribute info */
- H5E_clear_stack(NULL);
+ if(oh->version > H5O_VERSION_1) {
+ /* Check for (& retrieve if available) attribute info */
+ if(H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message")
+ } /* end if */
/* Check for 'dense' attribute storage file addresses being defined */
if(!H5F_addr_defined(ainfo.fheap_addr))