diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-08-03 12:57:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-03 12:57:29 (GMT) |
commit | 7fc8531b767855e69fb4016783a1131ba581fd5b (patch) | |
tree | a243310b99da59c858ae4eaeed8c452e0177bba4 /src/H5Rint.c | |
parent | a77d8bfcd7d066c6759b0346c02cbd612f90b7c2 (diff) | |
download | hdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.zip hdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.tar.gz hdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.tar.bz2 |
Merge Made HGOTO_ERROR a do-while loop changes from develop (#3334)
Diffstat (limited to 'src/H5Rint.c')
-rw-r--r-- | src/H5Rint.c | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/src/H5Rint.c b/src/H5Rint.c index 99278a2..1e4b57e 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -46,7 +46,7 @@ do { \ size_t __nalloc = buf_size; \ if (func(val, buf, &__nalloc) < 0) \ - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, m) \ + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, m); \ if (buf && buf_size >= __nalloc) { \ buf += __nalloc; \ buf_size -= __nalloc; \ @@ -58,7 +58,7 @@ do { \ size_t __nalloc = buf_size; \ if (func(var, size, buf, &__nalloc) < 0) \ - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, m) \ + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, m); \ if (buf && buf_size >= __nalloc) { \ p += __nalloc; \ buf_size -= __nalloc; \ @@ -71,7 +71,7 @@ do { \ size_t __nbytes = buf_size; \ if (func(buf, &__nbytes, val) < 0) \ - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, m) \ + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, m); \ buf += __nbytes; \ buf_size -= __nbytes; \ actual += __nbytes; \ @@ -81,7 +81,7 @@ do { \ size_t __nbytes = buf_size; \ if (func(buf, &__nbytes, var, size) < 0) \ - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, m) \ + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, m); \ p += __nbytes; \ buf_size -= __nbytes; \ actual += __nbytes; \ @@ -194,11 +194,11 @@ H5R__create_object(const H5O_token_t *obj_token, size_t token_size, H5R_ref_priv ref->loc_id = H5I_INVALID_HID; ref->type = (uint8_t)H5R_OBJECT2; if (H5R__set_obj_token(ref, obj_token, token_size) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to set object token") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to set object token"); /* Cache encoding size (assume no external reference) */ if (H5R__encode(NULL, ref, NULL, &encode_size, 0) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "unable to determine encoding size") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "unable to determine encoding size"); ref->encode_size = (uint32_t)encode_size; H5R_LOG_DEBUG("Created object reference, %d, filename=%s, obj_addr=%s, encode size=%u", @@ -232,16 +232,16 @@ H5R__create_region(const H5O_token_t *obj_token, size_t token_size, H5S_t *space /* Create new reference */ ref->info.obj.filename = NULL; if (NULL == (ref->info.reg.space = H5S_copy(space, FALSE, TRUE))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy dataspace") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy dataspace"); ref->loc_id = H5I_INVALID_HID; ref->type = (uint8_t)H5R_DATASET_REGION2; if (H5R__set_obj_token(ref, obj_token, token_size) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to set object token") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to set object token"); /* Cache encoding size (assume no external reference) */ if (H5R__encode(NULL, ref, NULL, &encode_size, 0) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "unable to determine encoding size") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "unable to determine encoding size"); ref->encode_size = (uint32_t)encode_size; H5R_LOG_DEBUG("Created region reference, %d, filename=%s, obj_addr=%s, encode size=%u", @@ -281,21 +281,21 @@ H5R__create_attr(const H5O_token_t *obj_token, size_t token_size, const char *at /* Make sure that attribute name is not longer than supported encode size */ if (HDstrlen(attr_name) > H5R_MAX_STRING_LEN) HGOTO_ERROR(H5E_REFERENCE, H5E_ARGS, FAIL, "attribute name too long (%d > %d)", - (int)HDstrlen(attr_name), H5R_MAX_STRING_LEN) + (int)HDstrlen(attr_name), H5R_MAX_STRING_LEN); /* Create new reference */ ref->info.obj.filename = NULL; if (NULL == (ref->info.attr.name = HDstrdup(attr_name))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Cannot copy attribute name") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Cannot copy attribute name"); ref->loc_id = H5I_INVALID_HID; ref->type = (uint8_t)H5R_ATTR; if (H5R__set_obj_token(ref, obj_token, token_size) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to set object token") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to set object token"); /* Cache encoding size (assume no external reference) */ if (H5R__encode(NULL, ref, NULL, &encode_size, 0) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "unable to determine encoding size") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "unable to determine encoding size"); ref->encode_size = (uint32_t)encode_size; H5R_LOG_DEBUG("Created attribute reference, %d, filename=%s, obj_addr=%s, attr name=%s, encode size=%u", @@ -341,7 +341,7 @@ H5R__destroy(H5R_ref_priv_t *ref) case H5R_DATASET_REGION2: if (H5S_close(ref->info.reg.space) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTFREE, FAIL, "Cannot close dataspace") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTFREE, FAIL, "Cannot close dataspace"); ref->info.reg.space = NULL; break; @@ -356,22 +356,22 @@ H5R__destroy(H5R_ref_priv_t *ref) case H5R_BADTYPE: case H5R_MAXTYPE: assert("invalid reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)"); default: assert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)"); } /* end switch */ /* Decrement refcount of attached loc_id */ if (ref->type && (ref->loc_id != H5I_INVALID_HID)) { if (ref->app_ref) { if (H5I_dec_app_ref(ref->loc_id) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed"); } else { if (H5I_dec_ref(ref->loc_id) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed"); } } @@ -403,11 +403,11 @@ H5R__set_loc_id(H5R_ref_priv_t *ref, hid_t id, hbool_t inc_ref, hbool_t app_ref) if ((ref->loc_id != H5I_INVALID_HID)) { if (ref->app_ref) { if (H5I_dec_app_ref(ref->loc_id) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed"); } else { if (H5I_dec_ref(ref->loc_id) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed"); } } ref->loc_id = id; @@ -417,7 +417,7 @@ H5R__set_loc_id(H5R_ref_priv_t *ref, hid_t id, hbool_t inc_ref, hbool_t app_ref) * expected to be destroyed, this allows the loc_id to be cleanly released * on shutdown if users fail to call H5Rdestroy(). */ if (inc_ref && H5I_inc_ref(ref->loc_id, app_ref) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINC, FAIL, "incrementing location ID failed") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINC, FAIL, "incrementing location ID failed"); ref->app_ref = app_ref; done: @@ -472,39 +472,39 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id) /* Verify access property list and set up collective metadata if appropriate */ if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info"); /* Get the VOL info from the fapl */ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a file access property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a file access property list"); if (H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL connector info") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL connector info"); /* Stash a copy of the "top-level" connector property, before any pass-through * connectors modify or unwrap it. */ if (H5CX_set_vol_connector_prop(&connector_prop) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, - "can't set VOL connector info in API context") + "can't set VOL connector info in API context"); /* Open the file */ /* (Must open file read-write to allow for object modifications) */ if (NULL == (new_file = H5VL_file_open(&connector_prop, H5R_REF_FILENAME(ref), H5F_ACC_RDWR, fapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file"); /* Get an ID for the file */ if ((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle"); /* Get the file object */ if (NULL == (vol_obj = H5VL_vol_object(ret_value))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "invalid object identifier") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "invalid object identifier"); /* Make the 'post open' callback */ supported = 0; if (H5VL_introspect_opt_query(vol_obj, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "can't check for 'post open' operation") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "can't check for 'post open' operation"); if (supported & H5VL_OPT_QUERY_SUPPORTED) { H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */ @@ -515,12 +515,12 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id) /* Make the 'post open' callback */ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5I_INVALID_HID, - "unable to make file 'post open' callback") + "unable to make file 'post open' callback"); } /* end if */ /* Attach loc_id to reference */ if (H5R__set_loc_id((H5R_ref_priv_t *)ref, ret_value, FALSE, TRUE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "unable to attach location id to reference") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "unable to attach location id to reference"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -591,7 +591,7 @@ H5R__equal(const H5R_ref_priv_t *ref1, const H5R_ref_priv_t *ref2) break; case H5R_DATASET_REGION2: if ((ret_value = H5S_extent_equal(ref1->info.reg.space, ref2->info.reg.space)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOMPARE, FAIL, "cannot compare dataspace extents") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOMPARE, FAIL, "cannot compare dataspace extents"); break; case H5R_ATTR: assert(ref1->info.attr.name && ref2->info.attr.name); @@ -603,10 +603,10 @@ H5R__equal(const H5R_ref_priv_t *ref1, const H5R_ref_priv_t *ref2) case H5R_BADTYPE: case H5R_MAXTYPE: assert("invalid reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)"); default: assert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)"); } /* end switch */ done: @@ -641,21 +641,21 @@ H5R__copy(const H5R_ref_priv_t *src_ref, H5R_ref_priv_t *dst_ref) break; case H5R_DATASET_REGION2: if (NULL == (dst_ref->info.reg.space = H5S_copy(src_ref->info.reg.space, FALSE, TRUE))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy dataspace") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy dataspace"); break; case H5R_ATTR: if (NULL == (dst_ref->info.attr.name = HDstrdup(src_ref->info.attr.name))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Cannot copy attribute name") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Cannot copy attribute name"); break; case H5R_OBJECT1: case H5R_DATASET_REGION1: assert("invalid reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)"); case H5R_BADTYPE: case H5R_MAXTYPE: default: assert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)"); } /* end switch */ /* We only need to keep a copy of the filename if we don't have the loc_id */ @@ -663,7 +663,7 @@ H5R__copy(const H5R_ref_priv_t *src_ref, H5R_ref_priv_t *dst_ref) assert(src_ref->info.obj.filename); if (NULL == (dst_ref->info.obj.filename = HDstrdup(src_ref->info.obj.filename))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Cannot copy filename") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Cannot copy filename"); dst_ref->loc_id = H5I_INVALID_HID; } else { @@ -672,7 +672,7 @@ H5R__copy(const H5R_ref_priv_t *src_ref, H5R_ref_priv_t *dst_ref) /* Set location ID and hold reference to it */ dst_ref->loc_id = src_ref->loc_id; if (H5I_inc_ref(dst_ref->loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINC, FAIL, "incrementing location ID failed") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINC, FAIL, "incrementing location ID failed"); dst_ref->app_ref = TRUE; } @@ -701,7 +701,7 @@ H5R__get_obj_token(const H5R_ref_priv_t *ref, H5O_token_t *obj_token, size_t *to if (obj_token) { if (0 == ref->token_size) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "NULL token size") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "NULL token size"); H5MM_memcpy(obj_token, &ref->info.obj.token, sizeof(H5O_token_t)); } if (token_size) @@ -763,7 +763,7 @@ H5R__get_region(const H5R_ref_priv_t *ref, H5S_t *space) /* Copy reference selection to destination */ if (H5S_select_copy(space, ref->info.reg.space, FALSE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy selection") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "unable to copy selection"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -792,7 +792,7 @@ H5R__get_file_name(const H5R_ref_priv_t *ref, char *buf, size_t size) /* Return if that reference has no filename set */ if (!ref->info.obj.filename) - HGOTO_ERROR(H5E_REFERENCE, H5E_ARGS, (-1), "no filename available for that reference") + HGOTO_ERROR(H5E_REFERENCE, H5E_ARGS, (-1), "no filename available for that reference"); /* Get the file name length */ copy_len = HDstrlen(ref->info.obj.filename); @@ -930,11 +930,11 @@ H5R__encode(const char *filename, const H5R_ref_priv_t *ref, unsigned char *buf, case H5R_BADTYPE: case H5R_MAXTYPE: assert("invalid reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)"); default: assert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)"); } /* end switch */ H5R_LOG_DEBUG("Encoded reference, filename=%s, obj_addr=%s, encode size=%u", ref->info.obj.filename, @@ -973,12 +973,12 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref) /* Don't decode if buffer size isn't big enough */ buf_size = *nbytes; if (buf_size < H5R_ENCODE_HEADER_SIZE) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small"); /* Set new reference */ ref->type = (int8_t)*p++; if (ref->type <= H5R_BADTYPE || ref->type >= H5R_MAXTYPE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type"); /* Set flags */ flags = *p++; @@ -1017,10 +1017,10 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref) case H5R_BADTYPE: case H5R_MAXTYPE: assert("invalid reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)"); default: assert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)"); } /* end switch */ /* Set loc ID to invalid */ @@ -1096,12 +1096,12 @@ H5R__decode_obj_token(const unsigned char *buf, size_t *nbytes, H5O_token_t *obj /* Don't decode if buffer size isn't big enough */ if (*nbytes < sizeof(uint8_t)) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small"); /* Get token size */ *token_size = *p++; if (*token_size > sizeof(H5O_token_t)) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Invalid token size (%u)", *token_size) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Invalid token size (%u)", *token_size); /* Make sure that token is initialized */ memset(obj_token, 0, sizeof(H5O_token_t)); @@ -1139,7 +1139,7 @@ H5R__encode_region(H5S_t *space, unsigned char *buf, size_t *nalloc) /* Get the amount of space required to serialize the selection */ if ((buf_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, - "Cannot determine amount of space needed for serializing selection") + "Cannot determine amount of space needed for serializing selection"); /* Don't encode if buffer size isn't big enough or buffer is empty */ if (buf && *nalloc >= ((size_t)buf_size + 2 * sizeof(uint32_t))) { @@ -1151,12 +1151,12 @@ H5R__encode_region(H5S_t *space, unsigned char *buf, size_t *nalloc) /* Encode the extent rank */ if ((rank = H5S_get_simple_extent_ndims(space)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't get extent rank for selection") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't get extent rank for selection"); UINT32ENCODE(p, (uint32_t)rank); /* Serialize the selection */ if (H5S_SELECT_SERIALIZE(space, (unsigned char **)&p) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "can't serialize selection") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "can't serialize selection"); } /* end if */ *nalloc = (size_t)buf_size + 2 * sizeof(uint32_t); @@ -1191,7 +1191,7 @@ H5R__decode_region(const unsigned char *buf, size_t *nbytes, H5S_t **space_ptr) /* Don't decode if buffer size isn't big enough */ if (*nbytes < (2 * sizeof(uint32_t))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small"); /* Decode the selection size */ UINT32DECODE(p, buf_size); @@ -1203,19 +1203,19 @@ H5R__decode_region(const unsigned char *buf, size_t *nbytes, H5S_t **space_ptr) /* Don't decode if buffer size isn't big enough */ if (*nbytes < buf_size) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small"); /* Deserialize the selection (dataspaces need the extent rank information) */ if (NULL == (space = H5S_create(H5S_SIMPLE))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small"); if (H5S_set_extent_simple(space, rank, NULL, NULL) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set extent rank for selection") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set extent rank for selection"); if (p - 1 > p_end) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Ran off end of buffer while decoding") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Ran off end of buffer while decoding"); if (H5S_SELECT_DESERIALIZE(&space, &p, (size_t)(p_end - p + 1)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "can't deserialize selection") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "can't deserialize selection"); *nbytes = buf_size; *space_ptr = space; @@ -1247,7 +1247,7 @@ H5R__encode_string(const char *string, unsigned char *buf, size_t *nalloc) /* Get the amount of space required to serialize the string */ string_len = HDstrlen(string); if (string_len > H5R_MAX_STRING_LEN) - HGOTO_ERROR(H5E_REFERENCE, H5E_ARGS, FAIL, "string too long") + HGOTO_ERROR(H5E_REFERENCE, H5E_ARGS, FAIL, "string too long"); /* Compute buffer size, allow for the attribute name length and object address */ buf_size = string_len + sizeof(uint16_t); @@ -1290,7 +1290,7 @@ H5R__decode_string(const unsigned char *buf, size_t *nbytes, char **string_ptr) /* Don't decode if buffer size isn't big enough */ if (*nbytes < sizeof(uint16_t)) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small"); /* Get the string length */ UINT16DECODE(p, string_len); @@ -1298,7 +1298,7 @@ H5R__decode_string(const unsigned char *buf, size_t *nbytes, char **string_ptr) /* Allocate the string */ if (NULL == (string = (char *)H5MM_malloc(string_len + 1))) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTALLOC, FAIL, "Cannot allocate string") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTALLOC, FAIL, "Cannot allocate string"); /* Copy the string */ H5MM_memcpy(string, p, string_len); @@ -1338,7 +1338,7 @@ H5R__encode_heap(H5F_t *f, unsigned char *buf, size_t *nalloc, const unsigned ch /* Write the reference information to disk (allocates space also) */ if (H5HG_insert(f, data_size, data, &hobjid) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to write reference information") + HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to write reference information"); /* Encode the heap information */ H5F_addr_encode(f, &p, hobjid.addr); @@ -1378,17 +1378,17 @@ H5R__decode_heap(H5F_t *f, const unsigned char *buf, size_t *nbytes, unsigned ch buf_size = H5HG_HEAP_ID_SIZE(f); /* Don't decode if buffer size isn't big enough */ if (*nbytes < buf_size) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small"); /* Get the heap information */ H5F_addr_decode(f, &p, &(hobjid.addr)); if (!H5_addr_defined(hobjid.addr) || hobjid.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer"); UINT32DECODE(p, hobjid.idx); /* Read the information from disk */ if (NULL == (*data_ptr = (unsigned char *)H5HG_read(f, &hobjid, (void *)*data_ptr, data_size))) - HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read reference data") + HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read reference data"); *nbytes = buf_size; @@ -1450,7 +1450,7 @@ H5R__decode_token_obj_compat(const unsigned char *buf, size_t *nbytes, H5O_token /* Don't decode if buffer size isn't big enough */ if (*nbytes < token_size) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small"); H5MM_memcpy(obj_token, buf, token_size); @@ -1491,7 +1491,7 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf, size_t *nbyt /* Read from heap */ if (H5R__decode_heap(f, buf, nbytes, &data, &data_size) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier"); /* Get object address */ p = (const uint8_t *)data; @@ -1508,19 +1508,19 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf, size_t *nbyt if (H5VL_native_token_to_addr(f, H5I_FILE, token, &oloc.addr) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTUNSERIALIZE, FAIL, - "can't deserialize object token into address") + "can't deserialize object token into address"); /* Open and copy the dataset's dataspace */ if (NULL == (space = H5S_read(&oloc))) - HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "not found") + HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "not found"); /* Unserialize the selection */ if (p - 1 >= p_end) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Ran off end of buffer while deserializing") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Ran off end of buffer while deserializing"); if (H5S_SELECT_DESERIALIZE(&space, &p, (size_t)(p_end - p + 1)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "can't deserialize selection") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "can't deserialize selection"); *space_ptr = space; } |