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/H5VLnative_link.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/H5VLnative_link.c')
-rw-r--r-- | src/H5VLnative_link.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c index 4d6d3a8..342d65d 100644 --- a/src/H5VLnative_link.c +++ b/src/H5VLnative_link.c @@ -84,9 +84,9 @@ H5VL__native_link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_lo H5VL_loc_params_t *cur_params = &args->args.hard.curr_loc_params; if (NULL != cur_obj && H5G_loc_real(cur_obj, cur_params->obj_type, &cur_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); if (NULL != obj && H5G_loc_real(obj, loc_params->obj_type, &link_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* H5Lcreate_hard */ if (H5VL_OBJECT_BY_NAME == cur_params->type) { @@ -101,17 +101,17 @@ H5VL__native_link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_lo link_loc_p = cur_loc_p; else if (cur_loc_p->oloc->file != link_loc_p->oloc->file) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "source and destination should be in the same file.") + "source and destination should be in the same file."); /* Create the link */ if (H5L__create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, link_loc_p, loc_params->loc_data.loc_by_name.name, lcpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link"); } /* end if */ else { /* H5Olink */ /* Link to the object */ if (H5L_link(&link_loc, loc_params->loc_data.loc_by_name.name, &cur_loc, lcpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link"); } /* end else */ break; @@ -121,10 +121,10 @@ H5VL__native_link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_lo H5G_loc_t link_loc; /* Group location for new link */ if (H5G_loc_real(obj, loc_params->obj_type, &link_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); if (H5L__create_soft(args->args.soft.target, &link_loc, loc_params->loc_data.loc_by_name.name, lcpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link"); break; } @@ -133,16 +133,16 @@ H5VL__native_link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_lo H5G_loc_t link_loc; /* Group location for new link */ if (H5G_loc_real(obj, loc_params->obj_type, &link_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); if (H5L__create_ud(&link_loc, loc_params->loc_data.loc_by_name.name, args->args.ud.buf, args->args.ud.buf_size, args->args.ud.type, lcpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link"); break; } default: - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "invalid link creation call") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "invalid link creation call"); } /* end switch */ done: @@ -170,9 +170,9 @@ H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void FUNC_ENTER_PACKAGE if (NULL != src_obj && H5G_loc_real(src_obj, loc_params1->obj_type, &src_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); if (NULL != dst_obj && H5G_loc_real(dst_obj, loc_params2->obj_type, &dst_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -185,7 +185,7 @@ H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void /* Copy the link */ if (H5L__move(src_loc_p, loc_params1->loc_data.loc_by_name.name, dst_loc_p, loc_params2->loc_data.loc_by_name.name, TRUE, lcpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -212,9 +212,9 @@ H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void FUNC_ENTER_PACKAGE if (NULL != src_obj && H5G_loc_real(src_obj, loc_params1->obj_type, &src_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); if (NULL != dst_obj && H5G_loc_real(dst_obj, loc_params2->obj_type, &dst_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -227,7 +227,7 @@ H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void /* Move the link */ if (H5L__move(src_loc_p, loc_params1->loc_data.loc_by_name.name, dst_loc_p, loc_params2->loc_data.loc_by_name.name, FALSE, lcpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") + HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -252,7 +252,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ FUNC_ENTER_PACKAGE if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); switch (args->op_type) { /* H5Lget_info/H5Lget_info_by_idx */ @@ -260,17 +260,17 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ /* Get the link information */ if (loc_params->type == H5VL_OBJECT_BY_NAME) { if (H5L_get_info(&loc, loc_params->loc_data.loc_by_name.name, args->args.get_info.linfo) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info"); } /* end if */ else if (loc_params->type == H5VL_OBJECT_BY_IDX) { if (H5L__get_info_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, args->args.get_info.linfo) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info"); } /* end else-if */ else - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info"); break; } @@ -282,7 +282,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, args->args.get_name.name, args->args.get_name.name_size, args->args.get_name.name_len) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info"); break; } @@ -293,23 +293,23 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ if (loc_params->type == H5VL_OBJECT_BY_NAME) { if (H5L__get_val(&loc, loc_params->loc_data.loc_by_name.name, args->args.get_val.buf, args->args.get_val.buf_size) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link value") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link value"); } else if (loc_params->type == H5VL_OBJECT_BY_IDX) { if (H5L__get_val_by_idx( &loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, args->args.get_val.buf, args->args.get_val.buf_size) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val"); } else - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val"); break; } default: - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from link") + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from link"); } /* end switch */ done: @@ -338,9 +338,9 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ H5G_loc_t loc; if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); if (H5L__exists(&loc, loc_params->loc_data.loc_by_name.name, args->args.exists.exists) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to specific link info") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to specific link info"); break; } @@ -351,7 +351,7 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ /* Get the location */ if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); /* Visit or iterate over the links */ if (loc_params->type == H5VL_OBJECT_BY_SELF) { @@ -359,13 +359,13 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ /* H5Lvisit */ if ((ret_value = H5G_visit(&loc, ".", iter_args->idx_type, iter_args->order, iter_args->op, iter_args->op_data)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed"); } /* end if */ else { /* H5Literate */ if ((ret_value = H5L_iterate(&loc, ".", iter_args->idx_type, iter_args->order, iter_args->idx_p, iter_args->op, iter_args->op_data)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "error iterating over links") + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "error iterating over links"); } /* end else */ } /* end if */ else if (loc_params->type == H5VL_OBJECT_BY_NAME) { @@ -374,18 +374,18 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ if ((ret_value = H5G_visit(&loc, loc_params->loc_data.loc_by_name.name, iter_args->idx_type, iter_args->order, iter_args->op, iter_args->op_data)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed"); } /* end if */ else { /* H5Literate_by_name */ if ((ret_value = H5L_iterate(&loc, loc_params->loc_data.loc_by_name.name, iter_args->idx_type, iter_args->order, iter_args->idx_p, iter_args->op, iter_args->op_data)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "error iterating over links") + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "error iterating over links"); } /* end else */ } /* end else-if */ else - HGOTO_ERROR(H5E_LINK, H5E_UNSUPPORTED, FAIL, "unknown link iterate params") + HGOTO_ERROR(H5E_LINK, H5E_UNSUPPORTED, FAIL, "unknown link iterate params"); break; } @@ -394,26 +394,26 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ H5G_loc_t loc; if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object"); /* Unlink */ if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Ldelete */ if (H5L__delete(&loc, loc_params->loc_data.loc_by_name.name) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link"); } /* end if */ else if (loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Ldelete_by_idx */ if (H5L__delete_by_idx( &loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link"); } /* end else-if */ else - HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link"); break; } default: - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation"); } /* end switch */ done: |