summaryrefslogtreecommitdiffstats
path: root/src/H5Tcommit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Tcommit.c')
-rw-r--r--src/H5Tcommit.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 0ab3b4e..51fb9d2 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -127,12 +127,9 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id,
if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list")
- /* Get correct 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")
+ /* Verify access property list and get correct dxpl */
+ if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists")
/* Commit the type */
if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id, tapl_id, dxpl_id) < 0)
@@ -268,12 +265,9 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list")
- /* Get correct 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")
+ /* Verify access property list and get correct dxpl */
+ if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists")
/* Commit the type */
if(H5T__commit(loc.oloc->file, type, tcpl_id, dxpl_id) < 0)
@@ -547,12 +541,9 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id)
if(!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
- /* Get correct 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")
+ /* Verify access property list and get correct dxpl */
+ if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists")
/* Set up datatype location to fill in */
type_loc.oloc = &oloc;