summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-05-13 18:31:57 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-05-13 18:31:57 (GMT)
commit51d29f215c006345297b98ad7cb28a68e4b2d6df (patch)
treecdbfe7e85555d758a1bda5a6895eb4c93d4250aa
parent16d78f24567c3d5ee62738580c62c19e91c7dbc5 (diff)
downloadhdf5-51d29f215c006345297b98ad7cb28a68e4b2d6df.zip
hdf5-51d29f215c006345297b98ad7cb28a68e4b2d6df.tar.gz
hdf5-51d29f215c006345297b98ad7cb28a68e4b2d6df.tar.bz2
[svn-r6860] Purpose:
Small code cleanup Description: Remove redundant sanity check. Added a note about a potential bug. Platforms tested: FreeBSD 4.8 (sleipnir) h5committest not necessary.
-rw-r--r--src/H5Dio.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index e447c4f..6d66ae3 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -994,8 +994,12 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S
src_type_size = H5T_get_size(dataset->type);
dst_type_size = H5T_get_size(mem_type);
target_size = H5P_peek_size_t(dx_plist,H5D_XFER_MAX_TEMP_BUF_NAME);
+ /* XXX: This could cause a problem if the user sets their buffer size
+ * to the same size as the default, and then the dataset elements are
+ * too large for the buffer... - QAK
+ */
if(target_size==H5D_XFER_MAX_TEMP_BUF_DEF &&
- target_size<MAX(src_type_size, dst_type_size))
+ target_size<MAX(src_type_size, dst_type_size))
target_size = MAX(src_type_size, dst_type_size);
request_nelmts = target_size / MAX(src_type_size, dst_type_size);
@@ -1014,10 +1018,6 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information");
bkg_iter_init=1; /*file selection iteration info has been initialized */
- /* Sanity check elements in temporary buffer */
- if (request_nelmts<=0)
- HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small");
-
/*
* Get a temporary buffer for type conversion unless the app has already
* supplied one through the xfer properties. Instead of allocating a
@@ -1237,8 +1237,12 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5
src_type_size = H5T_get_size(mem_type);
dst_type_size = H5T_get_size(dataset->type);
target_size = H5P_peek_size_t(dx_plist,H5D_XFER_MAX_TEMP_BUF_NAME);
+ /* XXX: This could cause a problem if the user sets their buffer size
+ * to the same size as the default, and then the dataset elements are
+ * too large for the buffer... - QAK
+ */
if(target_size==H5D_XFER_MAX_TEMP_BUF_DEF &&
- target_size<MAX(src_type_size, dst_type_size))
+ target_size<MAX(src_type_size, dst_type_size))
target_size = MAX(src_type_size, dst_type_size);
request_nelmts = target_size / MAX (src_type_size, dst_type_size);
@@ -1501,8 +1505,12 @@ H5D_chunk_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S_
src_type_size = H5T_get_size(dataset->type);
dst_type_size = H5T_get_size(mem_type);
target_size = H5P_peek_size_t(dx_plist,H5D_XFER_MAX_TEMP_BUF_NAME);
+ /* XXX: This could cause a problem if the user sets their buffer size
+ * to the same size as the default, and then the dataset elements are
+ * too large for the buffer... - QAK
+ */
if(target_size==H5D_XFER_MAX_TEMP_BUF_DEF &&
- target_size<MAX(src_type_size, dst_type_size))
+ target_size<MAX(src_type_size, dst_type_size))
target_size = MAX(src_type_size, dst_type_size);
request_nelmts = target_size / MAX (src_type_size, dst_type_size);
@@ -1800,8 +1808,12 @@ H5D_chunk_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S
src_type_size = H5T_get_size(mem_type);
dst_type_size = H5T_get_size(dataset->type);
target_size = H5P_peek_size_t(dx_plist,H5D_XFER_MAX_TEMP_BUF_NAME);
+ /* XXX: This could cause a problem if the user sets their buffer size
+ * to the same size as the default, and then the dataset elements are
+ * too large for the buffer... - QAK
+ */
if(target_size==H5D_XFER_MAX_TEMP_BUF_DEF &&
- target_size<MAX(src_type_size, dst_type_size))
+ target_size<MAX(src_type_size, dst_type_size))
target_size = MAX(src_type_size, dst_type_size);
request_nelmts = target_size / MAX (src_type_size, dst_type_size);