summaryrefslogtreecommitdiffstats
path: root/src/H5Sall.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2019-11-26 17:38:25 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2019-11-26 17:38:25 (GMT)
commit9f61c26927ac74c4498cbebd7c9f2166d5f5b786 (patch)
tree81df83e8c53a80b61365d579b26aeb9532fe493f /src/H5Sall.c
parent5f3414e4d908fcdc8f3d31c624c4c157d87161e8 (diff)
parent4e12984b77cdd7615843d94f8de8d54db27476ac (diff)
downloadhdf5-9f61c26927ac74c4498cbebd7c9f2166d5f5b786.zip
hdf5-9f61c26927ac74c4498cbebd7c9f2166d5f5b786.tar.gz
hdf5-9f61c26927ac74c4498cbebd7c9f2166d5f5b786.tar.bz2
Merge pull request #2045 in HDFFV/hdf5 from ~NFORTNE2/hdf5_naf:select_adjust to develop
* commit '4e12984b77cdd7615843d94f8de8d54db27476ac': Move checking for zero offset in selection adjust calls to the selection callbacks. This makes the procedure for checking it consistent across selection types and between _s and _u, ensures it is always is performed even when called within the H5S package, and removes the redundant check that would occur when callins H5S_select_adjust_s() from outside the H5S package. Replace H5Sselect_adjust_u() and H5Shyper_adjust_s() with H5Sselect_adjust. Implement "adjust_s" callback for all selection types. Add range checking to H5Sselect_adjust().
Diffstat (limited to 'src/H5Sall.c')
-rw-r--r--src/H5Sall.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c
index 9d0a65a..4a4245d 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -66,6 +66,7 @@ static htri_t H5S__all_shape_same(const H5S_t *space1, const H5S_t *space2);
static htri_t H5S__all_intersect_block(const H5S_t *space, const hsize_t *start,
const hsize_t *end);
static herr_t H5S__all_adjust_u(H5S_t *space, const hsize_t *offset);
+static herr_t H5S__all_adjust_s(H5S_t *space, const hssize_t *offset);
static herr_t H5S__all_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S__all_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
static herr_t H5S__all_iter_init(const H5S_t *space, H5S_sel_iter_t *iter);
@@ -112,6 +113,7 @@ const H5S_select_class_t H5S_sel_all[1] = {{
H5S__all_shape_same,
H5S__all_intersect_block,
H5S__all_adjust_u,
+ H5S__all_adjust_s,
H5S__all_project_scalar,
H5S__all_project_simple,
H5S__all_iter_init,
@@ -1043,6 +1045,37 @@ H5S__all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *off
} /* end H5S__all_adjust_u() */
+/*--------------------------------------------------------------------------
+ NAME
+ H5S__all_adjust_s
+ PURPOSE
+ Adjust an "all" selection by subtracting an offset
+ USAGE
+ herr_t H5S__all_adjust_u(space, offset)
+ H5S_t *space; IN/OUT: Pointer to dataspace to adjust
+ const hssize_t *offset; IN: Offset to subtract
+ RETURNS
+ Non-negative on success, negative on failure
+ DESCRIPTION
+ Moves selection by subtracting an offset from it.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+static herr_t
+H5S__all_adjust_s(H5S_t H5_ATTR_UNUSED *space, const hssize_t H5_ATTR_UNUSED *offset)
+{
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Check args */
+ HDassert(space);
+ HDassert(offset);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5S__all_adjust_s() */
+
+
/*-------------------------------------------------------------------------
* Function: H5S__all_project_scalar
*