summaryrefslogtreecommitdiffstats
path: root/src/H5Pdcpl.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-07-31 17:47:14 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-07-31 17:47:14 (GMT)
commit679a25a7c437355df289dfd3fbb18a7dfb65d9e8 (patch)
treed55a98be6d51ac38a4f8818c4b44e24ab8720a9b /src/H5Pdcpl.c
parent49076d6d229abdf59cccac47a86431c977a60037 (diff)
downloadhdf5-679a25a7c437355df289dfd3fbb18a7dfb65d9e8.zip
hdf5-679a25a7c437355df289dfd3fbb18a7dfb65d9e8.tar.gz
hdf5-679a25a7c437355df289dfd3fbb18a7dfb65d9e8.tar.bz2
[svn-r27450] Add descriptions for all non-public functions.
Other comments. Add some input checking. Tested: ummon
Diffstat (limited to 'src/H5Pdcpl.c')
-rw-r--r--src/H5Pdcpl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index bc32274..f687104 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -1805,6 +1805,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
H5O_layout_t layout; /* Layout information for setting chunk info */
H5S_t *vspace; /* Virtual dataset space selection */
H5S_t *src_space; /* Source dataset space selection */
+ hssize_t nelmts; /* Number of elements */
hbool_t new_layout = FALSE; /* Whether we are adding a new virtual layout message to plist */
H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */
hbool_t adding_entry = FALSE; /* Whether we are in the middle of adding an entry */
@@ -1824,9 +1825,14 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(NULL == (src_space = (H5S_t *)H5I_object_verify(src_space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
-
- //VDSINC add check for overlapping virtual spaces and same number of
- // elements in vspace and src_space
+ nelmts = H5S_GET_SELECT_NPOINTS(vspace);
+ if((nelmts != H5S_UNLIMITED)
+ && (nelmts != H5S_GET_SELECT_NPOINTS(src_space)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "virtual and source space selections have different numbers of elements")
+ /* Check for unlimited selections having the same number of elements in the
+ * non-unlimited dimensions, and check for printf selections having the
+ * correct numbers of elements and unlimited/non-unlimited dimensions VDSINC
+ */
#ifndef H5_HAVE_C99_DESIGNATED_INITIALIZER
/* If the compiler doesn't support C99 designated initializers, check if