diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-08-31 01:50:47 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-08-31 01:50:47 (GMT) |
commit | 04137b3a16b829589ab28edfc39ba3092a650521 (patch) | |
tree | 093b007cd8488655592e547d5630a7190d99c349 /src/H5Torder.c | |
parent | 39106425cf1b2a98296350b287a8dbacb926886b (diff) | |
download | hdf5-04137b3a16b829589ab28edfc39ba3092a650521.zip hdf5-04137b3a16b829589ab28edfc39ba3092a650521.tar.gz hdf5-04137b3a16b829589ab28edfc39ba3092a650521.tar.bz2 |
[svn-r7435] Purpose:
Bug Fix and code cleanup
Description:
Correct error in H5T_detect_class that was causing nested compound datatypes
with to not detect the datatype class of fields correctly, which caused errors
with fill-values, variable-length datatypes and chunks later on.
Return the rank of the array datatype from H5Tget_array_dims(), like
H5Sget_dims().
Lots of cleanups to datatype code, to make the handling of arrays, compound
types, variable-length strings and sequences and enumerated types more
consistent and robust.
Platforms tested:
FreeBSD 4.9 (sleipnir)
h5committest
Diffstat (limited to 'src/H5Torder.c')
-rw-r--r-- | src/H5Torder.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/H5Torder.c b/src/H5Torder.c index 35e9c0d..214466c 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -84,10 +84,9 @@ H5Tget_order(hid_t type_id) /* Check args */ if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_ORDER_ERROR, "not a data type"); - - if (dt->parent) + while (dt->parent) dt = dt->parent; /*defer to parent*/ - if (H5T_COMPOUND==dt->type || H5T_OPAQUE==dt->type || H5T_ARRAY ==dt->type) + 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"); /* Order */ @@ -133,9 +132,9 @@ H5Tset_order(hid_t type_id, H5T_order_t order) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal byte order"); if (H5T_ENUM==dt->type && dt->u.enumer.nmembs>0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined"); - if (dt->parent) + while (dt->parent) dt = dt->parent; /*defer to parent*/ - if (H5T_COMPOUND==dt->type || H5T_OPAQUE==dt->type || H5T_ARRAY==dt->type) + 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"); /* Commit */ |