diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 16:47:45 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 16:47:45 (GMT) |
commit | 1ba1f2f3222cbe8df0bf601929a4bffd478d7e02 (patch) | |
tree | ae51dfc33cf40432dad25a5088767115a98f195e /src/H5Sall.c | |
parent | 8eef7d295cc3dd134aef0a826f1de4287629996d (diff) | |
download | hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.zip hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.gz hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.bz2 |
Source formatted
Diffstat (limited to 'src/H5Sall.c')
-rw-r--r-- | src/H5Sall.c | 258 |
1 files changed, 115 insertions, 143 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c index 86ab0d8..d071a88 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -18,45 +18,43 @@ * Purpose: "All" selection data space I/O functions. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ +#define H5S_PACKAGE /*suppress error about including H5Spkg */ - -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* ID Functions */ -#include "H5Spkg.h" /* Dataspace functions */ -#include "H5VMprivate.h" /* Vector functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* ID Functions */ +#include "H5Spkg.h" /* Dataspace functions */ +#include "H5VMprivate.h" /* Vector functions */ /* Static function prototypes */ /* Selection callbacks */ -static herr_t H5S_all_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); -static herr_t H5S_all_get_seq_list(const H5S_t *space, unsigned flags, - H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes, - size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); -static herr_t H5S_all_release(H5S_t *space); -static htri_t H5S_all_is_valid(const H5S_t *space); +static herr_t H5S_all_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +static herr_t H5S_all_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter, size_t maxseq, + size_t maxbytes, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); +static herr_t H5S_all_release(H5S_t *space); +static htri_t H5S_all_is_valid(const H5S_t *space); static hssize_t H5S_all_serial_size(const H5S_t *space); -static herr_t H5S_all_serialize(const H5S_t *space, uint8_t *buf); -static herr_t H5S_all_deserialize(H5S_t *space, const uint8_t *buf); -static herr_t H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); -static herr_t H5S_all_offset(const H5S_t *space, hsize_t *off); -static htri_t H5S_all_is_contiguous(const H5S_t *space); -static htri_t H5S_all_is_single(const H5S_t *space); -static htri_t H5S_all_is_regular(const H5S_t *space); -static herr_t H5S_all_adjust_u(H5S_t *space, const hsize_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(H5S_sel_iter_t *iter, const H5S_t *space); +static herr_t H5S_all_serialize(const H5S_t *space, uint8_t *buf); +static herr_t H5S_all_deserialize(H5S_t *space, const uint8_t *buf); +static herr_t H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); +static herr_t H5S_all_offset(const H5S_t *space, hsize_t *off); +static htri_t H5S_all_is_contiguous(const H5S_t *space); +static htri_t H5S_all_is_single(const H5S_t *space); +static htri_t H5S_all_is_regular(const H5S_t *space); +static herr_t H5S_all_adjust_u(H5S_t *space, const hsize_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(H5S_sel_iter_t *iter, const H5S_t *space); /* Selection iteration callbacks */ -static herr_t H5S_all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); -static herr_t H5S_all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); +static herr_t H5S_all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); +static herr_t H5S_all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); static hsize_t H5S_all_iter_nelmts(const H5S_sel_iter_t *iter); -static htri_t H5S_all_iter_has_next_block(const H5S_sel_iter_t *iter); -static herr_t H5S_all_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); -static herr_t H5S_all_iter_next_block(H5S_sel_iter_t *sel_iter); -static herr_t H5S_all_iter_release(H5S_sel_iter_t *sel_iter); +static htri_t H5S_all_iter_has_next_block(const H5S_sel_iter_t *iter); +static herr_t H5S_all_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); +static herr_t H5S_all_iter_next_block(H5S_sel_iter_t *sel_iter); +static herr_t H5S_all_iter_release(H5S_sel_iter_t *sel_iter); /* Selection properties for "all" selections */ const H5S_select_class_t H5S_sel_all[1] = {{ @@ -95,7 +93,6 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{ H5S_all_iter_release, }}; - /*------------------------------------------------------------------------- * Function: H5S_all_iter_init * @@ -111,28 +108,27 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{ *------------------------------------------------------------------------- */ static herr_t -H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space) +H5S_all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space)); - HDassert (iter); + HDassert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); + HDassert(iter); /* Initialize the number of elements to iterate over */ - iter->elmt_left=H5S_GET_SELECT_NPOINTS(space); + iter->elmt_left = H5S_GET_SELECT_NPOINTS(space); /* Start at the upper left location */ - iter->u.all.elmt_offset=0; - iter->u.all.byte_offset=0; + iter->u.all.elmt_offset = 0; + iter->u.all.byte_offset = 0; /* Initialize type of selection iterator */ - iter->type=H5S_sel_iter_all; + iter->type = H5S_sel_iter_all; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_iter_init() */ +} /* H5S_all_iter_init() */ - /*------------------------------------------------------------------------- * Function: H5S_all_iter_coords * @@ -149,25 +145,24 @@ H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space) *------------------------------------------------------------------------- */ static herr_t -H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) +H5S_all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert (iter); - HDassert (coords); + HDassert(iter); + HDassert(coords); /* Calculate the coordinates for the current iterator offset */ - if(H5VM_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0) + if (H5VM_array_calc(iter->u.all.elmt_offset, iter->rank, iter->dims, coords) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve coordinates"); done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_all_iter_coords() */ +} /* H5S_all_iter_coords() */ - /*------------------------------------------------------------------------- * Function: H5S_all_iter_block * @@ -184,31 +179,30 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) +H5S_all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert (iter); - HDassert (start); - HDassert (end); + HDassert(iter); + HDassert(start); + HDassert(end); - for(u=0; u<iter->rank; u++) { + for (u = 0; u < iter->rank; u++) { /* Set the start of the 'all' block */ /* (Always '0' coordinates for now) */ - start[u]=0; + start[u] = 0; /* Compute the end of the 'all' block */ /* (Always size of the extent for now) */ - end[u]=iter->dims[u]-1; + end[u] = iter->dims[u] - 1; } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_iter_coords() */ +} /* H5S_all_iter_coords() */ - /*------------------------------------------------------------------------- * Function: H5S_all_iter_nelmts * @@ -224,17 +218,16 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) *------------------------------------------------------------------------- */ static hsize_t -H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) +H5S_all_iter_nelmts(const H5S_sel_iter_t *iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert (iter); + HDassert(iter); FUNC_LEAVE_NOAPI(iter->elmt_left) -} /* H5S_all_iter_nelmts() */ +} /* H5S_all_iter_nelmts() */ - /*-------------------------------------------------------------------------- NAME H5S_all_iter_next @@ -253,17 +246,16 @@ H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_iter_has_next_block (const H5S_sel_iter_t H5_ATTR_UNUSED *iter) +H5S_all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert (iter); + HDassert(iter); FUNC_LEAVE_NOAPI(FALSE) -} /* H5S_all_iter_has_next_block() */ +} /* H5S_all_iter_has_next_block() */ - /*-------------------------------------------------------------------------- NAME H5S_all_iter_next @@ -288,17 +280,16 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert (iter); - HDassert (nelem>0); + HDassert(iter); + HDassert(nelem > 0); /* Increment the iterator */ - iter->u.all.elmt_offset+=nelem; - iter->u.all.byte_offset+=(nelem*iter->elmt_size); + iter->u.all.elmt_offset += nelem; + iter->u.all.byte_offset += (nelem * iter->elmt_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_iter_next() */ +} /* H5S_all_iter_next() */ - /*-------------------------------------------------------------------------- NAME H5S_all_iter_next_block @@ -322,12 +313,11 @@ H5S_all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert (iter); + HDassert(iter); FUNC_LEAVE_NOAPI(FAIL) -} /* H5S_all_iter_next_block() */ +} /* H5S_all_iter_next_block() */ - /*-------------------------------------------------------------------------- NAME H5S_all_iter_release @@ -346,17 +336,16 @@ H5S_all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_iter_release (H5S_sel_iter_t H5_ATTR_UNUSED * iter) +H5S_all_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED *iter) { FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert (iter); + HDassert(iter); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_iter_release() */ +} /* H5S_all_iter_release() */ - /*-------------------------------------------------------------------------- NAME H5S_all_release @@ -386,9 +375,8 @@ H5S_all_release(H5S_t *space) space->select.num_elem = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_release() */ +} /* H5S_all_release() */ - /*-------------------------------------------------------------------------- NAME H5S_all_copy @@ -422,7 +410,6 @@ H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S_all_copy() */ - /*-------------------------------------------------------------------------- NAME H5S_all_is_valid @@ -444,7 +431,7 @@ H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_valid (const H5S_t H5_ATTR_UNUSED *space) +H5S_all_is_valid(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -453,7 +440,6 @@ H5S_all_is_valid (const H5S_t H5_ATTR_UNUSED *space) FUNC_LEAVE_NOAPI(TRUE) } /* end H5S_all_is_valid() */ - /*-------------------------------------------------------------------------- NAME H5S_all_serial_size @@ -474,7 +460,7 @@ H5S_all_is_valid (const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space) +H5S_all_serial_size(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -487,7 +473,6 @@ H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space) FUNC_LEAVE_NOAPI(16) } /* end H5S_all_serial_size() */ - /*-------------------------------------------------------------------------- NAME H5S_all_serialize @@ -508,22 +493,21 @@ H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_serialize (const H5S_t *space, uint8_t *buf) +H5S_all_serialize(const H5S_t *space, uint8_t *buf) { FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); /* Store the preamble information */ - UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(buf, (uint32_t)H5S_ALL_VERSION_1); /* Store the version number */ - UINT32ENCODE(buf, (uint32_t)0); /* Store the un-used padding */ - UINT32ENCODE(buf, (uint32_t)0); /* Store the additional information length */ + UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(buf, (uint32_t)H5S_ALL_VERSION_1); /* Store the version number */ + UINT32ENCODE(buf, (uint32_t)0); /* Store the un-used padding */ + UINT32ENCODE(buf, (uint32_t)0); /* Store the additional information length */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_serialize() */ +} /* H5S_all_serialize() */ - /*-------------------------------------------------------------------------- NAME H5S_all_deserialize @@ -548,7 +532,7 @@ H5S_all_deserialize(H5S_t *space, const uint8_t *buf) { uint32_t version; /* Decoded version */ uint8_t *p; /* Temporary pointer to buf */ - herr_t ret_value; /* return value */ + herr_t ret_value; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -559,18 +543,17 @@ H5S_all_deserialize(H5S_t *space, const uint8_t *buf) /* Decode version */ UINT32DECODE(p, version); - if(version < H5S_ALL_VERSION_1 || version > H5S_ALL_VERSION_LATEST) + if (version < H5S_ALL_VERSION_1 || version > H5S_ALL_VERSION_LATEST) HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for all selection") /* Change to "all" selection */ - if((ret_value = H5S_select_all(space, TRUE)) < 0) + if ((ret_value = H5S_select_all(space, TRUE)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_all_deserialize() */ +} /* H5S_all_deserialize() */ - /*-------------------------------------------------------------------------- NAME H5S_all_bounds @@ -599,8 +582,8 @@ done: static herr_t H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) { - unsigned rank; /* Dataspace rank */ - unsigned i; /* index variable */ + unsigned rank; /* Dataspace rank */ + unsigned i; /* index variable */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -612,15 +595,14 @@ H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) rank = space->extent.rank; /* Just copy over the complete extent */ - for(i = 0; i < rank; i++) { + for (i = 0; i < rank; i++) { start[i] = 0; - end[i] = space->extent.size[i] - 1; + end[i] = space->extent.size[i] - 1; } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_bounds() */ +} /* H5S_all_bounds() */ - /*-------------------------------------------------------------------------- NAME H5S_all_offset @@ -653,9 +635,8 @@ H5S_all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) *offset = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_offset() */ +} /* H5S_all_offset() */ - /*-------------------------------------------------------------------------- NAME H5S_all_is_contiguous @@ -682,9 +663,8 @@ H5S_all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) HDassert(space); FUNC_LEAVE_NOAPI(TRUE) -} /* H5S_all_is_contiguous() */ +} /* H5S_all_is_contiguous() */ - /*-------------------------------------------------------------------------- NAME H5S_all_is_single @@ -711,9 +691,8 @@ H5S_all_is_single(const H5S_t H5_ATTR_UNUSED *space) HDassert(space); FUNC_LEAVE_NOAPI(TRUE) -} /* H5S_all_is_single() */ +} /* H5S_all_is_single() */ - /*-------------------------------------------------------------------------- NAME H5S_all_is_regular @@ -742,9 +721,8 @@ H5S_all_is_regular(const H5S_t H5_ATTR_UNUSED *space) HDassert(space); FUNC_LEAVE_NOAPI(TRUE) -} /* H5S_all_is_regular() */ +} /* H5S_all_is_regular() */ - /*-------------------------------------------------------------------------- NAME H5S_all_adjust_u @@ -773,9 +751,8 @@ H5S_all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offs HDassert(offset); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_adjust_u() */ +} /* H5S_all_adjust_u() */ - /*------------------------------------------------------------------------- * Function: H5S_all_project_scalar * @@ -802,9 +779,8 @@ H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) *offset = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_project_scalar() */ +} /* H5S_all_project_scalar() */ - /*------------------------------------------------------------------------- * Function: H5S_all_project_simple * @@ -821,7 +797,7 @@ H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) static herr_t H5S_all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offset) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -831,14 +807,13 @@ H5S_all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offse HDassert(offset); /* Select the entire new space */ - if(H5S_select_all(new_space, TRUE) < 0) + if (H5S_select_all(new_space, TRUE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "unable to set all selection") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_all_project_simple() */ +} /* H5S_all_project_simple() */ - /*-------------------------------------------------------------------------- NAME H5S_select_all @@ -860,7 +835,7 @@ done: herr_t H5S_select_all(H5S_t *space, hbool_t rel_prev) { - herr_t ret_value = SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -868,8 +843,8 @@ H5S_select_all(H5S_t *space, hbool_t rel_prev) HDassert(space); /* Remove current selection first */ - if(rel_prev) - if(H5S_SELECT_RELEASE(space) < 0) + if (rel_prev) + if (H5S_SELECT_RELEASE(space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection") /* Set number of elements in selection */ @@ -880,9 +855,8 @@ H5S_select_all(H5S_t *space, hbool_t rel_prev) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_select_all() */ +} /* H5S_select_all() */ - /*-------------------------------------------------------------------------- NAME H5Sselect_all @@ -910,18 +884,17 @@ H5Sselect_all(hid_t spaceid) H5TRACE1("e", "i", spaceid); /* Check args */ - if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) + if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* Call internal routine to do the work */ - if(H5S_select_all(space, TRUE) < 0) + if (H5S_select_all(space, TRUE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") done: FUNC_LEAVE_API(ret_value) -} /* H5Sselect_all() */ +} /* H5Sselect_all() */ - /*-------------------------------------------------------------------------- NAME H5S_all_get_seq_list @@ -955,42 +928,41 @@ done: --------------------------------------------------------------------------*/ static herr_t H5S_all_get_seq_list(const H5S_t H5_ATTR_UNUSED *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter, - size_t H5_ATTR_UNUSED maxseq, size_t maxelem, size_t *nseq, size_t *nelem, - hsize_t *off, size_t *len) + size_t H5_ATTR_UNUSED maxseq, size_t maxelem, size_t *nseq, size_t *nelem, hsize_t *off, + size_t *len) { - size_t elem_used; /* The number of elements used */ + size_t elem_used; /* The number of elements used */ FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); HDassert(iter); - HDassert(maxseq>0); - HDassert(maxelem>0); + HDassert(maxseq > 0); + HDassert(maxelem > 0); HDassert(nseq); HDassert(nelem); HDassert(off); HDassert(len); /* Determine the actual number of elements to use */ - H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t); - elem_used=MIN(maxelem,(size_t)iter->elmt_left); + H5_CHECK_OVERFLOW(iter->elmt_left, hsize_t, size_t); + elem_used = MIN(maxelem, (size_t)iter->elmt_left); /* Compute the offset in the dataset */ - off[0]=iter->u.all.byte_offset; - len[0]=elem_used*iter->elmt_size; + off[0] = iter->u.all.byte_offset; + len[0] = elem_used * iter->elmt_size; /* Should only need one sequence for 'all' selections */ - *nseq=1; + *nseq = 1; /* Set the number of elements used */ - *nelem=elem_used; + *nelem = elem_used; /* Update the iterator */ - iter->elmt_left-=elem_used; - iter->u.all.elmt_offset+=elem_used; - iter->u.all.byte_offset+=len[0]; + iter->elmt_left -= elem_used; + iter->u.all.elmt_offset += elem_used; + iter->u.all.byte_offset += len[0]; FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S_all_get_seq_list() */ - |