diff options
Diffstat (limited to 'src/H5Adense.c')
-rw-r--r-- | src/H5Adense.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/H5Adense.c b/src/H5Adense.c index 1efe45d..69f2a15 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -338,7 +338,7 @@ H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) H5HF_t * shared_fheap = NULL; /* Fractal heap handle for shared header messages */ H5B2_t * bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t attr_sharable; /* Flag indicating attributes are sharable */ - htri_t attr_exists; /* Attribute exists in v2 B-tree */ + hbool_t attr_exists; /* Attribute exists in v2 B-tree */ H5A_t * ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -388,9 +388,10 @@ H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) udata.found_op_data = &ret_value; /* Find & copy the attribute in the 'name' index */ - if ((attr_exists = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) + attr_exists = FALSE; + if (H5B2_find(bt2_name, &udata, &attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't search for attribute in name index") - else if (attr_exists == FALSE) + if (attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute in name index") done: @@ -866,7 +867,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons H5A_t * attr_copy = NULL; /* Copy of attribute to rename */ htri_t attr_sharable; /* Flag indicating attributes are sharable */ htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */ - htri_t attr_exists; /* Attribute exists in v2 B-tree */ + hbool_t attr_exists; /* Attribute exists in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -917,9 +918,10 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons udata.found_op_data = &attr_copy; /* Get copy of attribute through 'name' tracking v2 B-tree */ - if ((attr_exists = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) + attr_exists = FALSE; + if (H5B2_find(bt2_name, &udata, &attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") - else if (attr_exists == FALSE) + if (attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute in name index") HDassert(attr_copy); @@ -942,7 +944,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons /* Need to remove the attribute from the creation order index v2 B-tree */ if (ainfo->index_corder) { - htri_t corder_attr_exists; /* Attribute exists in v2 B-tree */ + hbool_t corder_attr_exists; /* Attribute exists in v2 B-tree */ /* Open the creation order index v2 B-tree */ HDassert(H5F_addr_defined(ainfo->corder_bt2_addr)); @@ -952,7 +954,8 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons /* Set up the creation order to search for */ udata.corder = attr_copy->shared->crt_idx; - if ((corder_attr_exists = H5B2_find(bt2_corder, &udata, NULL, NULL)) < 0) + corder_attr_exists = FALSE; + if (H5B2_find(bt2_corder, &udata, &corder_attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") if (corder_attr_exists) { @@ -1665,15 +1668,15 @@ done: * *------------------------------------------------------------------------- */ -htri_t -H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) +herr_t +H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name, hbool_t *attr_exists) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5HF_t * fheap = NULL; /* Fractal heap handle */ H5HF_t * shared_fheap = NULL; /* Fractal heap handle for shared header messages */ H5B2_t * bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t attr_sharable; /* Flag indicating attributes are sharable */ - htri_t ret_value = TRUE; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1681,6 +1684,7 @@ H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) HDassert(f); HDassert(ainfo); HDassert(name); + HDassert(attr_exists); /* Open the fractal heap */ if (NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) @@ -1722,7 +1726,7 @@ H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) udata.found_op_data = NULL; /* Find the attribute in the 'name' index */ - if ((ret_value = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) + if (H5B2_find(bt2_name, &udata, attr_exists, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") done: |