summaryrefslogtreecommitdiffstats
path: root/src/H5Tcompound.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-01-14 15:45:25 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-01-14 15:45:25 (GMT)
commitb7a12779d578169ec9d2b27dea9be68de38e48d3 (patch)
tree9a869353c35aa3c71b95385a1c5e31fa4f02974a /src/H5Tcompound.c
parent60915ff8aaa392bebd82826b5b95ab741fedd832 (diff)
downloadhdf5-b7a12779d578169ec9d2b27dea9be68de38e48d3.zip
hdf5-b7a12779d578169ec9d2b27dea9be68de38e48d3.tar.gz
hdf5-b7a12779d578169ec9d2b27dea9be68de38e48d3.tar.bz2
[svn-r16309] 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() */