summaryrefslogtreecommitdiffstats
path: root/src/H5Tcompound.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-01-14 15:30:51 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-01-14 15:30:51 (GMT)
commit6564dbcfaa09da479cc5e393693799e329fc1330 (patch)
tree820621ac55441e10978dca5aa155e170ccebc6b4 /src/H5Tcompound.c
parenta365f0e6aabfa6a13b008e0263e6a2d6c86d5d7e (diff)
downloadhdf5-6564dbcfaa09da479cc5e393693799e329fc1330.zip
hdf5-6564dbcfaa09da479cc5e393693799e329fc1330.tar.gz
hdf5-6564dbcfaa09da479cc5e393693799e329fc1330.tar.bz2
[svn-r16308] Purpose: Fix problem with H5Tpack
Description: If a compound type was packed except for some extra space at the end, H5Tpack would not modify the type and the extra space would remain. Changed H5T_is_packed to fix this behaviour. Tested: jam, smirom (h5committest - linew down)
Diffstat (limited to 'src/H5Tcompound.c')
-rw-r--r--src/H5Tcompound.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c
index d9b5974..68de174 100644
--- a/src/H5Tcompound.c
+++ b/src/H5Tcompound.c
@@ -631,8 +631,13 @@ H5T_is_packed(const H5T_t *dt)
dt = dt->shared->parent;
/* If this is a compound datatype, check if it is packed */
- if(dt->shared->type == H5T_COMPOUND)
- ret_value = (htri_t)dt->shared->u.compnd.packed;
+ if(dt->shared->type == H5T_COMPOUND) {
+ H5T_compnd_t *compnd = &(dt->shared->u.compnd); /* Convenience pointer to compound info */
+ ret_value = (htri_t)(compnd->packed
+ && compnd->memb[compnd->nmembs - 1].offset
+ + compnd->memb[compnd->nmembs - 1].size
+ == dt->shared->size);
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_is_packed() */