diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2010-04-27 21:35:53 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2010-04-27 21:35:53 (GMT) |
commit | 6c5e42a96720ccd4c7b517af8c00c658112dc7af (patch) | |
tree | 551e515bd01f54601d530b425d45d263b5f1acb8 /src | |
parent | daddb56a02bb6503e57993631e70836a10b5d9f2 (diff) | |
download | hdf5-6c5e42a96720ccd4c7b517af8c00c658112dc7af.zip hdf5-6c5e42a96720ccd4c7b517af8c00c658112dc7af.tar.gz hdf5-6c5e42a96720ccd4c7b517af8c00c658112dc7af.tar.bz2 |
[svn-r18648] In H5T_get_native_type of H5Tnative.c, I changed the way that the offset, alignment, and
size of nested compound type are calculated by using H5T_cmp_offset. The old way had a bug
in it (see bug #1850).
Tested on jam. I tested the same change for 1.8 on amani, linew, and jam.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dchunk.c | 2 | ||||
-rw-r--r-- | src/H5Tnative.c | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index aad39ee..2e0b096 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -4588,7 +4588,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_bh_size + * Function: H5D_chunk_bh_info * * Purpose: Retrieve the amount of index storage for chunked dataset * diff --git a/src/H5Tnative.c b/src/H5Tnative.c index b22e3e5..ce2c141 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -148,6 +148,11 @@ done: * Oct 3, 2002 * * Modifications: + * Raymond Lu + * 27 April 2010 + * I changed the way that the offset, alignment, and size of + * nested compound type are calculated by using H5T_cmp_offset. + * The old way had a bug in it (see bug #1850). * *------------------------------------------------------------------------- */ @@ -312,12 +317,11 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member to compound datatype") } - /* Update size, offset and compound alignment for parent. */ - if(offset) - *offset = *comp_size; - if(struct_align && *struct_align < children_st_align) - *struct_align = children_st_align; - *comp_size += children_size; + /* Update size, offset and compound alignment for parent in the case of + * nested compound type. */ + if(H5T_cmp_offset(comp_size, offset, children_size, (size_t)1, children_st_align, + struct_align) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") /* Close member data type */ for(i=0; i<nmemb; i++) { |