diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-08-31 01:48:01 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-08-31 01:48:01 (GMT) |
commit | f92d7f73df1846f4489fb6e2c2dd857b636b4deb (patch) | |
tree | 74d28cd355a39d0d9f8dc0c96484380b6b12628e /src/H5Tvlen.c | |
parent | bd3510bea3638d5f4281bf9a6bbfe4c4a8b3ca9a (diff) | |
download | hdf5-f92d7f73df1846f4489fb6e2c2dd857b636b4deb.zip hdf5-f92d7f73df1846f4489fb6e2c2dd857b636b4deb.tar.gz hdf5-f92d7f73df1846f4489fb6e2c2dd857b636b4deb.tar.bz2 |
[svn-r7434] 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/H5Tvlen.c')
-rw-r--r-- | src/H5Tvlen.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 1c0082b..5cc738a 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -727,8 +727,8 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi /* Check the datatype of this element */ switch(dt->type) { case H5T_ARRAY: - /* Recurse on each element, if the array's base type is array, VL or compound */ - if(dt->parent->type==H5T_COMPOUND || dt->parent->type==H5T_VLEN || dt->parent->type==H5T_ARRAY) { + /* Recurse on each element, if the array's base type is array, VL, enum or compound */ + if(H5T_IS_COMPLEX(dt->parent->type)) { void *off; /* offset of field */ /* Calculate the offset member and recurse on it */ @@ -741,10 +741,10 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi break; case H5T_COMPOUND: - /* Check each field and recurse on VL, compound or array ones */ + /* Check each field and recurse on VL, compound, enum or array ones */ for (i=0; i<dt->u.compnd.nmembs; i++) { - /* Recurse if it's VL, compound or array */ - if(dt->u.compnd.memb[i].type->type==H5T_COMPOUND || dt->u.compnd.memb[i].type->type==H5T_VLEN || dt->u.compnd.memb[i].type->type==H5T_ARRAY) { + /* Recurse if it's VL, compound, enum or array */ + if(H5T_IS_COMPLEX(dt->u.compnd.memb[i].type->type)) { void *off; /* offset of field */ /* Calculate the offset member and recurse on it */ @@ -756,14 +756,14 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi break; case H5T_VLEN: - /* Recurse on the VL information if it's VL, compound or array, then free VL sequence */ + /* Recurse on the VL information if it's VL, compound, enum or array, then free VL sequence */ if(dt->u.vlen.type==H5T_VLEN_SEQUENCE) { hvl_t *vl=(hvl_t *)elem; /* Temp. ptr to the vl info */ /* Check if there is anything actually in this sequence */ if(vl->len!=0) { - /* Recurse if it's VL or compound */ - if(dt->parent->type==H5T_COMPOUND || dt->parent->type==H5T_VLEN || dt->parent->type==H5T_ARRAY) { + /* Recurse if it's VL, array, enum or compound */ + if(H5T_IS_COMPLEX(dt->parent->type)) { void *off; /* offset of field */ /* Calculate the offset of each array element and recurse on it */ |