diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-08-16 19:25:09 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-08-16 19:25:09 (GMT) |
commit | cba993c3492d773e5d0923257382eca17e594910 (patch) | |
tree | 21dc90a495f4c44b844463a85a988907838a09dc /src/H5Tdeprec.c | |
parent | 0ba794be38b908271e6a2d8f5e231e4b097f25e5 (diff) | |
download | hdf5-cba993c3492d773e5d0923257382eca17e594910.zip hdf5-cba993c3492d773e5d0923257382eca17e594910.tar.gz hdf5-cba993c3492d773e5d0923257382eca17e594910.tar.bz2 |
Minor normalizations with develop
Diffstat (limited to 'src/H5Tdeprec.c')
-rw-r--r-- | src/H5Tdeprec.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 13d2f5f..17e4a82 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Tdeprec.c * April 5 2007 - * Quincey Koziol <koziol@hdfgroup.org> + * Quincey Koziol * * Purpose: Deprecated functions from the H5T interface. These * functions are here for compatibility purposes and may be @@ -101,7 +101,7 @@ herr_t H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) { H5G_loc_t loc; /* Location to create datatype */ - H5T_t *type; /* Datatype for ID */ + H5T_t *dt; /* Datatype for ID */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -109,19 +109,19 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - 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_BADVALUE, FAIL, "no name") + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Set up collective metadata if appropriate */ if(H5CX_set_loc(loc_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") - /* Commit the datatype to the file, using default property list values */ - if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") + /* Commit the datatype */ + if(H5T__commit_named(&loc, name, dt, H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: FUNC_LEAVE_API(ret_value) @@ -137,7 +137,7 @@ done: * * Return: Success: Object ID of the named datatype. * - * Failure: Negative + * Failure: H5I_INVALID_HID * * Programmer: Robb Matzke * Monday, June 1, 1998 @@ -149,7 +149,7 @@ H5Topen1(hid_t loc_id, const char *name) { H5T_t *type = NULL; H5G_loc_t loc; - hid_t ret_value = H5I_INVALID_HID; + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "i*s", loc_id, name); @@ -160,7 +160,7 @@ H5Topen1(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") - /* Open it */ + /* Open the datatype */ if(NULL == (type = H5T__open_name(&loc, name))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype") @@ -170,9 +170,9 @@ H5Topen1(hid_t loc_id, const char *name) done: /* Cleanup on error */ - if(ret_value < 0) + if(H5I_INVALID_HID == ret_value) if(type && H5T_close(type) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") + HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to close datatype") FUNC_LEAVE_API(ret_value) } /* end H5Topen1() */ |