summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-01-29 18:19:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-01-29 18:19:05 (GMT)
commit108114495fccaafcf77904f43e9c4cb90c4396f8 (patch)
treed7f57e606afd74369845ada2ddfa63d7343d92f8 /src/H5D.c
parent55d4ec6ebf2f9f8037b33a39bc62bf93232771d8 (diff)
downloadhdf5-108114495fccaafcf77904f43e9c4cb90c4396f8.zip
hdf5-108114495fccaafcf77904f43e9c4cb90c4396f8.tar.gz
hdf5-108114495fccaafcf77904f43e9c4cb90c4396f8.tar.bz2
[svn-r13217] Description:
Move fill value messages into new shared message method calling scheme. Only update an opened dataset's fill value property if it's different from the default fill value settings. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 7f1ee27..15bb875 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1879,9 +1879,9 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id)
} /* end switch */ /*lint !e788 All appropriate cases are covered */
} /* end if */
- /* If size is 0, make it -1 for undefined. */
+ /* If "old" fill value size is 0 (undefined), map it to -1 */
if(fill_prop->size == 0)
- fill_prop->size = (size_t)-1;
+ fill_prop->size = (size_t)-1;
} /* end if */
alloc_time_state = 0;
if((dataset->shared->layout.type == H5D_COMPACT && fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY)
@@ -1889,11 +1889,13 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id)
|| (dataset->shared->layout.type == H5D_CHUNKED && fill_prop->alloc_time == H5D_ALLOC_TIME_INCR))
alloc_time_state = 1;
- /* Set revised fill value properties */
- if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, fill_prop) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set fill value")
- if(H5P_set(plist, H5D_CRT_ALLOC_TIME_STATE_NAME, &alloc_time_state) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set allocation time state")
+ /* Set revised fill value properties, if they are different from the defaults */
+ if(H5P_fill_value_cmp(&H5D_def_dset.dcpl_cache.fill, fill_prop, sizeof(H5O_fill_t))) {
+ if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, fill_prop) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set fill value")
+ if(H5P_set(plist, H5D_CRT_ALLOC_TIME_STATE_NAME, &alloc_time_state) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set allocation time state")
+ } /* end if */
/* Get the external file list message, which might not exist. Space is
* also undefined when space allocate time is H5D_ALLOC_TIME_LATE. */