summaryrefslogtreecommitdiffstats
path: root/src/H5Tcommit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Tcommit.c')
-rw-r--r--src/H5Tcommit.c199
1 files changed, 100 insertions, 99 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 160e45f..2973f5e 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -109,41 +109,41 @@ H5T__commit_api_common(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl
/* Check arguments */
if (!name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL");
if (!*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string");
if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype");
if (H5T_is_named(dt))
- HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed")
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed");
/* Get correct property list */
if (H5P_DEFAULT == lcpl_id)
lcpl_id = H5P_LINK_CREATE_DEFAULT;
else if (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list");
/* Get correct property list */
if (H5P_DEFAULT == tcpl_id)
tcpl_id = H5P_DATATYPE_CREATE_DEFAULT;
else if (TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list");
/* Set the LCPL for the API context */
H5CX_set_lcpl(lcpl_id);
/* Set up object access arguments */
if (H5VL_setup_acc_args(loc_id, H5P_CLS_TACC, TRUE, &tapl_id, vol_obj_ptr, &loc_params) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set object access arguments")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set object access arguments");
/* Commit the type */
if (NULL == (data = H5VL_datatype_commit(*vol_obj_ptr, &loc_params, name, type_id, lcpl_id, tcpl_id,
tapl_id, H5P_DATASET_XFER_DEFAULT, token_ptr)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype");
/* Set up VOL object */
if (NULL == (new_obj = H5VL_create_object(data, (*vol_obj_ptr)->connector)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't create VOL object for committed datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't create VOL object for committed datatype");
/* Set the committed type object to the VOL connector pointer in the H5T_t struct */
dt->vol_obj = new_obj;
@@ -173,7 +173,7 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, hid_t t
/* Commit the dataset synchronously */
if ((ret_value = H5T__commit_api_common(loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id, NULL, NULL)) <
0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to commit datatype synchronously")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to commit datatype synchronously");
done:
FUNC_LEAVE_API(ret_value)
@@ -208,7 +208,7 @@ H5Tcommit_async(const char *app_file, const char *app_func, unsigned app_line, h
/* Commit the datatype asynchronously */
if ((ret_value = H5T__commit_api_common(loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id, token_ptr,
&vol_obj)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to commit datatype asynchronously")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to commit datatype asynchronously");
/* If a token was created, add the token to the event set */
if (NULL != token)
@@ -216,7 +216,7 @@ H5Tcommit_async(const char *app_file, const char *app_func, unsigned app_line, h
if (H5ES_insert(es_id, vol_obj->connector, token,
H5ARG_TRACE10(__func__, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id, es_id)) < 0)
/* clang-format on */
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert token into event set")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert token into event set");
done:
FUNC_LEAVE_API(ret_value)
@@ -263,7 +263,7 @@ H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, hid_t lcpl_
/* Create the new named datatype and link it to its parent group */
if (H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create and link to named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create and link to named datatype");
assert(ocrt_info.new_obj);
done:
@@ -329,24 +329,24 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
/* Check arguments */
if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype");
if (H5T_is_named(type))
- HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed")
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed");
/* Get correct property list */
if (H5P_DEFAULT == tcpl_id)
tcpl_id = H5P_DATATYPE_CREATE_DEFAULT;
else if (TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list");
if (H5P_DEFAULT == tapl_id)
tapl_id = H5P_DATATYPE_ACCESS_DEFAULT;
else if (TRUE != H5P_isa_class(tapl_id, H5P_DATATYPE_ACCESS))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype access property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype access property list");
/* Verify access property list and set up collective metadata if appropriate */
if (H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info");
/* Fill in location struct fields */
loc_params.type = H5VL_OBJECT_BY_SELF;
@@ -354,16 +354,16 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
/* Get the file object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier");
/* Commit the datatype */
if (NULL == (dt = H5VL_datatype_commit(vol_obj, &loc_params, NULL, type_id, H5P_LINK_CREATE_DEFAULT,
tcpl_id, tapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype");
/* Setup VOL object */
if (NULL == (new_obj = H5VL_create_object(dt, vol_obj->connector)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't create VOL object for committed datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't create VOL object for committed datatype");
/* Set the committed type object to the VOL connector pointer in the H5T_t struct */
type->vol_obj = new_obj;
@@ -396,17 +396,17 @@ H5T__commit_anon(H5F_t *file, H5T_t *type, hid_t tcpl_id)
/* Commit the type */
if (H5T__commit(file, type, tcpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype");
/* Release the datatype's object header */
/* Get the new committed datatype's object location */
if (NULL == (oloc = H5T_oloc(type)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get object location of committed datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get object location of committed datatype");
/* Decrement refcount on committed datatype's object header in memory */
if (H5O_dec_rc_by_loc(oloc) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -439,7 +439,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id)
/* Check if we are allowed to write to this file */
if (0 == (H5F_INTENT(file) & H5F_ACC_RDWR))
- HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "no write intent on file")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "no write intent on file");
/*
* Check arguments. We cannot commit an immutable type because H5Tclose()
@@ -447,30 +447,30 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id)
* a named type should always succeed.
*/
if (H5T_STATE_NAMED == type->shared->state || H5T_STATE_OPEN == type->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed");
if (H5T_STATE_IMMUTABLE == type->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable");
/* Check for a "sensible" datatype to store on disk */
if (H5T_is_sensible(type) <= 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "datatype is not sensible")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "datatype is not sensible");
/* Mark datatype as being on disk now. This step changes the size of
* datatype as stored on disk.
*/
if (H5T_set_loc(type, H5F_VOL_OBJ(file), H5T_LOC_DISK) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk");
/* Reset datatype location and path */
if (H5O_loc_reset(&temp_oloc) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize location");
if (H5G_name_reset(&temp_path) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "unable to initialize path");
loc_init = TRUE;
/* Set the version for datatype */
if (H5T_set_version(file, type) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set version of datatype");
/* Calculate message size information, for creating object header */
dtype_size = H5O_msg_size_f(file, tcpl_id, H5O_DTYPE_ID, type, (size_t)0);
@@ -481,16 +481,16 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id)
* type message and then give the object header a name.
*/
if (H5O_create(file, dtype_size, (size_t)1, tcpl_id, &temp_oloc) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header");
if (H5O_msg_create(&temp_oloc, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE,
H5O_UPDATE_TIME, type) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message");
/* Copy the new object header's location into the datatype, taking ownership of it */
if (H5O_loc_copy_shallow(&(type->oloc), &temp_oloc) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location");
if (H5G_name_copy(&(type->path), &temp_path, H5_COPY_SHALLOW) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype location");
loc_init = FALSE;
/* Set the shared info fields */
@@ -500,15 +500,15 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id)
/* Add datatype to the list of open objects in the file */
if (H5FO_top_incr(type->sh_loc.file, type->sh_loc.u.loc.oh_addr) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, FAIL, "can't incr object ref. count")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, FAIL, "can't incr object ref. count");
if (H5FO_insert(type->sh_loc.file, type->sh_loc.u.loc.oh_addr, type->shared, TRUE) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert datatype into list of open objects")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert datatype into list of open objects");
/* Mark datatype as being on memory again. Since this datatype may still be
* used in memory after committed to disk, change its size back as in memory.
*/
if (H5T_set_loc(type, NULL, H5T_LOC_MEMORY) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype in memory")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype in memory");
done:
if (ret_value < 0) {
@@ -552,7 +552,7 @@ H5Tcommitted(hid_t type_id)
/* Check arguments */
if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype");
/* Set return value */
ret_value = H5T_is_named(type);
@@ -584,7 +584,7 @@ H5T_link(const H5T_t *type, int adjust)
/* Adjust the link count on the named datatype */
if ((ret_value = H5O_link(&type->oloc, adjust)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_LINKCOUNT, (-1), "unable to adjust named datatype link count")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_LINKCOUNT, (-1), "unable to adjust named datatype link count");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -616,22 +616,22 @@ H5T__open_api_common(hid_t loc_id, const char *name, hid_t tapl_id, void **token
/* Check args */
if (!name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be NULL")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be NULL");
if (!*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string");
/* Set up object access arguments */
if (H5VL_setup_acc_args(loc_id, H5P_CLS_TACC, FALSE, &tapl_id, vol_obj_ptr, &loc_params) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments");
/* Open the datatype */
if (NULL == (dt = H5VL_datatype_open(*vol_obj_ptr, &loc_params, name, tapl_id, H5P_DATASET_XFER_DEFAULT,
token_ptr)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype");
/* Register the type and return the ID */
if ((ret_value = H5VL_register(H5I_DATATYPE, dt, (*vol_obj_ptr)->connector, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype");
done:
/* Cleanup on error */
@@ -665,7 +665,7 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id)
/* Open the datatype synchronously */
if ((ret_value = H5T__open_api_common(loc_id, name, tapl_id, NULL, NULL)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID,
- "unable to open named datatype synchronously")
+ "unable to open named datatype synchronously");
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Topen2() */
@@ -700,7 +700,7 @@ H5Topen_async(const char *app_file, const char *app_func, unsigned app_line, hid
/* Open the datatype asynchronously */
if ((ret_value = H5T__open_api_common(loc_id, name, tapl_id, token_ptr, &vol_obj)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID,
- "unable to open named datatype asynchronously")
+ "unable to open named datatype asynchronously");
/* If a token was created, add the token to the event set */
if (NULL != token)
@@ -710,8 +710,8 @@ H5Topen_async(const char *app_file, const char *app_func, unsigned app_line, hid
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, H5I_INVALID_HID,
- "can't decrement count on datatype ID")
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert token into event set")
+ "can't decrement count on datatype ID");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert token into event set");
} /* end if */
done:
@@ -746,11 +746,11 @@ H5Tget_create_plist(hid_t dtype_id)
/* Check arguments */
if (NULL == (type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype");
/* Check if the datatype is committed */
if (FAIL == (is_named = H5T_is_named(type)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't check whether datatype is committed")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't check whether datatype is committed");
/* If the datatype is not committed/named, just copy the default
* creation property list and return that.
@@ -760,10 +760,10 @@ H5Tget_create_plist(hid_t dtype_id)
/* Copy the default datatype creation property list */
if (NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get default creation property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get default creation property list");
if ((ret_value = H5P_copy_plist(tcpl_plist, TRUE)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID,
- "unable to copy the creation property list")
+ "unable to copy the creation property list");
} /* end if */
/* If the datatype is committed, retrieve further information */
else {
@@ -776,7 +776,7 @@ H5Tget_create_plist(hid_t dtype_id)
/* Get the property list through the VOL */
if (H5VL_datatype_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't get object creation info")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't get object creation info");
/* Set return value */
ret_value = vol_cb_args.args.get_tcpl.tcpl_id;
@@ -806,9 +806,9 @@ H5Tflush(hid_t type_id)
/* Check args */
if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype");
if (!H5T_is_named(dt))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype");
/* Flush metadata for named datatype */
if (dt->vol_obj) {
@@ -816,14 +816,14 @@ H5Tflush(hid_t type_id)
/* Set up collective metadata if appropriate */
if (H5CX_set_loc(type_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info");
/* Set up VOL callback arguments */
vol_cb_args.op_type = H5VL_DATATYPE_FLUSH;
vol_cb_args.args.flush.type_id = type_id;
if (H5VL_datatype_specific(dt->vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype");
}
done:
@@ -850,9 +850,9 @@ H5Trefresh(hid_t type_id)
/* Check args */
if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype");
if (!H5T_is_named(dt))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype");
/* Refresh the datatype's metadata */
if (dt->vol_obj) {
@@ -860,14 +860,14 @@ H5Trefresh(hid_t type_id)
/* Set up collective metadata if appropriate */
if (H5CX_set_loc(type_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info");
/* Set up VOL callback arguments */
vol_cb_args.op_type = H5VL_DATATYPE_REFRESH;
vol_cb_args.args.refresh.type_id = type_id;
if (H5VL_datatype_specific(dt->vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype");
}
done:
@@ -905,17 +905,17 @@ H5T__get_create_plist(const H5T_t *type)
/* Copy the default datatype creation property list */
if (NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5I_INVALID_HID, "can't get default creation property list")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5I_INVALID_HID, "can't get default creation property list");
if ((new_tcpl_id = H5P_copy_plist(tcpl_plist, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list");
/* Get property list object for new TCPL */
if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_tcpl_id)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5I_INVALID_HID, "can't get property list")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5I_INVALID_HID, "can't get property list");
/* Retrieve any object creation properties */
if (H5O_get_create_plist(&type->oloc, new_plist) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't get object creation info")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't get object creation info");
/* Set the return value */
ret_value = new_tcpl_id;
@@ -966,18 +966,18 @@ H5T__open_name(const H5G_loc_t *loc, const char *name)
* from it.
*/
if (H5G_loc_find(loc, name, &type_loc /*out*/) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found");
obj_found = TRUE;
/* Check that the object found is the correct type */
if (H5O_obj_type(&oloc, &obj_type) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, NULL, "can't get object type")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, NULL, "can't get object type");
if (obj_type != H5O_TYPE_NAMED_DATATYPE)
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "not a named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "not a named datatype");
/* Open it */
if (NULL == (dt = H5T_open(&type_loc)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named datatype");
ret_value = dt;
@@ -1020,44 +1020,45 @@ H5T_open(const H5G_loc_t *loc)
/* Open the datatype object */
if (NULL == (dt = H5T__open_oid(loc)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found");
/* Add the datatype to the list of opened objects in the file */
if (H5FO_insert(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr, dt->shared, FALSE) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, NULL, "can't insert datatype into list of open objects")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, NULL,
+ "can't insert datatype into list of open objects");
/* Increment object count for the object in the top file */
if (H5FO_top_incr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, NULL, "can't increment object count")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, NULL, "can't increment object count");
/* Mark any datatypes as being in memory now */
if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location");
dt->shared->fo_count = 1;
} /* end if */
else {
if (NULL == (dt = H5FL_MALLOC(H5T_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for datatype")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for datatype");
dt->vol_obj = NULL;
#if defined(H5_USING_MEMCHECKER) || !defined(NDEBUG)
/* Clear object location */
if (H5O_loc_reset(&(dt->oloc)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reset location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reset location");
/* Clear path name */
if (H5G_name_reset(&(dt->path)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reset path")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reset path");
#endif /* H5_USING_MEMCHECKER */
/* Shallow copy (take ownership) of the object location object */
if (H5O_loc_copy_shallow(&dt->oloc, loc->oloc) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy object location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy object location");
/* Shallow copy (take ownership) of the group hier. path */
if (H5G_name_copy(&(dt->path), loc->path, H5_COPY_SHALLOW) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy path")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy path");
/* Set the shared component info */
H5T_update_shared(dt);
@@ -1067,7 +1068,7 @@ H5T_open(const H5G_loc_t *loc)
/* Mark any datatypes as being in memory now */
if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location");
/* Increment ref. count on shared info */
shared_fo->fo_count++;
@@ -1076,12 +1077,12 @@ H5T_open(const H5G_loc_t *loc)
if (H5FO_top_count(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) == 0) {
/* Open the object through this top file */
if (H5O_open(&(dt->oloc)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open object header")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open object header");
} /* end if */
/* Increment object count for the object in the top file */
if (H5FO_top_incr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, NULL, "can't increment object count")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, NULL, "can't increment object count");
} /* end else */
ret_value = dt;
@@ -1131,22 +1132,22 @@ H5T__open_oid(const H5G_loc_t *loc)
/* Open named datatype object in file */
if (H5O_open(loc->oloc) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named datatype");
/* Deserialize the datatype message into a datatype in memory */
if (NULL == (dt = (H5T_t *)H5O_msg_read(loc->oloc, H5O_DTYPE_ID, NULL)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to load type message from object header")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to load type message from object header");
/* Mark the type as named and open */
dt->shared->state = H5T_STATE_OPEN;
/* Shallow copy (take ownership) of the object location object */
if (H5O_loc_copy_shallow(&dt->oloc, loc->oloc) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy object location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy object location");
/* Shallow copy (take ownership) of the group hier. path */
if (H5G_name_copy(&(dt->path), loc->path, H5_COPY_SHALLOW) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy path")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "can't copy path");
/* Set the shared component info */
H5T_update_shared(dt);
@@ -1211,11 +1212,11 @@ H5T_construct_datatype(H5VL_object_t *vol_obj)
/* Get required buf size for encoding the datatype */
if (H5VL_datatype_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to get datatype serialized size")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to get datatype serialized size");
/* Allocate buffer to store binary description of the datatype */
if (NULL == (buf = (void *)H5MM_calloc(nalloc)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for datatype")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for datatype");
/* Set up VOL callback arguments */
vol_cb_args.op_type = H5VL_DATATYPE_GET_BINARY;
@@ -1224,11 +1225,11 @@ H5T_construct_datatype(H5VL_object_t *vol_obj)
/* get binary description of the datatype */
if (H5VL_datatype_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to get serialized datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to get serialized datatype");
/* Construct datatype, from serialized form in buffer */
if (NULL == (dt = H5T_decode(nalloc, buf)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "can't decode datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "can't decode datatype");
dt->vol_obj = vol_obj;
/* Set return value */
@@ -1313,17 +1314,17 @@ H5T_save_refresh_state(hid_t tid, H5O_shared_t *cached_H5O_shared)
assert(cached_H5O_shared);
if (NULL == (dt = (H5T_t *)H5I_object_verify(tid, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid is not a datatype ID")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid is not a datatype ID");
vol_dt = H5T_get_actual_type(dt);
if (NULL == vol_dt)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid is not not a named datatype ID")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid is not not a named datatype ID");
/* Increase the count on the file object */
vol_dt->shared->fo_count += 1;
/* Increment object count for the object in the top file */
if (H5FO_top_incr(vol_dt->sh_loc.file, vol_dt->sh_loc.u.loc.oh_addr) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, FAIL, "can't increment object count")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, FAIL, "can't increment object count");
/* Cache the H5O_shared_t data */
H5MM_memcpy(cached_H5O_shared, &(vol_dt->sh_loc), sizeof(H5O_shared_t));
@@ -1353,17 +1354,17 @@ H5T_restore_refresh_state(hid_t tid, H5O_shared_t *cached_H5O_shared)
assert(cached_H5O_shared);
if (NULL == (dt = (H5T_t *)H5I_object_verify(tid, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid not a datatype ID")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid not a datatype ID");
vol_dt = H5T_get_actual_type(dt);
if (NULL == vol_dt)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid is not not a named datatype ID")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid is not not a named datatype ID");
/* Restore the H5O_shared_t data */
H5MM_memcpy(&(vol_dt->sh_loc), cached_H5O_shared, sizeof(H5O_shared_t));
/* Decrement the ref. count for this object in the top file */
if (H5FO_top_decr(vol_dt->sh_loc.file, vol_dt->sh_loc.u.loc.oh_addr) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement object count")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement object count");
/* Decrease the count on the file object */
vol_dt->shared->fo_count -= 1;
@@ -1412,12 +1413,12 @@ H5T_invoke_vol_optional(H5T_t *dt, H5VL_optional_args_t *args, hid_t dxpl_id, vo
/* Check that datatype is committed */
if (!H5T_is_named(dt))
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a committed datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a committed datatype");
/* Only invoke callback if VOL object is set for the datatype */
if (dt->vol_obj)
if (H5VL_datatype_optional_op(dt->vol_obj, args, dxpl_id, req, vol_obj_ptr) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPERATE, FAIL, "unable to execute datatype optional callback")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPERATE, FAIL, "unable to execute datatype optional callback");
done:
FUNC_LEAVE_NOAPI(ret_value)