summaryrefslogtreecommitdiffstats
path: root/src/H5Tcommit.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-21 18:13:48 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-21 18:13:48 (GMT)
commit568f982ed26e88f8f8b9253b07cf8cd9bdebfcf6 (patch)
treeddfaa30361568cdcd48c42c6589f7409f5144a20 /src/H5Tcommit.c
parent0a7e0c3a356de568cbee182133accf947f8d337d (diff)
downloadhdf5-568f982ed26e88f8f8b9253b07cf8cd9bdebfcf6.zip
hdf5-568f982ed26e88f8f8b9253b07cf8cd9bdebfcf6.tar.gz
hdf5-568f982ed26e88f8f8b9253b07cf8cd9bdebfcf6.tar.bz2
[svn-r25456] fixing a few things and more realignment with trunk.
Diffstat (limited to 'src/H5Tcommit.c')
-rw-r--r--src/H5Tcommit.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 3986a5c..cab6223 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -134,10 +134,12 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id,
H5TRACE6("e", "i*siiii", loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id);
/* Check arguments */
- if (H5Tcommitted(type_id))
- HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed")
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")
+ if(H5T_committed(type))
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed")
/* Get correct property list */
if(H5P_DEFAULT == lcpl_id)
@@ -160,9 +162,6 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id,
if(TRUE != H5P_isa_class(tapl_id, H5P_DATATYPE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype access property list")
- if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
-
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(loc_id);
@@ -307,8 +306,10 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
H5TRACE4("e", "iiii", loc_id, type_id, tcpl_id, tapl_id);
/* check args */
- if (H5Tcommitted(type_id))
- HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed")
+ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ if(H5T_committed(type))
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is already committed")
/* Get correct property list */
if(H5P_DEFAULT == tcpl_id)
@@ -339,11 +340,6 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
tcpl_id, tapl_id, H5AC_dxpl_id, H5_EVENT_STACK_NULL)))
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to commit datatype")
- /* attach the vol object created using the commit call to the
- library datatype structure */
- if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
-
/* set the committed type object to the VOL pluging pointer in the H5T_t struct */
type->vol_obj = dt;