summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-10-27 22:23:49 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-10-27 22:23:49 (GMT)
commit376a788840fe6db1f253a371e3bcde527b4bfd3f (patch)
tree5aff621b28ab1ff02f41b1ea83325b11d287d13f /src/H5T.c
parent597739142f65d71f1ccf9eeeda6568b147e506b5 (diff)
downloadhdf5-376a788840fe6db1f253a371e3bcde527b4bfd3f.zip
hdf5-376a788840fe6db1f253a371e3bcde527b4bfd3f.tar.gz
hdf5-376a788840fe6db1f253a371e3bcde527b4bfd3f.tar.bz2
[svn-r17760] Purpose: Fix problem with H5TB API
Description: The H5TB API makes some improper assumptions about the order of compound datatype members. Namely, it assumes that members remain in the order in which they were inserted. Unfortunately, this assumption is inherent in the design of the interface. The library has been patched so that this assumption holds in situations relevant to H5TB. Tested: jam, linew, amani (h5committest)
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 1e30f77..4041cd5 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -2976,8 +2976,8 @@ H5T_create(H5T_class_t type, size_t size)
dt->shared->type = type;
if(type==H5T_COMPOUND) {
- dt->shared->u.compnd.packed=TRUE; /* Start out packed */
- dt->shared->u.compnd.sorted=H5T_SORT_VALUE; /* Start out sorted by value */
+ dt->shared->u.compnd.packed=FALSE; /* Start out unpacked */
+ dt->shared->u.compnd.memb_size=0;
} /* end if */
else if(type==H5T_OPAQUE)
/* Initialize the tag in case it's not set later. A null tag will
@@ -3678,7 +3678,13 @@ H5T_set_size(H5T_t *dt, size_t size)
if(size<(max_offset+max_size))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member ");
+
+ /* Compound must not have been packed previously */
+ /* We will check if resizing changed the packed state of
+ * this type at the end of this function */
+ HDassert(!dt->shared->u.compnd.packed);
}
+
break;
case H5T_STRING:
@@ -3754,6 +3760,10 @@ H5T_set_size(H5T_t *dt, size_t size)
dt->shared->u.atomic.prec = prec;
}
} /* end if */
+
+ /* Check if the new compound type is packed */
+ if(dt->shared->type == H5T_COMPOUND)
+ H5T_update_packed(dt);
}
done: