mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[svn-r5271] Purpose:
Bug Fix. Description: When the fill value for a dataset is not set, the size is set to zero, causing problems with filling unused areas in previously defined chunks (i.e. when the dataset shrinks in size) Solution: Use the size of the elements in the dataset directly, instead of relying on the size of the fill value (which must be the same size). Platforms tested: FreeBSD 4.5 (sleipnir)
This commit is contained in:
parent
bb07809e41
commit
80043b04c0
@ -2940,7 +2940,11 @@ H5F_istore_initialize_by_extent(H5F_t *f, const H5O_layout_t *layout,
|
||||
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select hyperslab");
|
||||
|
||||
/* Fill the selection in the memory buffer */
|
||||
if(H5S_select_fill(fill.buf, fill.size, space_chunk, chunk) < 0)
|
||||
/* Use the size of the elements in the chunk directly instead of */
|
||||
/* relying on the fill.size, which might be set to 0 if there is */
|
||||
/* no fill-value defined for the dataset -QAK */
|
||||
H5_CHECK_OVERFLOW(size[rank],hsize_t,size_t);
|
||||
if(H5S_select_fill(fill.buf, (size_t)size[rank], space_chunk, chunk) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed");
|
||||
|
||||
if(H5F_istore_unlock(f, dxpl_id, layout, &pline, TRUE,
|
||||
|
@ -2940,7 +2940,11 @@ H5F_istore_initialize_by_extent(H5F_t *f, const H5O_layout_t *layout,
|
||||
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select hyperslab");
|
||||
|
||||
/* Fill the selection in the memory buffer */
|
||||
if(H5S_select_fill(fill.buf, fill.size, space_chunk, chunk) < 0)
|
||||
/* Use the size of the elements in the chunk directly instead of */
|
||||
/* relying on the fill.size, which might be set to 0 if there is */
|
||||
/* no fill-value defined for the dataset -QAK */
|
||||
H5_CHECK_OVERFLOW(size[rank],hsize_t,size_t);
|
||||
if(H5S_select_fill(fill.buf, (size_t)size[rank], space_chunk, chunk) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed");
|
||||
|
||||
if(H5F_istore_unlock(f, dxpl_id, layout, &pline, TRUE,
|
||||
|
@ -40,7 +40,7 @@ int main( void )
|
||||
int buf1[ 70 ][ 70 ];
|
||||
int buf2[ 90 ][ 90 ];
|
||||
int i, j, n = 0;
|
||||
int fillvalue = 0; /* Fill value for the dataset */
|
||||
int fillvalue = 1; /* Fill value for the dataset */
|
||||
|
||||
|
||||
for( i = 0; i < 90; i++ )
|
||||
|
Loading…
Reference in New Issue
Block a user