summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-06-08 03:07:44 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-06-08 03:07:44 (GMT)
commitf7649ec8b6febf3a3d521f91ceb9a815fbafff07 (patch)
tree2637e96999508209c84ab8b2060188cc214107e4 /src/H5D.c
parent2c939d20e6dd1e575075b5f6f1fb017567e97d65 (diff)
downloadhdf5-f7649ec8b6febf3a3d521f91ceb9a815fbafff07.zip
hdf5-f7649ec8b6febf3a3d521f91ceb9a815fbafff07.tar.gz
hdf5-f7649ec8b6febf3a3d521f91ceb9a815fbafff07.tar.bz2
[svn-r13843] Description:
Fix compact dataset storage to initialize VL datatype fill values correctly. Also, fix bug in global heap code when the fix action on a global heap is to delete an object in a heap with no free space. Tested on: Mac OS X/32 10.4.9 (amazon) (Will be testing on FreeBSD/32 6.2 (duty))
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 5daec07..c9043ad 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -3162,37 +3162,22 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id)
FUNC_ENTER_NOAPI_NOINIT(H5D_init_storage)
- assert(dset);
+ HDassert(dset);
switch (dset->shared->layout.type) {
case H5D_COMPACT:
/* If we will be immediately overwriting the values, don't bother to clear them */
- if(!full_overwrite) {
- /* If the fill value is defined, initialize the data buffer with it */
- if(dset->shared->fill.buf) {
- hssize_t snpoints; /* Number of points in space (for error checking) */
- size_t npoints; /* Number of points in space */
-
- /* Get the number of elements in the dataset's dataspace */
- snpoints = H5S_GET_EXTENT_NPOINTS(dset->shared->space);
- assert(snpoints>=0);
- H5_ASSIGN_OVERFLOW(npoints,snpoints,hssize_t,size_t);
-
- /* Initialize the cached data buffer with the fill value */
- H5V_array_fill(dset->shared->layout.u.compact.buf, dset->shared->fill.buf, dset->shared->fill.size, npoints);
- } /* end if */
- else /* If the fill value is default, zero set data buf. */
- HDmemset(dset->shared->layout.u.compact.buf, 0, dset->shared->layout.u.compact.size);
- } /* end if */
+ if(!full_overwrite)
+ if(H5D_compact_fill(dset, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize compact dataset storage")
break;
case H5D_CONTIGUOUS:
/* Don't write default fill values to external files */
/* If we will be immediately overwriting the values, don't bother to clear them */
- if((dset->shared->efl.nused==0 || dset->shared->fill.buf) && !full_overwrite) {
- if (H5D_contig_fill(dset, dxpl_id)<0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset")
- } /* end if */
+ if((dset->shared->efl.nused == 0 || dset->shared->fill.buf) && !full_overwrite)
+ if(H5D_contig_fill(dset, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize contiguous dataset storage")
break;
case H5D_CHUNKED:
@@ -3200,7 +3185,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id)
* Allocate file space
* for all chunks now and initialize each chunk with the fill value.
*/
- if (H5D_istore_allocate(dset, dxpl_id, full_overwrite)<0)
+ if(H5D_istore_allocate(dset, dxpl_id, full_overwrite) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset")
break;