summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-20 17:11:38 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-20 17:11:38 (GMT)
commitf75ed67d2b624fa4b72207eba13c9f0a34605a47 (patch)
treef068dbef01150f075faffa6faf2de290d9c7e8b3 /src
parent7547be91e5d7545dae1db0ee78e4f20661e4bddb (diff)
downloadhdf5-f75ed67d2b624fa4b72207eba13c9f0a34605a47.zip
hdf5-f75ed67d2b624fa4b72207eba13c9f0a34605a47.tar.gz
hdf5-f75ed67d2b624fa4b72207eba13c9f0a34605a47.tar.bz2
[svn-r8902] Purpose:
Bug fix Description: Allow buffer parameter to H5Dread & H5Dwrite to be NULL if there are no elements to transfer. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5Dio.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index a684329..e224fea 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -481,7 +481,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
else
if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms")
- if (!buf)
+ if (!buf && H5S_GET_SELECT_NPOINTS(file_space)!=0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer")
/* read raw data */
@@ -569,7 +569,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
else
if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms")
- if (!buf)
+ if (!buf && H5S_GET_SELECT_NPOINTS(file_space)!=0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer")
/* write raw data */
@@ -650,7 +650,6 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* check args */
assert(dataset && dataset->ent.file);
- assert(buf);
/* Get memory datatype */
if (NULL == (mem_type = H5I_object_verify(mem_type_id, H5I_DATATYPE)))
@@ -821,8 +820,7 @@ done:
* Removed the must_convert parameter and move preconditions to
* H5S_<foo>_opt_possible() routine
*
- * Nat Furrer and James Laird
- * June 17, 2004
+ * Nat Furrer and James Laird, 2004/6/7
* Added check for filter encode capability
*-------------------------------------------------------------------------
*/
@@ -848,7 +846,6 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* check args */
assert(dataset && dataset->ent.file);
- assert(buf);
/* Get the memory datatype */
if (NULL == (mem_type = H5I_object_verify(mem_type_id, H5I_DATATYPE)))