diff options
author | Sean McBride <sean@rogue-research.com> | 2023-08-02 13:39:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-02 13:39:15 (GMT) |
commit | 2b0badb90e4e516d0758efbd8ec96449188c7249 (patch) | |
tree | 074e38039b95ca7121a0117069974eff52a04519 /src/H5Oattribute.c | |
parent | 56451503c55ef6e5f67fc3bb710f9e5b649b1af2 (diff) | |
download | hdf5-2b0badb90e4e516d0758efbd8ec96449188c7249.zip hdf5-2b0badb90e4e516d0758efbd8ec96449188c7249.tar.gz hdf5-2b0badb90e4e516d0758efbd8ec96449188c7249.tar.bz2 |
Made HGOTO_ERROR a do-while loop (#3308)
* Made HGOTO_ERROR a do-while loop
Diffstat (limited to 'src/H5Oattribute.c')
-rw-r--r-- | src/H5Oattribute.c | 233 |
1 files changed, 118 insertions, 115 deletions
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 8ef4b22..9e38488 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -170,12 +170,12 @@ H5O__attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_U /* Insert attribute into dense storage */ if (H5A__dense_insert(udata->f, udata->ainfo, attr) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to add to dense storage") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to add to dense storage"); /* Convert message into a null message in the header */ /* (don't delete attribute's space in the file though) */ if (H5O__release_mesg(udata->f, oh, mesg, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message"); /* Indicate that the object header was modified */ *oh_modified = H5O_MODIFY_CONDENSE; @@ -209,7 +209,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header"); /* Check if this object already has attribute information */ if (oh->version > H5O_VERSION_1) { @@ -218,7 +218,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Check for (& retrieve if available) attribute info */ if ((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); if (!ainfo_exists) { /* Initialize attribute information */ ainfo.track_corder = (hbool_t)((oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) ? TRUE : FALSE); @@ -246,7 +246,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Check for attribute being shareable */ if ((shareable = H5SM_can_share(loc->file, NULL, NULL, H5O_ATTR_ID, attr)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't determine attribute sharing status") + HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't determine attribute sharing status"); else if (shareable == FALSE) { /* Compute the size needed to encode the attribute */ raw_size = (H5O_MSG_ATTR->raw_size)(loc->file, FALSE, attr); @@ -259,7 +259,8 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Create dense storage for attributes */ if (H5A__dense_create(loc->file, &ainfo) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create dense storage for attributes") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, + "unable to create dense storage for attributes"); /* Set up user data for callback */ udata.f = loc->file; @@ -270,7 +271,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) op.u.lib_op = H5O__attr_to_dense_cb; if (H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCONVERT, FAIL, - "error converting attributes to dense storage") + "error converting attributes to dense storage"); } /* end if */ } /* end if */ @@ -281,7 +282,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) if (ainfo.track_corder) { /* Check for attribute creation order index on the object wrapping around */ if (ainfo.max_crt_idx == H5O_MAX_CRT_ORDER_IDX) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINC, FAIL, "attribute creation index can't be incremented") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINC, FAIL, "attribute creation index can't be incremented"); /* Set the creation order index on the attribute & incr. creation order index */ attr->shared->crt_idx = ainfo.max_crt_idx++; @@ -293,11 +294,11 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Add the attribute information message, if one is needed */ if (new_ainfo) { if (H5O__msg_append_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute info message"); } /* end if */ /* Otherwise, update existing message */ else if (H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message"); } /* end if */ else { /* Set "bogus" creation index for attribute */ @@ -311,12 +312,12 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) if (H5_addr_defined(ainfo.fheap_addr)) { /* Insert attribute into dense storage */ if (H5A__dense_insert(loc->file, &ainfo, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to add to dense storage") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to add to dense storage"); } /* end if */ else /* Append new message to object header */ if (H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute in header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute in header"); /* Increment reference count for shared attribute object for the * object handle created by the caller function H5A__create. The count @@ -331,7 +332,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Retrieve ref count for shared attribute */ if (H5SM_get_refcount(loc->file, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count"); /* If this is not the first copy of the attribute in the shared message * storage, decrement the reference count on any shared components @@ -358,15 +359,15 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) */ if (attr_rc > 1) { if (H5O__attr_delete(loc->file, oh, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute"); } /* end if */ } /* end if */ else if (shared_mesg < 0) - HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") + HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared"); /* Update the modification time, if any */ if (H5O_touch_oh(loc->file, oh, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: if (oh && H5O_unpin(oh) < 0) @@ -403,7 +404,7 @@ H5O__attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Make a copy of the attribute to return */ if (NULL == (udata->attr = H5A__copy(NULL, (H5A_t *)mesg->native))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy attribute"); /* Assign [somewhat arbitrary] creation order value, for older versions * of the format or if creation order is not tracked */ @@ -445,31 +446,31 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) /* Protect the object header to iterate over */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header"); /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if (oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ if (H5A__get_ainfo(loc->file, oh, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't check for attribute info message"); } /* end if */ /* If found the attribute is already opened, make a copy of it to share the * object information. If not, open attribute as a new object */ if ((found_open_attr = H5O__attr_find_opened_attr(loc, &exist_attr, name)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute"); else if (found_open_attr == TRUE) { if (NULL == (opened_attr = H5A__copy(NULL, exist_attr))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute"); } /* end else if */ else { /* Check for attributes in dense storage */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Open attribute with dense storage */ if (NULL == (opened_attr = H5A__dense_open(loc->file, &ainfo, name))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "can't open attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "can't open attribute"); } /* end if */ else { H5O_iter_opn_t udata; /* User data for callback */ @@ -483,11 +484,11 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__attr_open_cb; if (H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "error updating attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "error updating attribute"); /* Check that we found the attribute */ if (!udata.attr) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute: '%s'", name) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute: '%s'", name); /* Get attribute opened from object header */ assert(udata.attr); @@ -496,7 +497,7 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) /* Mark datatype as being on disk now */ if (H5T_set_loc(opened_attr->shared->dt, H5F_VOL_OBJ(loc->file), H5T_LOC_DISK) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "invalid datatype location") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "invalid datatype location"); } /* end else */ /* Set return value */ @@ -537,7 +538,7 @@ H5O__attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr) /* Copy attribute information. Shared some attribute information. */ if (NULL == (*ret_attr = H5A__copy(NULL, attr))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -573,28 +574,28 @@ H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order_t /* Iterate over attributes to locate correct one */ if (H5O_attr_iterate_real((hid_t)-1, loc, idx_type, order, n, NULL, &attr_op, &opened_attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_BADITER, NULL, "can't locate attribute") + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, NULL, "can't locate attribute"); /* Find out whether it has already been opened. If it has, close the object * and make a copy of the already opened object to share the object info. */ if (opened_attr) { if ((found_open_attr = H5O__attr_find_opened_attr(loc, &exist_attr, opened_attr->shared->name)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute"); /* If found that the attribute is already opened, make a copy of it * and close the object just opened. */ if (found_open_attr && exist_attr) { if (H5A__close(opened_attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute"); if (NULL == (opened_attr = H5A__copy(NULL, exist_attr))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute"); } else { /* Mark datatype as being on disk now */ if (H5T_set_loc(opened_attr->shared->dt, H5F_VOL_OBJ(loc->file), H5T_LOC_DISK) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "invalid datatype location") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "invalid datatype location"); } /* end if */ } /* end if */ @@ -634,11 +635,11 @@ H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char *name_ /* Get file serial number for the location of attribute */ if (H5F_get_fileno(loc->file, &loc_fnum) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "can't get file serial number") + HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "can't get file serial number"); /* Count all opened attributes */ if (H5F_get_obj_count(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, FALSE, &num_open_attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't count opened attributes") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't count opened attributes"); /* Find out whether the attribute has been opened */ if (num_open_attr) { @@ -647,14 +648,14 @@ H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char *name_ /* Allocate space for the attribute ID list */ if (NULL == (attr_id_list = (hid_t *)H5MM_malloc(num_open_attr * sizeof(hid_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "unable to allocate memory for attribute ID list") + HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "unable to allocate memory for attribute ID list"); /* Retrieve the IDs of all opened attributes */ if (H5F_get_obj_ids(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, num_open_attr, attr_id_list, FALSE, &check_num_attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get IDs of opened attributes") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get IDs of opened attributes"); if (check_num_attr != num_open_attr) - HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "open attribute count mismatch") + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "open attribute count mismatch"); /* Iterate over the attributes */ for (u = 0; u < num_open_attr; u++) { @@ -662,11 +663,11 @@ H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char *name_ /* Get pointer to attribute */ if (NULL == (*attr = (H5A_t *)H5VL_object_verify(attr_id_list[u], H5I_ATTR))) - HGOTO_ERROR(H5E_ATTR, H5E_BADTYPE, FAIL, "not an attribute") + HGOTO_ERROR(H5E_ATTR, H5E_BADTYPE, FAIL, "not an attribute"); /* Get file serial number for attribute */ if (H5F_get_fileno((*attr)->oloc.file, &attr_fnum) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "can't get file serial number") + HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "can't get file serial number"); /* Verify whether it's the right object. The attribute name, object * address to which the attribute is attached, and file serial @@ -712,22 +713,22 @@ H5O__attr_update_shared(H5F_t *f, H5O_t *oh, H5A_t *attr, H5O_shared_t *update_s /* Extract shared message info from current attribute (for later use) */ if (H5O_set_shared(&sh_mesg, &(attr->sh_loc)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't get shared message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't get shared message"); /* Reset existing sharing information */ if (H5O_msg_reset_share(H5O_ATTR_ID, attr) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to reset attribute sharing") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to reset attribute sharing"); /* Store new version of message as a SOHM */ /* (should always work, since we're not changing the size of the attribute) */ if ((shared_mesg = H5SM_try_share(f, oh, 0, H5O_ATTR_ID, attr, NULL)) == 0) - HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "attribute changed sharing status") + HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "attribute changed sharing status"); else if (shared_mesg < 0) - HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't share attribute") + HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't share attribute"); /* Retrieve shared message storage ref count for new shared attribute */ if (H5SM_get_refcount(f, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count"); /* If the newly shared attribute needs to share "ownership" of the shared * components (ie. its reference count is 1), increment the reference @@ -741,16 +742,16 @@ H5O__attr_update_shared(H5F_t *f, H5O_t *oh, H5A_t *attr, H5O_shared_t *update_s if (attr_rc == 1) /* Increment reference count on attribute components */ if (H5O__attr_link(f, oh, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") + HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count"); /* Remove the old attribute from the SOHM storage */ if (H5SM_delete(f, oh, &sh_mesg) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute in shared storage") + HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute in shared storage"); /* Extract updated shared message info from modified attribute, if requested */ if (update_sh_mesg) if (H5O_set_shared(update_sh_mesg, &(attr->sh_loc)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't get shared message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't get shared message"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -786,7 +787,7 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNUS if (0 == HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->attr->shared->name)) { /* Protect chunk */ if (NULL == (chk_proxy = H5O__chunk_protect(udata->f, oh, mesg->chunkno))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk"); /* Because the attribute structure is shared now. The only situation that requires * copying the data is when the metadata cache evicts and reloads this attribute. @@ -809,14 +810,15 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNUS /* Release chunk */ if (H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, + "unable to unprotect object header chunk"); chk_proxy = NULL; /* Update the shared attribute in the SOHM storage */ if (mesg->flags & H5O_MSG_FLAG_SHARED) if (H5O__attr_update_shared(udata->f, oh, udata->attr, (H5O_shared_t *)mesg->native) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, H5_ITER_ERROR, - "unable to update attribute in shared storage") + "unable to update attribute in shared storage"); /* Indicate that the object header was modified */ *oh_modified = H5O_MODIFY; @@ -860,21 +862,21 @@ H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header"); /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if (oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ if (H5A__get_ainfo(loc->file, oh, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); } /* end if */ /* Check for attributes stored densely */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Modify the attribute data in dense storage */ if (H5A__dense_write(loc->file, &ainfo, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute"); } /* end if */ else { H5O_iter_wrt_t udata; /* User data for callback */ @@ -889,16 +891,16 @@ H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__attr_write_cb; if (H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute"); /* Check that we found the attribute */ if (!udata.found) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate open attribute?") + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate open attribute?"); } /* end else */ /* Update the modification time, if any */ if (H5O_touch_oh(loc->file, oh, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: if (oh && H5O_unpin(oh) < 0) @@ -981,7 +983,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR /* Protect chunk */ if (NULL == (chk_proxy = H5O__chunk_protect(udata->f, oh, mesg->chunkno))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk"); /* Change the name for the attribute */ H5MM_xfree(((H5A_t *)mesg->native)->shared->name); @@ -989,7 +991,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR /* Recompute the version to encode the attribute with */ if (H5A__set_version(udata->f, ((H5A_t *)mesg->native)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5_ITER_ERROR, "unable to update attribute version") + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5_ITER_ERROR, "unable to update attribute version"); /* Mark the message as modified */ mesg->dirty = TRUE; @@ -997,7 +999,8 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR /* Release chunk */ if (H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, + "unable to unprotect object header chunk"); chk_proxy = NULL; /* Check for shared message */ @@ -1005,7 +1008,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR /* Update the shared attribute in the SOHM storage */ if (H5O__attr_update_shared(udata->f, oh, (H5A_t *)mesg->native, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, H5_ITER_ERROR, - "unable to update attribute in shared storage") + "unable to update attribute in shared storage"); } /* end if */ else { /* Sanity check */ @@ -1035,7 +1038,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR */ if (H5O__release_mesg(udata->f, oh, mesg, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, H5_ITER_ERROR, - "unable to release previous attribute") + "unable to release previous attribute"); *oh_modified = H5O_MODIFY_CONDENSE; @@ -1044,7 +1047,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR if (H5O__msg_append_real(udata->f, oh, H5O_MSG_ATTR, (mesg->flags | H5O_MSG_FLAG_DONTSHARE), 0, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, H5_ITER_ERROR, - "unable to relocate renamed attribute in header") + "unable to relocate renamed attribute in header"); /* Sanity check */ assert(H5O_msg_is_shared(H5O_ATTR_ID, attr) == FALSE); @@ -1097,21 +1100,21 @@ H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, const char *new_nam /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header"); /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if (oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ if (H5A__get_ainfo(loc->file, oh, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); } /* end if */ /* Check for attributes stored densely */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Rename the attribute data in dense storage */ if (H5A__dense_rename(loc->file, &ainfo, old_name, new_name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute"); } /* end if */ else { H5O_iter_ren_t udata; /* User data for callback */ @@ -1127,26 +1130,26 @@ H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, const char *new_nam op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__attr_rename_chk_cb; if (H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute"); /* If the new name was found, indicate an error */ if (udata.found) - HGOTO_ERROR(H5E_ATTR, H5E_EXISTS, FAIL, "attribute with new name already exists") + HGOTO_ERROR(H5E_ATTR, H5E_EXISTS, FAIL, "attribute with new name already exists"); /* Iterate over attributes again, to actually rename attribute with old name */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__attr_rename_mod_cb; if (H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute"); /* Check that we found the attribute to rename */ if (!udata.found) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute with old name") + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute with old name"); } /* end else */ /* Update the modification time, if any */ if (H5O_touch_oh(loc->file, oh, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: if (oh && H5O_unpin(oh) < 0) @@ -1183,25 +1186,25 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, H5_index_t idx_type, H /* Protect the object header to iterate over */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if (oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ if (H5A__get_ainfo(loc->file, oh, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); } /* end if */ /* Check for attributes stored densely */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Check for skipping too many attributes */ if (skip > 0 && skip >= ainfo.nattrs) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified"); /* Release the object header */ if (H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header"); oh = NULL; /* Iterate over attributes in dense storage */ @@ -1212,16 +1215,16 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, H5_index_t idx_type, H else { /* Build table of attributes for compact storage */ if (H5A__compact_build_table(loc->file, oh, idx_type, order, &atable) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table"); /* Release the object header */ if (H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header"); oh = NULL; /* Check for skipping too many attributes */ if (skip > 0 && skip >= atable.nattrs) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified"); /* Iterate over attributes in table */ if ((ret_value = H5A__attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) @@ -1261,7 +1264,7 @@ H5O__attr_iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsiz /* Look up location for location ID */ if (H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); /* Iterate over attributes to locate correct one */ if ((ret_value = @@ -1310,7 +1313,7 @@ H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) /* Build the table of attributes for this object */ if (H5A__dense_build_table(loc->file, ainfo, H5_INDEX_NAME, H5_ITER_NATIVE, &atable) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table"); /* Inspect attributes in table for ones that can't be converted back * into attribute message form (currently only attributes which @@ -1334,12 +1337,12 @@ H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) /* Check if attribute is shared */ if ((shared_mesg = H5O_msg_is_shared(H5O_ATTR_ID, (atable.attrs[u]))) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "error determining if message is shared") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "error determining if message is shared"); else if (shared_mesg == 0) { /* Increment reference count on attribute components */ /* (so that they aren't deleted when the dense attribute storage is deleted) */ if (H5O__attr_link(loc->file, oh, (atable.attrs[u])) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") + HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count"); } /* end if */ else { /* Reset 'shared' status, so attribute will be shared again */ @@ -1351,22 +1354,22 @@ H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) /* Find out whether the attribute has been opened */ if ((found_open_attr = H5O__attr_find_opened_attr(loc, &exist_attr, (atable.attrs[u])->shared->name)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "failed in finding opened attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "failed in finding opened attribute"); /* If found the attribute is already opened, use the opened message to insert. If not, still use the message in the attribute table. */ if (found_open_attr && exist_attr) { if (H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, exist_attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message"); } /* end if */ else if (H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, (atable.attrs[u])) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message"); } /* end for */ /* Remove the dense storage */ if (H5A__dense_delete(loc->file, ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete dense attribute storage") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete dense attribute storage"); } /* end if */ } /* end if */ @@ -1375,14 +1378,14 @@ H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) * accessed via fractal heap/v2 B-tree (HDFFV-9277) */ if (H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message"); /* Check if we have deleted all the attributes and the attribute info * message should be deleted itself. */ if (ainfo->nattrs == 0) { if (H5O__msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute info") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute info"); } /* end if */ done: @@ -1421,7 +1424,7 @@ H5O__attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNU if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Convert message into a null message (i.e. delete it) */ if (H5O__release_mesg(udata->f, oh, mesg, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message"); /* Indicate that the object header was modified */ *oh_modified = H5O_MODIFY_CONDENSE; @@ -1462,21 +1465,21 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header"); /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if (oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ if ((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); } /* end if */ /* Check for attributes stored densely */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Delete attribute from dense storage */ if (H5A__dense_remove(loc->file, &ainfo, name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage"); } /* end if */ else { H5O_iter_rm_t udata; /* User data for callback */ @@ -1491,21 +1494,21 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__attr_remove_cb; if (H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute"); /* Check that we found the attribute */ if (!udata.found) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute") + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute"); } /* end else */ /* Update the attribute information after removing an attribute */ if (ainfo_exists) if (H5O__attr_remove_update(loc, oh, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info"); /* Update the modification time, if any */ if (H5O_touch_oh(loc->file, oh, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: if (oh && H5O_unpin(oh) < 0) @@ -1540,21 +1543,21 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header"); /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if (oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ if ((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); } /* end if */ /* Check for attributes stored densely */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Delete attribute from dense storage */ if (H5A__dense_remove_by_idx(loc->file, &ainfo, idx_type, order, n) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage"); } /* end if */ else { H5O_iter_rm_t udata; /* User data for callback */ @@ -1562,11 +1565,11 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order /* Build table of attributes for compact storage */ if (H5A__compact_build_table(loc->file, oh, idx_type, order, &atable) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table"); /* Check for skipping too many attributes */ if (n >= atable.nattrs) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified"); /* Set up user data for callback, to remove the attribute by name */ udata.f = loc->file; @@ -1577,21 +1580,21 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__attr_remove_cb; if (H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute"); /* Check that we found the attribute */ if (!udata.found) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute") + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute"); } /* end else */ /* Update the attribute information after removing an attribute */ if (ainfo_exists) if (H5O__attr_remove_update(loc, oh, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info"); /* Update the modification time, if any */ if (H5O_touch_oh(loc->file, oh, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") + HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object"); done: if (oh && H5O_unpin(oh) < 0) @@ -1630,7 +1633,7 @@ H5O__attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) /* Attempt to get the attribute information from the object header */ if ((ainfo_exists = H5A__get_ainfo(f, oh, &ainfo)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); else if (ainfo_exists > 0) *nattrs = ainfo.nattrs; else @@ -1712,21 +1715,21 @@ H5O__attr_exists(const H5O_loc_t *loc, const char *name, hbool_t *attr_exists) /* Protect the object header to iterate over */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header"); /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if (oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ if (H5A__get_ainfo(loc->file, oh, &ainfo) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); } /* end if */ /* Check for attributes stored densely */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Check if attribute exists in dense storage */ if (H5A__dense_exists(loc->file, &ainfo, name, attr_exists) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute"); } /* end if */ else { H5O_iter_xst_t udata; /* User data for callback */ @@ -1740,7 +1743,7 @@ H5O__attr_exists(const H5O_loc_t *loc, const char *name, hbool_t *attr_exists) op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__attr_exists_cb; if (H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute"); } /* end else */ done: @@ -1780,17 +1783,17 @@ H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info) /* Check for (& retrieve if available) attribute info */ if ((ainfo_exists = H5A__get_ainfo(f, oh, &ainfo)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message"); else if (ainfo_exists > 0) { /* Check if name index available */ if (H5_addr_defined(ainfo.name_bt2_addr)) { /* Open the name index v2 B-tree */ if (NULL == (bt2_name = H5B2_open(f, ainfo.name_bt2_addr, NULL))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index"); /* Get name index B-tree size */ if (H5B2_size(bt2_name, &(bh_info->index_size)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info"); } /* end if */ /* Check if creation order index available */ @@ -1798,22 +1801,22 @@ H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info) /* Open the creation order index v2 B-tree */ if (NULL == (bt2_corder = H5B2_open(f, ainfo.corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, - "unable to open v2 B-tree for creation order index") + "unable to open v2 B-tree for creation order index"); /* Get creation order index B-tree size */ if (H5B2_size(bt2_corder, &(bh_info->index_size)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info"); } /* end if */ /* Get storage size of fractal heap, if it's used */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Open the fractal heap for attributes */ if (NULL == (fheap = H5HF_open(f, ainfo.fheap_addr))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap"); /* Get heap storage size */ if (H5HF_size(fheap, &(bh_info->heap_size)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info"); } /* end if */ } /* end else */ } /* end if */ |