summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-10-27 22:45:31 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-10-27 22:45:31 (GMT)
commitf6ebbc01094db95c4455e2cb1c3a77ccd0ee9c6f (patch)
tree6f6044fe106605d0cebe7b5cf3a520ac4ea460c7 /src/H5T.c
parentb080ca4806226a13fa5c336b58a3cf96f0b127e4 (diff)
downloadhdf5-f6ebbc01094db95c4455e2cb1c3a77ccd0ee9c6f.zip
hdf5-f6ebbc01094db95c4455e2cb1c3a77ccd0ee9c6f.tar.gz
hdf5-f6ebbc01094db95c4455e2cb1c3a77ccd0ee9c6f.tar.bz2
[svn-r17762] 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: