summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-06-05 17:51:06 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-06-05 17:51:06 (GMT)
commitc80b7740130a31a3a9f91522988458393acc7288 (patch)
tree96309d260b90790c40bd3832e4cf476a7cbc3817 /src
parent012fc7d83b989f1a9ddf152da29a91f9f05775cc (diff)
downloadhdf5-c80b7740130a31a3a9f91522988458393acc7288.zip
hdf5-c80b7740130a31a3a9f91522988458393acc7288.tar.gz
hdf5-c80b7740130a31a3a9f91522988458393acc7288.tar.bz2
[svn-r13836] Description:
Minor code cleanups Tested on: Mac OS X/32 10.4.9 (amazon)
Diffstat (limited to 'src')
-rw-r--r--src/H5D.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 9f5ee19..dbd2315 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -2495,25 +2495,24 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id)
switch (dset->shared->layout.type) {
case H5D_COMPACT:
- {
- 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);
- HDassert(snpoints >= 0);
- H5_ASSIGN_OVERFLOW(npoints, snpoints, hssize_t, size_t);
-
- /* 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->dcpl_cache.fill.buf)
- /* Initialize the cached data buffer with the fill value */
- H5V_array_fill(dset->shared->layout.u.compact.buf, dset->shared->dcpl_cache.fill.buf, (size_t)dset->shared->dcpl_cache.fill.size, npoints);
- 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);
+ /* 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->dcpl_cache.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);
+ HDassert(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->dcpl_cache.fill.buf, (size_t)dset->shared->dcpl_cache.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 */
break;
case H5D_CONTIGUOUS: