From 3748f79ca2f867ecd82dd159822918ad99059320 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 7 Jul 1998 17:12:24 -0500 Subject: [svn-r463] H5S.c: Moved the source of H5S_extent_npoints before H5Sextent_npoints to reduce a compiler complaint. H5Shyper.c: H5Sprivate.h: H5Spublic.h: H5Sselect.c: Changed the parameter declarations of H5S_hyper_add and H5Sselect_hyperslab as originally intended as const hsize *. --- src/H5S.c | 71 ++++++++++++++++++++++++++++---------------------------- src/H5Shyper.c | 8 +++---- src/H5Sprivate.h | 2 +- src/H5Spublic.h | 5 ++-- src/H5Sselect.c | 20 +++++++++------- 5 files changed, 55 insertions(+), 51 deletions(-) diff --git a/src/H5S.c b/src/H5S.c index 54bb777..632ab4f 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -425,41 +425,6 @@ H5S_t * H5S_copy(const H5S_t *src) FUNC_LEAVE(dst); } - -/*------------------------------------------------------------------------- - * Function: H5Sextent_npoints - * - * Purpose: Determines how many data points a dataset extent has. - * - * Return: Success: Number of data points in the dataset. - * - * Failure: 0 - * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * - * Modifications: - * Changed Name - QAK 7/7/98 - * - *------------------------------------------------------------------------- - */ -hsize_t -H5Sextent_npoints (hid_t space_id) -{ - H5S_t *ds = NULL; - hsize_t ret_value = 0; - - FUNC_ENTER(H5Sextent_npoints, 0); - H5TRACE1("h","i",space_id); - - /* Check args */ - if (H5_DATASPACE != H5I_group(space_id) || NULL == (ds = H5I_object(space_id))) { - HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space"); - } - ret_value = H5S_extent_npoints(ds); - - FUNC_LEAVE(ret_value); -} /*------------------------------------------------------------------------- @@ -513,6 +478,42 @@ H5S_extent_npoints(const H5S_t *ds) FUNC_LEAVE(ret_value); } + + +/*------------------------------------------------------------------------- + * Function: H5Sextent_npoints + * + * Purpose: Determines how many data points a dataset extent has. + * + * Return: Success: Number of data points in the dataset. + * + * Failure: 0 + * + * Programmer: Robb Matzke + * Tuesday, December 9, 1997 + * + * Modifications: + * Changed Name - QAK 7/7/98 + * + *------------------------------------------------------------------------- + */ +hsize_t +H5Sextent_npoints (hid_t space_id) +{ + H5S_t *ds = NULL; + hsize_t ret_value = 0; + + FUNC_ENTER(H5Sextent_npoints, 0); + H5TRACE1("h","i",space_id); + + /* Check args */ + if (H5_DATASPACE != H5I_group(space_id) || NULL == (ds = H5I_object(space_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space"); + } + ret_value = H5S_extent_npoints(ds); + + FUNC_LEAVE(ret_value); +} /*------------------------------------------------------------------------- * Function: H5S_get_npoints_max diff --git a/src/H5Shyper.c b/src/H5Shyper.c index b38c341..2d7a4b4 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1155,9 +1155,9 @@ static intn H5S_hyper_bsearch(hssize_t size, H5S_hyper_bound_t *barr, size_t cou Add a block to hyperslab selection USAGE herr_t H5S_hyper_add(space, start, size) - H5S_t *space; IN: Pointer to dataspace - hssize_t *start; IN: Offset of block - hssize_t *size; IN: Size of block + H5S_t *space; IN: Pointer to dataspace + const hssize_t *start; IN: Offset of block + const hsize_t *size; IN: Size of block RETURNS SUCCEED/FAIL DESCRIPTION @@ -1168,7 +1168,7 @@ static intn H5S_hyper_bsearch(hssize_t size, H5S_hyper_bound_t *barr, size_t cou REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_hyper_add (H5S_t *space, hssize_t *start, hssize_t *size) +H5S_hyper_add (H5S_t *space, const hssize_t *start, const hsize_t *size) { H5S_hyper_node_t *slab; /* New hyperslab node to insert */ H5S_hyper_bound_t *tmp; /* Temporary pointer to an hyperslab bound array */ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 74a6187..fc7546f 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -326,7 +326,7 @@ size_t H5S_hyper_mgath (const void *_buf, size_t elmt_size, herr_t H5S_hyper_mscat (const void *_tconv_buf, size_t elmt_size, const H5S_t *mem_space, H5S_sel_iter_t *mem_iter, size_t nelmts, void *_buf/*out*/); -herr_t H5S_hyper_add (H5S_t *space, hssize_t *start, hssize_t *size); +herr_t H5S_hyper_add (H5S_t *space, const hssize_t *start, const hsize_t *size); herr_t H5S_hyper_release (H5S_t *space); hsize_t H5S_hyper_npoints (const H5S_t *space); diff --git a/src/H5Spublic.h b/src/H5Spublic.h index b7c0f01..b08b489 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -54,8 +54,9 @@ int H5Sget_dims (hid_t space_id, hsize_t dims[], hsize_t maxdims[]); hbool_t H5Sis_simple (hid_t space_id); herr_t H5Sset_space (hid_t space_id, int rank, const hsize_t *dims); hsize_t H5Sselect_npoints (hid_t spaceid); -herr_t H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, hssize_t *start, - hssize_t *_stride, hssize_t *count, hssize_t *_block); +herr_t H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, + const hssize_t *start, const hsize_t *_stride, const hsize_t *count, + const hsize_t *_block); #ifdef __cplusplus } diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 348b7ce..b089a43 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -159,10 +159,10 @@ H5S_select_release (H5S_t *space) herr_t H5Sselect_hyperslab(dsid, op, start, stride, count, block) hid_t dsid; IN: Dataspace ID of selection to modify H5S_seloper_t op; IN: Operation to perform on current selection - hssize_t *start; IN: Offset of start of hyperslab - hssize_t *stride; IN: Hyperslab stride - hssize_t *count; IN: Number of blocks included in hyperslab - hssize_t *block; IN: Size of block in hyperslab + const hssize_t *start; IN: Offset of start of hyperslab + const hssize_t *stride; IN: Hyperslab stride + const hssize_t *count; IN: Number of blocks included in hyperslab + const hssize_t *block; IN: Size of block in hyperslab RETURNS SUCCEED/FAIL DESCRIPTION @@ -177,11 +177,13 @@ H5S_select_release (H5S_t *space) EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -herr_t H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, hssize_t *start, - hssize_t *_stride, hssize_t *count, hssize_t *_block) +herr_t +H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, + const hssize_t *start, const hsize_t *_stride, const hsize_t *count, + const hsize_t *_block) { H5S_t *space = NULL; /* Dataspace to modify selection of */ - hssize_t *stride, /* Stride array */ + hsize_t *stride, /* Stride array */ *block; /* Block size array */ uintn contig; /* whether selection is contiguous or not */ int i; /* Counters */ @@ -211,7 +213,7 @@ herr_t H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, hssize_t *start, "can't allocate stride vector"); H5V_array_fill(stride,&fill,sizeof(hssize_t),space->extent.u.simple.rank); } else { - stride=_stride; + stride=(hsize_t *)_stride; } /* end else */ /* Fill in the correct block values */ @@ -223,7 +225,7 @@ herr_t H5Sselect_hyperslab (hid_t spaceid, H5S_seloper_t op, hssize_t *start, "can't allocate stride vector"); H5V_array_fill(block,&fill,sizeof(hssize_t),space->extent.u.simple.rank); } else { - block=_block; + block=(hsize_t *)_block; } /* end else */ /* Check for overlapping blocks (remove when real block-merging algorithm is in place) */ -- cgit v0.12