summaryrefslogtreecommitdiffstats
path: root/src/H5Torder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Torder.c')
-rw-r--r--src/H5Torder.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/H5Torder.c b/src/H5Torder.c
index 214466c..2f39816 100644
--- a/src/H5Torder.c
+++ b/src/H5Torder.c
@@ -86,11 +86,10 @@ H5Tget_order(hid_t type_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_ORDER_ERROR, "not a data type");
while (dt->parent)
dt = dt->parent; /*defer to parent*/
- if (H5T_COMPOUND==dt->type || H5T_OPAQUE==dt->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_ORDER_ERROR, "operation not defined for specified data type");
+ if (!H5T_IS_ATOMIC(dt))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_ORDER_ERROR, "operation not defined for specified data type");
/* Order */
- assert(H5T_is_atomic(dt));
ret_value = dt->u.atomic.order;
done:
@@ -134,11 +133,10 @@ H5Tset_order(hid_t type_id, H5T_order_t order)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined");
while (dt->parent)
dt = dt->parent; /*defer to parent*/
- if (H5T_COMPOUND==dt->type || H5T_OPAQUE==dt->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_ORDER_ERROR, "operation not defined for specified data type");
+ if (!H5T_IS_ATOMIC(dt))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_ORDER_ERROR, "operation not defined for specified data type");
/* Commit */
- assert(H5T_is_atomic(dt));
dt->u.atomic.order = order;
done: