summaryrefslogtreecommitdiffstats
path: root/src/H5Tcompound.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2008-06-30 19:00:44 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2008-06-30 19:00:44 (GMT)
commit2b1ee377c33c1f6cedb4e3eeda9fcf4634acabb8 (patch)
treeda802861f997f3a441f7c3706cdf96584a5e40f4 /src/H5Tcompound.c
parent372af0302f8acea869d8f02b7633176d3985a1ec (diff)
downloadhdf5-2b1ee377c33c1f6cedb4e3eeda9fcf4634acabb8.zip
hdf5-2b1ee377c33c1f6cedb4e3eeda9fcf4634acabb8.tar.gz
hdf5-2b1ee377c33c1f6cedb4e3eeda9fcf4634acabb8.tar.bz2
[svn-r15297] Bug fix for H5Tpack. The problem was that H5Tpack didn't act correctly with nested
compound datatype. The size of compound type's member type wasn't updated. It's fixed in this commit. Tested on smirom. The same change was tested on three systems for v1.9.
Diffstat (limited to 'src/H5Tcompound.c')
-rw-r--r--src/H5Tcompound.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c
index 9942ea1..94439cc 100644
--- a/src/H5Tcompound.c
+++ b/src/H5Tcompound.c
@@ -555,10 +555,14 @@ H5T_pack(const H5T_t *dt)
} /* end if */
else if(dt->shared->type==H5T_COMPOUND) {
/* Recursively pack the members */
- for (i=0; i<dt->shared->u.compnd.nmembs; i++)
+ for (i=0; i<dt->shared->u.compnd.nmembs; i++) {
if (H5T_pack(dt->shared->u.compnd.memb[i].type) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to pack part of a compound datatype")
+ /* Update the member size */
+ dt->shared->u.compnd.memb[i].size = dt->shared->u.compnd.memb[i].type->shared->size;
+ }
+
/* Remove padding between members */
if(H5T_sort_value(dt, NULL)<0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOMPARE, FAIL, "value sort failed")