summaryrefslogtreecommitdiffstats
path: root/src/H5Snone.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-20 15:32:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-20 15:32:09 (GMT)
commit910e19c646f7ca16a1415f2e64f745b43013cded (patch)
tree677d6f241120e73a73102dbbd256a6e1d6a125cc /src/H5Snone.c
parentacb2b222a8d4ad7a5f4a5ce94c7e86ea8522b957 (diff)
downloadhdf5-910e19c646f7ca16a1415f2e64f745b43013cded.zip
hdf5-910e19c646f7ca16a1415f2e64f745b43013cded.tar.gz
hdf5-910e19c646f7ca16a1415f2e64f745b43013cded.tar.bz2
[svn-r8544] Purpose:
Code optimization Description: Expand the use of macros to inline trivial function pointer lookup and calls to reduce the overall number of functions invoked during normal operation of the library. Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.9 (sleipnir) w/parallel Too minor to require h5committest
Diffstat (limited to 'src/H5Snone.c')
-rw-r--r--src/H5Snone.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/H5Snone.c b/src/H5Snone.c
index 1e6a1d5..4409d2b 100644
--- a/src/H5Snone.c
+++ b/src/H5Snone.c
@@ -320,35 +320,39 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_none_npoints
+ H5S_none_copy
PURPOSE
- Compute number of elements in current selection
+ Copy a selection from one dataspace to another
USAGE
- hsize_t H5S_none_npoints(space)
- H5S_t *space; IN: Pointer to dataspace
+ herr_t H5S_none_copy(dst, src)
+ H5S_t *dst; OUT: Pointer to the destination dataspace
+ H5S_t *src; IN: Pointer to the source dataspace
RETURNS
- The number of elements in selection on success, 0 on failure
+ Non-negative on success/Negative on failure
DESCRIPTION
- Compute number of elements in current selection. For "none" selections,
- this is always 0.
+ Copies the 'none' selection information from the source
+ dataspace to the destination dataspace.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-hsize_t
-H5S_none_npoints (const H5S_t UNUSED *space)
+herr_t
+H5S_none_copy (H5S_t *dst, const H5S_t *src)
{
- hsize_t ret_value=0; /* Return value */
+ herr_t ret_value=SUCCEED; /* return value */
- FUNC_ENTER_NOAPI(H5S_none_npoints, 0);
+ FUNC_ENTER_NOAPI(H5S_none_copy, FAIL);
- /* Check args */
- assert (space);
+ assert(src);
+ assert(dst);
+
+ /* Set number of elements in selection */
+ dst->select.num_elem=0;
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* H5S_none_npoints() */
+} /* end H5S_none_copy() */
/*--------------------------------------------------------------------------
@@ -666,15 +670,17 @@ herr_t H5S_select_none (H5S_t *space)
assert(space);
/* Remove current selection first */
- if((*space->select.release)(space)<0)
+ if(H5S_SELECT_RELEASE(space)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release hyperslab");
+ /* Set number of elements in selection */
+ space->select.num_elem=0;
+
/* Set selection type */
space->select.type=H5S_SEL_NONE;
/* Set selection methods */
space->select.get_seq_list=H5S_none_get_seq_list;
- space->select.get_npoints=H5S_none_npoints;
space->select.release=H5S_none_release;
space->select.is_valid=H5S_none_is_valid;
space->select.serial_size=H5S_none_serial_size;