summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2023-08-02 13:39:15 (GMT)
committerGitHub <noreply@github.com>2023-08-02 13:39:15 (GMT)
commit2b0badb90e4e516d0758efbd8ec96449188c7249 (patch)
tree074e38039b95ca7121a0117069974eff52a04519 /src/H5S.c
parent56451503c55ef6e5f67fc3bb710f9e5b649b1af2 (diff)
downloadhdf5-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/H5S.c')
-rw-r--r--src/H5S.c172
1 files changed, 86 insertions, 86 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 2edff6d..1050e03 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -111,12 +111,12 @@ H5S_init(void)
/* Initialize the ID group for the dataspace IDs */
if (H5I_register_type(H5I_DATASPACE_CLS) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace ID class")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace ID class");
/* Initialize the ID group for the dataspace selection iterator IDs */
if (H5I_register_type(H5I_SPACE_SEL_ITER_CLS) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL,
- "unable to initialize dataspace selection iterator ID class")
+ "unable to initialize dataspace selection iterator ID class");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -255,7 +255,7 @@ H5S_create(H5S_class_t type)
/* Create a new dataspace */
if (NULL == (new_ds = H5FL_CALLOC(H5S_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
/* Initialize default dataspace state */
new_ds->extent.type = type;
@@ -284,14 +284,14 @@ H5S_create(H5S_class_t type)
/* Start with "all" selection */
if (H5S_select_all(new_ds, FALSE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection");
/* Reset common selection info pointer */
new_ds->select.sel_info.hslab = NULL;
/* Reset "shared" info on extent */
if (H5O_msg_reset_share(H5O_SDSPACE_ID, &(new_ds->extent.sh_loc)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, NULL, "unable to reset shared component info")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, NULL, "unable to reset shared component info");
/* Set return value */
ret_value = new_ds;
@@ -333,14 +333,14 @@ H5Screate(H5S_class_t type)
/* Check args */
if (type <= H5S_NO_CLASS || type > H5S_NULL) /* don't allow complex dataspace yet */
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dataspace type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dataspace type");
if (NULL == (new_ds = H5S_create(type)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create dataspace");
/* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, new_ds, TRUE)) < 0)
- HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID");
done:
if (ret_value < 0)
@@ -400,11 +400,11 @@ H5S_close(H5S_t *ds)
/* Release selection (this should come before the extent release) */
if (H5S_SELECT_RELEASE(ds) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace selection");
/* Release extent */
if (H5S__extent_release(&ds->extent) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace extent")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace extent");
done:
/* Release the main structure.
@@ -436,11 +436,11 @@ H5Sclose(hid_t space_id)
/* Check args */
if (NULL == H5I_object_verify(space_id, H5I_DATASPACE))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
/* When the reference count reaches zero the resources are freed */
if (H5I_dec_app_ref(space_id) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDEC, FAIL, "problem freeing id")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDEC, FAIL, "problem freeing id");
done:
FUNC_LEAVE_API(ret_value)
@@ -469,15 +469,15 @@ H5Scopy(hid_t space_id)
/* Check args */
if (NULL == (src = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataspace");
/* Copy */
if (NULL == (dst = H5S_copy(src, FALSE, TRUE)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace");
/* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, dst, TRUE)) < 0)
- HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID");
done:
if (ret_value < 0)
@@ -508,13 +508,13 @@ H5Sextent_copy(hid_t dst_id, hid_t src_id)
/* Check args */
if (NULL == (src = (H5S_t *)H5I_object_verify(src_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
if (NULL == (dst = (H5S_t *)H5I_object_verify(dst_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
/* Copy */
if (H5S_extent_copy(dst, src) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent");
done:
FUNC_LEAVE_API(ret_value)
@@ -541,13 +541,13 @@ H5S_extent_copy(H5S_t *dst, const H5S_t *src)
/* Copy extent */
if (H5S__extent_copy_real(&(dst->extent), &(src->extent), TRUE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent");
/* If the selection is 'all', update the number of elements selected in the
* destination space */
if (H5S_SEL_ALL == H5S_GET_SELECT_TYPE(dst))
if (H5S_select_all(dst, FALSE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -572,7 +572,7 @@ H5S__extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_m
/* Release destination extent before we copy over it */
if (H5S__extent_release(dst) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace extent")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace extent");
/* Copy the regular fields */
dst->type = src->type;
@@ -612,7 +612,7 @@ H5S__extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_m
/* Copy the shared object info */
if (H5O_set_shared(&(dst->sh_loc), &(src->sh_loc)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy shared information")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy shared information");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -643,15 +643,15 @@ H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max)
FUNC_ENTER_NOAPI(NULL)
if (NULL == (dst = H5FL_CALLOC(H5S_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
/* Copy the source dataspace's extent */
if (H5S__extent_copy_real(&(dst->extent), &(src->extent), copy_max) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy extent")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy extent");
/* Copy the source dataspace's selection */
if (H5S_select_copy(dst, src, share_selection) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy select")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy select");
/* Set the return value */
ret_value = dst;
@@ -716,7 +716,7 @@ H5Sget_simple_extent_npoints(hid_t space_id)
/* Check args */
if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
ret_value = (hssize_t)H5S_GET_EXTENT_NPOINTS(ds);
@@ -778,7 +778,7 @@ H5S_get_npoints_max(const H5S_t *ds)
case H5S_NO_CLASS:
default:
assert("unknown dataspace class" && 0);
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)");
}
done:
@@ -806,7 +806,7 @@ H5Sget_simple_extent_ndims(hid_t space_id)
/* Check args */
if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a dataspace");
ret_value = (int)H5S_GET_EXTENT_NDIMS(ds);
@@ -850,7 +850,7 @@ H5S_get_simple_extent_ndims(const H5S_t *ds)
case H5S_NO_CLASS:
default:
assert("unknown dataspace class" && 0);
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)");
} /* end switch */
done:
@@ -881,7 +881,7 @@ H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[] /*out*/, hsize_t maxdim
/* Check args */
if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a dataspace");
ret_value = H5S_get_simple_extent_dims(ds, dims, maxdims);
@@ -934,7 +934,7 @@ H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[])
case H5S_NO_CLASS:
default:
assert("unknown dataspace class" && 0);
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)");
} /* end switch */
done:
@@ -964,7 +964,7 @@ H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[])
/* Get dims for extent */
if ((ret_value = H5S_extent_get_dims(&ds->extent, dims, max_dims)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -994,7 +994,7 @@ H5S_write(H5F_t *f, H5O_t *oh, unsigned update_flags, H5S_t *ds)
/* Write the current dataspace extent to the dataspace message */
if (H5O_msg_write_oh(f, oh, H5O_SDSPACE_ID, 0, update_flags, &(ds->extent)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1023,7 +1023,7 @@ H5S_append(H5F_t *f, H5O_t *oh, H5S_t *ds)
/* Add the dataspace message to the object header */
if (H5O_msg_append_oh(f, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't add simple dataspace message")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't add simple dataspace message");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1052,14 +1052,14 @@ H5S_read(const H5O_loc_t *loc)
assert(loc);
if (NULL == (ds = H5FL_CALLOC(H5S_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
if (NULL == H5O_msg_read(loc, H5O_SDSPACE_ID, &(ds->extent)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to load dataspace info from dataset header")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to load dataspace info from dataset header");
/* Default to entire dataspace being selected */
if (H5S_select_all(ds, FALSE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection");
/* Set the value for successful return */
ret_value = ds;
@@ -1128,7 +1128,7 @@ H5Sis_simple(hid_t space_id)
/* Check args and all the boring stuff. */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace");
ret_value = H5S__is_simple(space);
@@ -1174,28 +1174,28 @@ H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], con
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace");
if (rank > 0 && dims == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified");
if (rank < 0 || rank > H5S_MAX_RANK)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid rank")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid rank");
if (dims)
for (u = 0; u < rank; u++)
if (H5S_UNLIMITED == dims[u])
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "current dimension must have a specific size, not H5S_UNLIMITED")
+ "current dimension must have a specific size, not H5S_UNLIMITED");
if (max != NULL) {
if (dims == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "maximum dimension specified, but no current dimensions specified")
+ "maximum dimension specified, but no current dimensions specified");
for (u = 0; u < rank; u++)
if (max[u] != H5S_UNLIMITED && max[u] < dims[u])
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid maximum dimension size")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid maximum dimension size");
}
/* Do it */
if (H5S_set_extent_simple(space, (unsigned)rank, dims, max) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set simple extent")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set simple extent");
done:
FUNC_LEAVE_API(ret_value)
@@ -1223,7 +1223,7 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, const hs
/* shift out of the previous state to a "simple" dataspace. */
if (H5S__extent_release(&space->extent) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "failed to release previous dataspace extent")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "failed to release previous dataspace extent");
if (rank == 0) { /* scalar variable */
space->extent.type = H5S_SCALAR;
@@ -1265,7 +1265,7 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, const hs
/* If the selection is 'all', update the number of elements selected */
if (H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL)
if (H5S_select_all(space, FALSE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1301,32 +1301,32 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/
/* Check arguments */
if (rank < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "dimensionality cannot be negative")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "dimensionality cannot be negative");
if (rank > H5S_MAX_RANK)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "dimensionality is too large")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "dimensionality is too large");
/* We allow users to use this function to create scalar or null dataspace.
* Check DIMS isn't set when the RANK is 0.
*/
if (!dims && rank != 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dataspace information")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dataspace information");
/* Check whether the current dimensions are valid */
for (i = 0; i < rank; i++) {
if (H5S_UNLIMITED == dims[i])
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID,
- "current dimension must have a specific size, not H5S_UNLIMITED")
+ "current dimension must have a specific size, not H5S_UNLIMITED");
if (maxdims && H5S_UNLIMITED != maxdims[i] && maxdims[i] < dims[i])
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "maxdims is smaller than dims")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "maxdims is smaller than dims");
} /* end for */
/* Create the space and set the extent */
if (NULL == (space = H5S_create_simple((unsigned)rank, dims, maxdims)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, H5I_INVALID_HID, "can't create simple dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, H5I_INVALID_HID, "can't create simple dataspace");
/* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID");
done:
if (ret_value < 0)
@@ -1358,9 +1358,9 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], const hsize_t max
/* Create the space and set the extent */
if (NULL == (ret_value = H5S_create(H5S_SIMPLE)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace");
if (H5S_set_extent_simple(ret_value, rank, dims, maxdims) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "can't set dimensions")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "can't set dimensions");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1390,14 +1390,14 @@ H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl_id)
/* Check argument and retrieve object */
if (NULL == (dspace = (H5S_t *)H5I_object_verify(obj_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
/* 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_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info");
if (H5S_encode(dspace, (unsigned char **)&buf, nalloc) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace");
done:
FUNC_LEAVE_API(ret_value)
@@ -1427,15 +1427,15 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc)
/* Allocate "fake" file structure */
if (NULL == (f = H5F_fake_alloc((uint8_t)0)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct");
/* Find out the size of buffer needed for extent */
if ((extent_size = H5O_msg_raw_size(f, H5O_SDSPACE_ID, TRUE, obj)) == 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace size")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace size");
/* Find out the size of buffer needed for selection */
if ((sselect_size = H5S_SELECT_SERIAL_SIZE(obj)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace selection size")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace selection size");
H5_CHECKED_ASSIGN(select_size, size_t, sselect_size, hssize_t);
/* Verify the size of buffer. If it's not big enough, simply return the
@@ -1459,13 +1459,13 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc)
/* Encode the extent part of dataspace */
if (H5O_msg_encode(f, H5O_SDSPACE_ID, TRUE, pp, obj) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode extent space")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode extent space");
pp += extent_size;
/* Encode the selection part of dataspace. */
*p = pp;
if (H5S_SELECT_SERIALIZE(obj, p) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode select space")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode select space");
} /* end else */
done:
@@ -1498,14 +1498,14 @@ H5Sdecode(const void *buf)
H5TRACE1("i", "*x", buf);
if (buf == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "empty buffer")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "empty buffer");
if ((ds = H5S_decode((const unsigned char **)&buf)) == NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, H5I_INVALID_HID, "can't decode object")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, H5I_INVALID_HID, "can't decode object");
/* Register the type and return the ID */
if ((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace");
done:
FUNC_LEAVE_API(ret_value)
@@ -1538,18 +1538,18 @@ H5S_decode(const unsigned char **p)
/* Decode the type of the information */
if (*pp++ != H5O_SDSPACE_ID)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADMESG, NULL, "not an encoded dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADMESG, NULL, "not an encoded dataspace");
/* Decode the version of the dataspace information */
if (*pp++ != H5S_ENCODE_VERSION)
- HGOTO_ERROR(H5E_DATASPACE, H5E_VERSION, NULL, "unknown version of encoded dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_VERSION, NULL, "unknown version of encoded dataspace");
/* Decode the "size of size" information */
sizeof_size = *pp++;
/* Allocate "fake" file structure */
if (NULL == (f = H5F_fake_alloc(sizeof_size)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate fake file struct")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate fake file struct");
/* Decode size of extent information */
UINT32DECODE(pp, extent_size);
@@ -1557,28 +1557,28 @@ H5S_decode(const unsigned char **p)
/* Decode the extent part of dataspace */
/* (pass mostly bogus file pointer and bogus DXPL) */
if (NULL == (extent = (H5S_extent_t *)H5O_msg_decode(f, NULL, H5O_SDSPACE_ID, extent_size, pp)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object");
pp += extent_size;
/* Copy the extent into dataspace structure */
if (NULL == (ds = H5FL_CALLOC(H5S_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "memory allocation failed for dataspace conversion path table")
+ "memory allocation failed for dataspace conversion path table");
if (NULL == H5O_msg_copy(H5O_SDSPACE_ID, extent, &(ds->extent)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy object")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy object");
if (H5S__extent_release(extent) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTDELETE, NULL, "can't release previous dataspace")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTDELETE, NULL, "can't release previous dataspace");
extent = H5FL_FREE(H5S_extent_t, extent);
/* Initialize to "all" selection. Deserialization relies on valid existing selection. */
if (H5S_select_all(ds, FALSE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection");
/* Decode the select part of dataspace.
* Because size of buffer is unknown, assume arbitrarily large buffer to allow decoding. */
*p = pp;
if (H5S_SELECT_DESERIALIZE(&ds, p, SIZE_MAX) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode space selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode space selection");
/* Set return value */
ret_value = ds;
@@ -1642,7 +1642,7 @@ H5Sget_simple_extent_type(hid_t sid)
/* Check arguments */
if (NULL == (space = (H5S_t *)H5I_object_verify(sid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5S_NO_CLASS, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5S_NO_CLASS, "not a dataspace");
ret_value = H5S_GET_EXTENT_TYPE(space);
@@ -1675,11 +1675,11 @@ H5Sset_extent_none(hid_t space_id)
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace");
/* Clear the previous extent from the dataspace */
if (H5S__extent_release(&space->extent) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTDELETE, FAIL, "can't release previous dataspace")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTDELETE, FAIL, "can't release previous dataspace");
space->extent.type = H5S_NULL;
@@ -1715,7 +1715,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size)
if (space->extent.max && H5S_UNLIMITED != space->extent.max[u] && space->extent.max[u] < size[u])
HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL,
"dimension cannot exceed the existing maximal size (new: %llu max: %llu)",
- (unsigned long long)size[u], (unsigned long long)space->extent.max[u])
+ (unsigned long long)size[u], (unsigned long long)space->extent.max[u]);
/* Indicate that dimension size can be modified */
ret_value = TRUE;
@@ -1724,7 +1724,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size)
/* Update dimension size(s) */
if (ret_value)
if (H5S_set_extent_real(space, size) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "failed to change dimension size(s)")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "failed to change dimension size(s)");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1791,11 +1791,11 @@ H5S_set_extent_real(H5S_t *space, const hsize_t *size)
/* If the selection is 'all', update the number of elements selected */
if (H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space))
if (H5S_select_all(space, FALSE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection");
/* Mark the dataspace as no longer shared if it was before */
if (H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1825,11 +1825,11 @@ H5Sextent_equal(hid_t space1_id, hid_t space2_id)
/* check args */
if (NULL == (ds1 = (const H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE)) ||
NULL == (ds2 = (const H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
/* Check dataspaces for extent's equality */
if ((ret_value = H5S_extent_equal(ds1, ds2)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "dataspace comparison failed")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "dataspace comparison failed");
done:
FUNC_LEAVE_API(ret_value)
@@ -1942,7 +1942,7 @@ H5S_set_version(H5F_t *f, H5S_t *ds)
/* Version bounds check */
if (version > H5O_sdspace_ver_bounds[H5F_HIGH_BOUND(f)])
- HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "Dataspace version out of bounds")
+ HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "Dataspace version out of bounds");
/* Set the message version */
ds->extent.version = version;