summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-09-28 15:27:45 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-09-28 15:27:45 (GMT)
commit453e1fa94484c9dfb0e356eeb3ab945fc26d5792 (patch)
tree3669d0ed140bafff3cd48522f1466fe59a2a3e85 /src/H5Shyper.c
parent40960e0c65137dc8156cfd1859949d7fd5254b3d (diff)
downloadhdf5-453e1fa94484c9dfb0e356eeb3ab945fc26d5792.zip
hdf5-453e1fa94484c9dfb0e356eeb3ab945fc26d5792.tar.gz
hdf5-453e1fa94484c9dfb0e356eeb3ab945fc26d5792.tar.bz2
[svn-r19484] Description:
Clean up formatting a bit. Tested on: Mac OS X/32 10.6.4 (amazon) w/debug (Too minor to require h5committest)
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c852
1 files changed, 424 insertions, 428 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 48f1064..45371dd 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -140,7 +140,7 @@ H5FL_DEFINE_STATIC(H5S_hyper_span_info_t);
static herr_t
H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned depth)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans_helper);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans_helper)
while(span) {
HDfprintf(f,"%s: depth=%u, span=%p, (%d, %d), nelem=%u, pstride=%u\n",FUNC,depth,span,(int)span->low,(int)span->high,(unsigned)span->nelem,(unsigned)span->pstride);
@@ -151,30 +151,30 @@ H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned dep
span=span->next;
} /* end while */
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
herr_t
H5S_hyper_print_spans(FILE *f, const struct H5S_hyper_span_info_t *span_lst)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans)
if(span_lst!=NULL) {
HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span_lst,span_lst->count,span_lst->scratch,span_lst->head);
H5S_hyper_print_spans_helper(f,span_lst->head,0);
} /* end if */
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
herr_t
H5S_space_print_spans(FILE *f, const H5S_t *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_space_print_spans);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_space_print_spans)
H5S_hyper_print_spans(f,space->select.sel_info.hslab->span_lst);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
static herr_t
@@ -182,7 +182,7 @@ H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const
{
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo_helper);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo_helper)
if(dinfo!=NULL) {
HDfprintf(f,"%s: %s: start=[",FUNC,field);
@@ -201,18 +201,18 @@ H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const
else
HDfprintf(f,"%s: %s==NULL\n",FUNC,field);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
herr_t
H5S_hyper_print_diminfo(FILE *f, const H5S_t *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo)
H5S_hyper_print_diminfo_helper(f,"opt_diminfo",space->extent.rank,space->select.sel_info.hslab->opt_diminfo);
H5S_hyper_print_diminfo_helper(f,"app_diminfo",space->extent.rank,space->select.sel_info.hslab->app_diminfo);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
#endif /* H5S_HYPER_DEBUG */
@@ -232,8 +232,6 @@ H5S_hyper_print_diminfo(FILE *f, const H5S_t *space)
* is used by the H5S_select_shape_same() code to avoid changing
* the rank and appearance of the selection.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -245,31 +243,31 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
unsigned u; /* Index variable */
int i; /* Index variable */
- FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_iter_init);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_iter_init)
/* Check args */
- assert(space && H5S_SEL_HYPERSLABS==H5S_GET_SELECT_TYPE(space));
- assert(iter);
+ HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space));
+ HDassert(iter);
/* Initialize the number of points to iterate over */
- iter->elmt_left=space->select.num_elem;
- iter->u.hyp.iter_rank=0;
+ iter->elmt_left = space->select.num_elem;
+ iter->u.hyp.iter_rank = 0;
/* Get the rank of the dataspace */
- rank=space->extent.rank;
+ rank = space->extent.rank;
/* Set the temporary pointer to the dimension information */
- tdiminfo=space->select.sel_info.hslab->opt_diminfo;
+ tdiminfo = space->select.sel_info.hslab->opt_diminfo;
/* Check for the special case of just one H5Sselect_hyperslab call made */
if(space->select.sel_info.hslab->diminfo_valid) {
/* Initialize the information needed for regular hyperslab I/O */
const hsize_t *mem_size; /* Temporary pointer to dataspace extent's dimension sizes */
hsize_t acc; /* Accumulator for "flattened" dimension's sizes */
- unsigned cont_dim=0; /* # of contiguous dimensions */
+ unsigned cont_dim = 0; /* # of contiguous dimensions */
/* Set the temporary pointer to the dataspace extent's dimension sizes */
- mem_size=space->extent.size;
+ mem_size = space->extent.size;
/*
* For a regular hyperslab to be contiguous up to some dimension, it
@@ -295,7 +293,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
} /* end if */
/* Check if the regular selection can be "flattened" */
- if(cont_dim>0) {
+ if(cont_dim > 0) {
unsigned last_dim_flattened = 1; /* Flag to indicate that the last dimension was flattened */
unsigned flat_rank = rank-cont_dim; /* Number of dimensions after flattening */
unsigned curr_dim; /* Current dimension */
@@ -320,7 +318,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
iter->u.hyp.diminfo[curr_dim].start = tdiminfo[i].start * acc;
/* Special case for single block regular selections */
- if(tdiminfo[i].count==1)
+ if(tdiminfo[i].count == 1)
iter->u.hyp.diminfo[curr_dim].stride = 1;
else
iter->u.hyp.diminfo[curr_dim].stride = tdiminfo[i].stride * acc;
@@ -333,7 +331,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
last_dim_flattened = 0;
/* Reset the "accumulator" for possible further dimension flattening */
- acc=1;
+ acc = 1;
} /* end if */
else {
/* All other dimensions */
@@ -351,13 +349,13 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
} /* end for */
/* Initialize "flattened" iterator offset to initial location and dataspace extent and selection information to correct values */
- for(u=0; u<flat_rank; u++)
- iter->u.hyp.off[u]=iter->u.hyp.diminfo[u].start;
+ for(u = 0; u < flat_rank; u++)
+ iter->u.hyp.off[u] = iter->u.hyp.diminfo[u].start;
} /* end if */
else {
/* Initialize position to initial location */
/* Also make local copy of the regular selection information */
- for(u=0; u<rank; u++) {
+ for(u = 0; u < rank; u++) {
/* Regular selection information */
iter->u.hyp.diminfo[u].start = tdiminfo[u].start;
iter->u.hyp.diminfo[u].stride = tdiminfo[u].stride;
@@ -365,51 +363,50 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
iter->u.hyp.diminfo[u].block = tdiminfo[u].block;
/* Position information */
- iter->u.hyp.off[u]=tdiminfo[u].start;
+ iter->u.hyp.off[u] = tdiminfo[u].start;
} /* end if */
} /* end else */
/* Flag the diminfo information as valid in the iterator */
- iter->u.hyp.diminfo_valid=TRUE;
+ iter->u.hyp.diminfo_valid = TRUE;
/* Initialize irregular region information also (for release) */
- iter->u.hyp.spans=NULL;
+ iter->u.hyp.spans = NULL;
} /* end if */
else {
/* Initialize the information needed for non-regular hyperslab I/O */
- assert(space->select.sel_info.hslab->span_lst);
+ HDassert(space->select.sel_info.hslab->span_lst);
/* Make a copy of the span tree to iterate over */
- iter->u.hyp.spans=H5S_hyper_copy_span(space->select.sel_info.hslab->span_lst);
+ iter->u.hyp.spans = H5S_hyper_copy_span(space->select.sel_info.hslab->span_lst);
/* Set the nelem & pstride values according to the element size */
H5S_hyper_span_precompute(iter->u.hyp.spans,iter->elmt_size);
/* Initialize the starting span_info's and spans */
- spans=iter->u.hyp.spans;
- for(u=0; u<rank; u++) {
+ spans = iter->u.hyp.spans;
+ for(u = 0; u < rank; u++) {
/* Set the pointers to the initial span in each dimension */
- assert(spans);
- assert(spans->head);
+ HDassert(spans);
+ HDassert(spans->head);
/* Set the pointer to the first span in the list for this node */
iter->u.hyp.span[u] = spans->head;
/* Set the initial offset to low bound of span */
- iter->u.hyp.off[u]=iter->u.hyp.span[u]->low;
+ iter->u.hyp.off[u] = iter->u.hyp.span[u]->low;
/* Get the pointer to the next level down */
- spans=spans->head->down;
+ spans = spans->head->down;
} /* end for */
/* Flag the diminfo information as not valid in the iterator */
- iter->u.hyp.diminfo_valid=FALSE;
-
+ iter->u.hyp.diminfo_valid = FALSE;
} /* end else */
/* Initialize type of selection iterator */
- iter->type=H5S_sel_iter_hyper;
+ iter->type = H5S_sel_iter_hyper;
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_iter_init() */
@@ -431,11 +428,11 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
static herr_t
H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_coords);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_coords)
/* Check args */
- assert (iter);
- assert (coords);
+ HDassert(iter);
+ HDassert(coords);
/* Copy the offset of the current point */
@@ -496,7 +493,7 @@ H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
else
HDmemcpy(coords, iter->u.hyp.off, sizeof(hsize_t) * iter->rank);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_iter_coords() */
@@ -523,12 +520,12 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_block);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_block)
/* Check args */
- assert (iter);
- assert (start);
- assert (end);
+ HDassert(iter);
+ HDassert(start);
+ HDassert(end);
/* Copy the offset of the current point */
@@ -550,7 +547,7 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
end[u]=iter->u.hyp.span[u]->high;
} /* end else */
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_iter_block() */
@@ -571,12 +568,12 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
static hsize_t
H5S_hyper_iter_nelmts (const H5S_sel_iter_t *iter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_nelmts);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_nelmts)
/* Check args */
- assert (iter);
+ HDassert(iter);
- FUNC_LEAVE_NOAPI(iter->elmt_left);
+ FUNC_LEAVE_NOAPI(iter->elmt_left)
} /* H5S_hyper_iter_nelmts() */
@@ -661,7 +658,7 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem)
int fast_dim; /* Rank of the fastest changing dimension for the dataspace */
unsigned i; /* Counters */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next)
/* Check for the special case of just one H5Sselect_hyperslab call made */
/* (i.e. a regular hyperslab selection */
@@ -826,9 +823,9 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem)
if(curr_dim>=0) {
/* Walk back down the iterator positions, reseting them */
while(curr_dim<fast_dim) {
- assert(curr_span);
- assert(curr_span->down);
- assert(curr_span->down->head);
+ HDassert(curr_span);
+ HDassert(curr_span->down);
+ HDassert(curr_span->down->head);
/* Increment current dimension */
curr_dim++;
@@ -844,12 +841,12 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem)
} /* end while */
/* Verify that the curr_span points to the fastest dim */
- assert(curr_span==ispan[fast_dim]);
+ HDassert(curr_span==ispan[fast_dim]);
} /* end if */
} /* end while */
} /* end else */
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_iter_next() */
@@ -876,7 +873,7 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
int fast_dim; /* Rank of the fastest changing dimension for the dataspace */
unsigned u; /* Counters */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next_block);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next_block)
/* Check for the special case of just one H5Sselect_hyperslab call made */
/* (i.e. a regular hyperslab selection */
@@ -1012,9 +1009,9 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
if(curr_dim>=0) {
/* Walk back down the iterator positions, reseting them */
while(curr_dim<fast_dim) {
- assert(curr_span);
- assert(curr_span->down);
- assert(curr_span->down->head);
+ HDassert(curr_span);
+ HDassert(curr_span->down);
+ HDassert(curr_span->down->head);
/* Increment current dimension */
curr_dim++;
@@ -1030,11 +1027,11 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
} /* end while */
/* Verify that the curr_span points to the fastest dim */
- assert(curr_span==ispan[fast_dim]);
+ HDassert(curr_span == ispan[fast_dim]);
} /* end if */
} /* end else */
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_iter_next() */
@@ -1058,17 +1055,17 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
static herr_t
H5S_hyper_iter_release (H5S_sel_iter_t *iter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_release);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_release)
/* Check args */
- assert (iter);
+ HDassert(iter);
/* Release the information needed for non-regular hyperslab I/O */
/* Free the copy of the selections span tree */
- if(iter->u.hyp.spans!=NULL)
+ if(iter->u.hyp.spans != NULL)
H5S_hyper_free_span_info(iter->u.hyp.spans);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_iter_release() */
@@ -1144,11 +1141,11 @@ static herr_t
H5S_hyper_span_precompute_helper (H5S_hyper_span_info_t *spans, size_t elmt_size)
{
H5S_hyper_span_t *span; /* Hyperslab span */
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_span_precompute_helper);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_span_precompute_helper)
- assert(spans);
+ HDassert(spans);
/* Check if we've already set this down span tree */
if(spans->scratch!=(H5S_hyper_span_info_t *)~((size_t)NULL)) {
@@ -1163,7 +1160,7 @@ H5S_hyper_span_precompute_helper (H5S_hyper_span_info_t *spans, size_t elmt_size
/* If there are down spans, set their scratch value also */
if(span->down!=NULL) {
if(H5S_hyper_span_precompute_helper(span->down,elmt_size)==FAIL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't reset hyperslab scratch pointer");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't reset hyperslab scratch pointer")
} /* end if */
/* Change the nelem & pstride values into bytes */
@@ -1176,7 +1173,7 @@ H5S_hyper_span_precompute_helper (H5S_hyper_span_info_t *spans, size_t elmt_size
} /* end if */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_span_precompute_helper() */
@@ -1422,7 +1419,7 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s
htri_t nest=FAIL;
htri_t ret_value=FAIL;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_cmp_spans);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_cmp_spans)
/* Check for redundant comparison */
if(span_info1==span_info2)
@@ -1441,8 +1438,8 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s
span2=span_info2->head;
/* Sanity checking */
- assert(span1);
- assert(span2);
+ HDassert(span1);
+ HDassert(span2);
/* infinite loop which must be broken out of */
while (1) {
@@ -1494,7 +1491,7 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s
} /* end else */
} /* end else */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_cmp_spans() */
@@ -1523,9 +1520,9 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info)
H5S_hyper_span_t *span, *next_span;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span_info);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span_info)
- assert(span_info);
+ HDassert(span_info);
/* Decrement the span tree's reference count */
span_info->count--;
@@ -1538,7 +1535,7 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info)
while(span!=NULL) {
next_span=span->next;
if(H5S_hyper_free_span(span)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span")
span=next_span;
} /* end while */
@@ -1547,7 +1544,7 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info)
} /* end if */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_free_span_info() */
@@ -1575,21 +1572,21 @@ H5S_hyper_free_span (H5S_hyper_span_t *span)
{
herr_t ret_value=SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span)
- assert(span);
+ HDassert(span);
/* Decrement the reference count of the 'down spans', freeing them if appropriate */
if(span->down!=NULL) {
if(H5S_hyper_free_span_info(span->down)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span tree");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span tree")
} /* end if */
/* Free this span */
span = H5FL_FREE(H5S_hyper_span_t, span);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_free_span() */
@@ -1624,14 +1621,14 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection)
const H5S_hyper_sel_t *src_hslab; /* Pointer to source hyperslab info */
herr_t ret_value=SUCCEED; /* return value */
- FUNC_ENTER_NOAPI(H5S_hyper_copy, FAIL);
+ FUNC_ENTER_NOAPI(H5S_hyper_copy, FAIL)
- assert(src);
- assert(dst);
+ HDassert(src);
+ HDassert(dst);
/* Allocate space for the hyperslab selection information */
if(NULL == (dst->select.sel_info.hslab = H5FL_MALLOC(H5S_hyper_sel_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info")
/* Set temporary pointers */
dst_hslab=dst->select.sel_info.hslab;
@@ -1662,7 +1659,7 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection)
} /* end if */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_hyper_copy() */
@@ -1696,12 +1693,12 @@ H5S_hyper_is_valid_helper (const H5S_hyper_span_info_t *spans, const hssize_t *o
htri_t tmp; /* temporary return value */
htri_t ret_value=TRUE; /* return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_is_valid_helper);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_is_valid_helper)
- assert(spans);
- assert(offset);
- assert(size);
- assert(rank<H5O_LAYOUT_NDIMS);
+ HDassert(spans);
+ HDassert(offset);
+ HDassert(size);
+ HDassert(rank < H5O_LAYOUT_NDIMS);
/* Check each point to determine whether selection+offset is within extent */
curr=spans->head;
@@ -1728,7 +1725,7 @@ H5S_hyper_is_valid_helper (const H5S_hyper_span_info_t *spans, const hssize_t *o
curr=curr->next;
} /* end while */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_hyper_is_valid_helper() */
@@ -1758,9 +1755,9 @@ H5S_hyper_is_valid (const H5S_t *space)
unsigned u; /* Counter */
htri_t ret_value=TRUE; /* return value */
- FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_valid);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_valid)
- assert(space);
+ HDassert(space);
/* Check for a "regular" hyperslab selection */
if(space->select.sel_info.hslab->diminfo_valid) {
@@ -1792,7 +1789,7 @@ H5S_hyper_is_valid (const H5S_t *space)
} /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_hyper_is_valid() */
@@ -2003,14 +2000,14 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start,
hsize_t u; /* Index variable */
herr_t ret_value=SUCCEED; /* return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_serialize_helper);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_serialize_helper)
/* Sanity checks */
- assert(spans);
- assert(start);
- assert(end);
- assert(rank<H5O_LAYOUT_NDIMS);
- assert(buf && *buf);
+ HDassert(spans);
+ HDassert(start);
+ HDassert(end);
+ HDassert(rank < H5O_LAYOUT_NDIMS);
+ HDassert(buf && *buf);
/* Walk through the list of spans, recursing or outputing them */
curr=spans->head;
@@ -2023,7 +2020,7 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start,
/* Recurse down to the next dimension */
if(H5S_hyper_serialize_helper(curr->down,start,end,rank+1,buf)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
} /* end if */
else {
/* Encode all the previous dimensions starting & ending points */
@@ -2048,7 +2045,7 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start,
} /* end while */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_serialize_helper() */
@@ -2250,17 +2247,17 @@ H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf)
unsigned i,j; /* local counting variables */
herr_t ret_value=FAIL; /* return value */
- FUNC_ENTER_NOAPI(H5S_hyper_deserialize, FAIL);
+ FUNC_ENTER_NOAPI(H5S_hyper_deserialize, FAIL)
/* Check args */
- assert(space);
- assert(buf);
+ HDassert(space);
+ HDassert(buf);
/* Deserialize slabs to select */
buf+=16; /* Skip over selection header */
UINT32DECODE(buf,rank); /* decode the rank of the point selection */
if(rank!=space->extent.rank)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of pointer does not match dataspace");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of pointer does not match dataspace")
UINT32DECODE(buf,num_elem); /* decode the number of points */
/* Set the count & stride for all blocks */
@@ -2285,11 +2282,11 @@ H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf)
/* Select or add the hyperslab to the current selection */
if((ret_value=H5S_select_hyperslab(space,(i==0 ? H5S_SELECT_SET : H5S_SELECT_OR),start,stride,count,block))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
} /* end for */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_deserialize() */
@@ -2355,7 +2352,7 @@ H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hsize_t start[], hsize_t
/* Recurse down to the next dimension */
if(H5S_hyper_span_blocklist(curr->down, start, end, (rank + 1), startblock, numblocks, buf) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
} /* end if */
else {
/* Skip this block if we haven't skipped all the startblocks yet */
@@ -2889,9 +2886,9 @@ H5S_hyper_is_contiguous(const H5S_t *space)
unsigned u; /* index variable */
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_contiguous);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_contiguous)
- assert(space);
+ HDassert(space);
/* Check for a "regular" hyperslab selection */
if(space->select.sel_info.hslab->diminfo_valid) {
@@ -3044,7 +3041,7 @@ H5S_hyper_is_contiguous(const H5S_t *space)
ret_value=TRUE;
} /* end else */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_is_contiguous() */
@@ -3074,9 +3071,9 @@ H5S_hyper_is_single(const H5S_t *space)
unsigned u; /* index variable */
htri_t ret_value=TRUE; /* return value */
- FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_single);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_single)
- assert(space);
+ HDassert(space);
/* Check for a "single" hyperslab selection */
if(space->select.sel_info.hslab->diminfo_valid) {
@@ -3112,7 +3109,7 @@ H5S_hyper_is_single(const H5S_t *space)
} /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_is_single() */
@@ -3141,10 +3138,10 @@ H5S_hyper_is_regular(const H5S_t *space)
{
htri_t ret_value; /* return value */
- FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_regular);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_regular)
/* Check args */
- assert(space);
+ HDassert(space);
/* Only simple check for regular hyperslabs for now... */
if(space->select.sel_info.hslab->diminfo_valid)
@@ -3152,7 +3149,7 @@ H5S_hyper_is_regular(const H5S_t *space)
else
ret_value=FALSE;
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_is_regular() */
@@ -3228,10 +3225,10 @@ done:
static herr_t
H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyper_span_t *next_span)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_recover_span);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_recover_span)
- assert(recover);
- assert(curr_span);
+ HDassert(recover);
+ HDassert(curr_span);
/* Check if the span should be recovered */
if(*recover) {
@@ -3242,7 +3239,7 @@ H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyp
/* Set the current span to next span */
*curr_span=next_span;
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_recover_span() */
@@ -3271,16 +3268,16 @@ H5S_hyper_coord_to_span(unsigned rank, hsize_t *coords)
H5S_hyper_span_info_t *down=NULL; /* Pointer to new span tree for next level down */
H5S_hyper_span_t *ret_value=NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_coord_to_span);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_coord_to_span)
- assert(rank>0);
- assert(coords);
+ HDassert(rank > 0);
+ HDassert(coords);
/* Search for location to insert new element in tree */
if(rank>1) {
/* Allocate a span info node */
if((down = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Set the reference count */
down->count=0;
@@ -3290,12 +3287,12 @@ H5S_hyper_coord_to_span(unsigned rank, hsize_t *coords)
/* Build span tree for coordinates below this one */
if((down->head=H5S_hyper_coord_to_span(rank-1,&coords[1]))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
} /* end if */
/* Build span for this coordinate */
if((new_span = H5S_hyper_new_span(coords[0],coords[0],down,NULL))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Set return value */
ret_value=new_span;
@@ -3306,7 +3303,7 @@ done:
H5S_hyper_free_span_info(down);
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_coord_to_span() */
@@ -3340,11 +3337,11 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
H5S_hyper_span_t *new_span; /* New span created for element */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_add_span_element_helper);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_add_span_element_helper)
- assert(span_tree);
- assert(rank>0);
- assert(coords);
+ HDassert(span_tree);
+ HDassert(rank > 0);
+ HDassert(coords);
/* Get pointer to last span in span tree */
tspan_info=span_tree;
@@ -3352,7 +3349,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
tmp_span=(H5S_hyper_span_t *)span_tree->scratch;
else {
tmp_span=span_tree->head;
- assert(tmp_span);
+ HDassert(tmp_span);
span_tree->scratch=(H5S_hyper_span_info_t *)tmp_span;
} /* end else */
@@ -3372,7 +3369,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
tmp_span=(H5S_hyper_span_t *)tspan_info->scratch;
else {
tmp_span=tspan_info->head;
- assert(tmp_span);
+ HDassert(tmp_span);
tspan_info->scratch=(H5S_hyper_span_info_t *)tmp_span;
} /* end else */
} /* end while */
@@ -3424,14 +3421,14 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
/* Make span tree for current coordinates */
if((new_span=H5S_hyper_coord_to_span(rank,coords))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Add new span tree as span */
- assert(tmp_span);
+ HDassert(tmp_span);
tmp_span->next=new_span;
/* Make scratch pointer point to last span in list */
- assert(tspan_info);
+ HDassert(tspan_info);
tspan_info->scratch=(H5S_hyper_span_info_t *)new_span;
/* Set the proper 'pstride' for new span */
@@ -3493,10 +3490,10 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
} /* end if */
else {
if((new_span = H5S_hyper_new_span(coords[0],coords[0],NULL,NULL))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Add new span tree as span */
- assert(tmp_span);
+ HDassert(tmp_span);
tmp_span->next=new_span;
/* Make scratch pointer point to last span in list */
@@ -3508,7 +3505,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
} /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_add_span_element_helper() */
@@ -3652,9 +3649,9 @@ H5S_hyper_convert(H5S_t *space)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_convert);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_convert)
- assert(space);
+ HDassert(space);
/* Check the type of selection */
switch(H5S_GET_SELECT_TYPE(space)) {
@@ -3677,7 +3674,7 @@ H5S_hyper_convert(H5S_t *space)
/* Convert to hyperslab selection */
if(H5S_select_hyperslab(space,H5S_SELECT_SET,tmp_start,tmp_stride,tmp_count,tmp_block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
} /* end case */
break;
@@ -3689,11 +3686,11 @@ H5S_hyper_convert(H5S_t *space)
case H5S_SEL_ERROR: /* Selection error */
case H5S_SEL_N: /* Selection count */
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "can't convert to span tree selection");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "can't convert to span tree selection")
} /* end switch */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_convert() */
#ifdef LATER
@@ -3724,10 +3721,10 @@ H5S_hyper_intersect_helper (H5S_hyper_span_info_t *spans1, H5S_hyper_span_info_t
htri_t status; /* Status from recursive call */
htri_t ret_value=FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_helper);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_helper)
/* Sanity check */
- assert((spans1 && spans2) || (spans1==NULL && spans2==NULL));
+ HDassert((spans1 && spans2) || (spans1 == NULL && spans2 == NULL));
/* "NULL" span trees compare as overlapping */
if(spans1==NULL && spans2==NULL)
@@ -3749,7 +3746,7 @@ H5S_hyper_intersect_helper (H5S_hyper_span_info_t *spans1, H5S_hyper_span_info_t
else {
/* Recursively check spans in next dimension down */
if((status=H5S_hyper_intersect_helper(curr1->down,curr2->down))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check")
/* If there is a span intersection in the down dimensions, the span trees overlap */
if(status==TRUE)
@@ -3764,7 +3761,7 @@ H5S_hyper_intersect_helper (H5S_hyper_span_info_t *spans1, H5S_hyper_span_info_t
} /* end while */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_intersect_helper() */
@@ -3791,27 +3788,27 @@ H5S_hyper_intersect (H5S_t *space1, H5S_t *space2)
{
htri_t ret_value=FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect)
/* Sanity check */
- assert(space1);
- assert(space2);
+ HDassert(space1);
+ HDassert(space2);
/* Check that the space selections both have span trees */
if(space1->select.sel_info.hslab->span_lst==NULL ||
space2->select.sel_info.hslab->span_lst==NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Check that the dataspaces are both the same rank */
if(space1->extent.rank!=space2->extent.rank)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "dataspace ranks don't match");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "dataspace ranks don't match")
/* Perform the span-by-span intersection check */
if((ret_value=H5S_hyper_intersect_helper(space1->select.sel_info.hslab->span_lst,space2->select.sel_info.hslab->span_lst))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_intersect() */
#endif /* LATER */
@@ -3843,12 +3840,12 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *s
htri_t status; /* Status from recursive call */
htri_t ret_value=FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block_helper);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block_helper)
/* Sanity check */
- assert(spans);
- assert(start);
- assert(end);
+ HDassert(spans);
+ HDassert(start);
+ HDassert(end);
/* Get the span list for spans in this tree */
curr=spans->head;
@@ -3869,7 +3866,7 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *s
else {
/* Recursively check spans in next dimension down */
if((status=H5S_hyper_intersect_block_helper(curr->down,start+1,end+1))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check")
/* If there is a span intersection in the down dimensions, the span trees overlap */
if(status==TRUE)
@@ -3882,7 +3879,7 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *s
} /* end while */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_intersect_block_helper() */
@@ -3910,12 +3907,12 @@ H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end)
{
htri_t ret_value=FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block)
/* Sanity check */
- assert(space);
- assert(start);
- assert(end);
+ HDassert(space);
+ HDassert(start);
+ HDassert(end);
/* Check for 'all' selection, instead of a hyperslab selection */
/* (Technically, this shouldn't be in the "hyperslab" routines...) */
@@ -3925,14 +3922,14 @@ H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end)
/* Check that the space selection has a span tree */
if(space->select.sel_info.hslab->span_lst==NULL)
if(H5S_hyper_generate_spans(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Perform the span-by-span intersection check */
if((ret_value=H5S_hyper_intersect_block_helper(space->select.sel_info.hslab->span_lst,start,end))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_intersect_block() */
@@ -3959,11 +3956,11 @@ H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset)
{
H5S_hyper_span_t *span; /* Pointer to current span in span tree */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper_u);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper_u)
/* Sanity check */
- assert(spans);
- assert(offset);
+ HDassert(spans);
+ HDassert(offset);
/* Check if we've already set this down span tree */
if(spans->scratch!=(H5S_hyper_span_info_t *)~((size_t)NULL)) {
@@ -3976,7 +3973,7 @@ H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset)
/* Iterate over the spans in tree */
while(span!=NULL) {
/* Adjust span offset */
- assert(span->low>=*offset);
+ HDassert(span->low>=*offset);
span->low-=*offset;
span->high-=*offset;
@@ -3989,7 +3986,7 @@ H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset)
} /* end while */
} /* end if */
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_adjust_helper_u() */
@@ -4017,15 +4014,15 @@ H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset)
unsigned u; /* Local index variable */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_u);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_u)
- assert(space);
- assert(offset);
+ HDassert(space);
+ HDassert(offset);
/* Subtract the offset from the "regular" coordinates, if they exist */
if(space->select.sel_info.hslab->diminfo_valid) {
for(u=0; u<space->extent.rank; u++) {
- assert(space->select.sel_info.hslab->opt_diminfo[u].start>=offset[u]);
+ HDassert(space->select.sel_info.hslab->opt_diminfo[u].start>=offset[u]);
space->select.sel_info.hslab->opt_diminfo[u].start-=offset[u];
} /* end for */
} /* end if */
@@ -4033,14 +4030,14 @@ H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset)
/* Subtract the offset from the span tree coordinates, if they exist */
if(space->select.sel_info.hslab->span_lst) {
if(H5S_hyper_adjust_helper_u(space->select.sel_info.hslab->span_lst,offset)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab offset adjustment");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab offset adjustment")
/* Reset the scratch pointers for the next routine which needs them */
H5S_hyper_span_scratch(space->select.sel_info.hslab->span_lst, NULL);
} /* end if */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_adjust_u() */
@@ -4629,7 +4626,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp
H5S_hyper_span_t *new_span = NULL;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_append_span);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_append_span)
HDassert(prev_span);
HDassert(span_tree);
@@ -4638,16 +4635,16 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp
if(*prev_span==NULL) {
/* Allocate new span node to append to list */
if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Make first node in span list */
/* Check that we haven't already allocated a span tree */
- assert(*span_tree==NULL);
+ HDassert(*span_tree==NULL);
/* Allocate a new span_info node */
if((*span_tree = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Set the span tree's basic information */
(*span_tree)->count=1;
@@ -4669,7 +4666,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp
else {
/* Allocate new span node to append to list */
if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Check if there is actually a down span */
if(new_span->down) {
@@ -4753,14 +4750,14 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_clip_spans);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_clip_spans)
/* Check args */
- assert (a_spans);
- assert (b_spans);
- assert (a_not_b);
- assert (a_and_b);
- assert (b_not_a);
+ HDassert(a_spans);
+ HDassert(b_spans);
+ HDassert(a_not_b);
+ HDassert(a_and_b);
+ HDassert(b_not_a);
/* Check if both span trees are not defined */
if(a_spans==NULL && b_spans==NULL) {
@@ -4773,12 +4770,12 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
*a_not_b=NULL;
*a_and_b=NULL;
if((*b_not_a=H5S_hyper_copy_span(b_spans))==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree")
} /* end if */
/* If span 'b' is not defined, but 'a' is, copy 'a' and set the other return span trees to empty */
else if(b_spans==NULL) {
if((*a_not_b=H5S_hyper_copy_span(a_spans))==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree")
*a_and_b=NULL;
*b_not_a=NULL;
} /* end if */
@@ -4788,7 +4785,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(H5S_hyper_cmp_spans(a_spans,b_spans)==TRUE) {
*a_not_b=NULL;
if((*a_and_b=H5S_hyper_copy_span(a_spans))==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree")
*b_not_a=NULL;
} /* end if */
else {
@@ -4815,7 +4812,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Merge/add span 'a' with/to a_not_b list */
if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Advance span 'a', leave span 'b' */
H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
@@ -4830,18 +4827,18 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Merge/add lower part of span 'a' with/to a_not_b list */
if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Check for overlaps between upper part of span 'a' and lower part of span 'b' */
/* Make certain both spans either have a down span or both don't have one */
- assert((span_a->down!=NULL && span_b->down!=NULL) || (span_a->down==NULL && span_b->down==NULL));
+ HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL));
/* If there are no down spans, just add the overlapping area to the a_and_b list */
if(span_a->down==NULL) {
/* Merge/add overlapped part with/to a_and_b list */
if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,NULL,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
} /* end if */
/* If there are down spans, check for the overlap in them and add to each appropriate list */
else {
@@ -4852,13 +4849,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Check for overlaps in the 'down spans' of span 'a' & 'b' */
if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Check for additions to the a_not_b list */
if(down_a_not_b!=NULL) {
/* Merge/add overlapped part with/to a_not_b list */
if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_a->high,down_a_not_b,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_a_not_b);
@@ -4868,7 +4865,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(down_a_and_b!=NULL) {
/* Merge/add overlapped part with/to a_and_b list */
if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,down_a_and_b,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_a_and_b);
@@ -4878,7 +4875,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(down_b_not_a!=NULL) {
/* Merge/add overlapped part with/to b_not_a list */
if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->high,down_b_not_a,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_b_not_a);
@@ -4891,7 +4888,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(span_a->high<span_b->high) {
/* Allocate new span node for upper part of span 'b' */
if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Advance span 'a' */
H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
@@ -4917,18 +4914,18 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Merge/add lower part of span 'a' with/to a_not_b list */
if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Check for overlaps between middle part of span 'a' and span 'b' */
/* Make certain both spans either have a down span or both don't have one */
- assert((span_a->down!=NULL && span_b->down!=NULL) || (span_a->down==NULL && span_b->down==NULL));
+ HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL));
/* If there are no down spans, just add the overlapping area to the a_and_b list */
if(span_a->down==NULL) {
/* Merge/add overlapped part with/to a_and_b list */
if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,NULL,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
} /* end if */
/* If there are down spans, check for the overlap in them and add to each appropriate list */
else {
@@ -4939,13 +4936,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Check for overlaps in the 'down spans' of span 'a' & 'b' */
if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Check for additions to the a_not_b list */
if(down_a_not_b!=NULL) {
/* Merge/add overlapped part with/to a_not_b list */
if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_b->high,down_a_not_b,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_a_not_b);
@@ -4955,7 +4952,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(down_a_and_b!=NULL) {
/* Merge/add overlapped part with/to a_and_b list */
if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,down_a_and_b,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_a_and_b);
@@ -4965,7 +4962,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(down_b_not_a!=NULL) {
/* Merge/add overlapped part with/to b_not_a list */
if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,down_b_not_a,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_b_not_a);
@@ -4976,7 +4973,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Allocate new span node for upper part of span 'a' */
if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Make upper part of span 'a' the new span 'a' */
H5S_hyper_recover_span(&recover_a,&span_a,tmp_span);
@@ -4996,7 +4993,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(span_a->low>span_b->low) {
/* Merge/add lower part of span 'b' with/to b_not_a list */
if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
} /* end if */
else {
/* Keep going, nothing to split off */
@@ -5005,13 +5002,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Check for overlaps between span 'a' and midle of span 'b' */
/* Make certain both spans either have a down span or both don't have one */
- assert((span_a->down!=NULL && span_b->down!=NULL) || (span_a->down==NULL && span_b->down==NULL));
+ HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL));
/* If there are no down spans, just add the overlapping area to the a_and_b list */
if(span_a->down==NULL) {
/* Merge/add overlapped part with/to a_and_b list */
if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,NULL,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
} /* end if */
/* If there are down spans, check for the overlap in them and add to each appropriate list */
else {
@@ -5022,13 +5019,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Check for overlaps in the 'down spans' of span 'a' & 'b' */
if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Check for additions to the a_not_b list */
if(down_a_not_b!=NULL) {
/* Merge/add overlapped part with/to a_not_b list */
if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,down_a_not_b,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_a_not_b);
@@ -5038,7 +5035,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(down_a_and_b!=NULL) {
/* Merge/add overlapped part with/to a_and_b list */
if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,down_a_and_b,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_a_and_b);
@@ -5048,7 +5045,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(down_b_not_a!=NULL) {
/* Merge/add overlapped part with/to b_not_a list */
if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_a->high,down_b_not_a,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_b_not_a);
@@ -5061,7 +5058,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Allocate new span node for upper part of spans 'a' */
if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* And advance span 'a' */
H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
@@ -5088,7 +5085,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Merge/add lower part of span 'b' with/to b_not_a list */
if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
} /* end if */
else {
/* Keep going, nothing to split off */
@@ -5097,13 +5094,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Check for overlaps between lower part of span 'a' and upper part of span 'b' */
/* Make certain both spans either have a down span or both don't have one */
- assert((span_a->down!=NULL && span_b->down!=NULL) || (span_a->down==NULL && span_b->down==NULL));
+ HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL));
/* If there are no down spans, just add the overlapping area to the a_and_b list */
if(span_a->down==NULL) {
/* Merge/add overlapped part with/to a_and_b list */
if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,NULL,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
} /* end if */
/* If there are down spans, check for the overlap in them and add to each appropriate list */
else {
@@ -5114,13 +5111,13 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Check for overlaps in the 'down spans' of span 'a' & 'b' */
if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Check for additions to the a_not_b list */
if(down_a_not_b!=NULL) {
/* Merge/add overlapped part with/to a_not_b list */
if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->high,down_a_not_b,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_a_not_b);
@@ -5130,7 +5127,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(down_a_and_b!=NULL) {
/* Merge/add overlapped part with/to a_and_b list */
if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,down_a_and_b,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_a_and_b);
@@ -5140,7 +5137,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
if(down_b_not_a!=NULL) {
/* Merge/add overlapped part with/to b_not_a list */
if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_b->high,down_b_not_a,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
H5S_hyper_free_span_info(down_b_not_a);
@@ -5151,7 +5148,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Allocate new span node for upper part of span 'a' */
if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Make upper part of span 'a' into new span 'a' */
H5S_hyper_recover_span(&recover_a,&span_a,tmp_span);
@@ -5169,7 +5166,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Merge/add span 'b' with/to b_not_a list */
if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Advance span 'b', leave span 'a' */
H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
@@ -5183,7 +5180,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Merge/add span 'a' with/to a_not_b list */
if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Advance to the next 'a' span */
H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
@@ -5196,7 +5193,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Merge/add span 'b' with/to b_not_a list */
if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Advance to the next 'b' span */
H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
@@ -5206,7 +5203,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
} /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_clip_spans() */
@@ -5243,10 +5240,10 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */
H5S_hyper_span_info_t *ret_value;
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_merge_spans_helper);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_merge_spans_helper)
/* Make certain both 'a' & 'b' spans have down span trees or neither does */
- assert((a_spans!=NULL && b_spans!=NULL) || (a_spans==NULL && b_spans==NULL));
+ HDassert((a_spans != NULL && b_spans != NULL) || (a_spans == NULL && b_spans == NULL));
/* Check if the span trees for the 'a' span and the 'b' span are the same */
if(H5S_hyper_cmp_spans(a_spans,b_spans)==TRUE) {
@@ -5255,7 +5252,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
else {
/* Copy one of the span trees to return */
if((merged_spans=H5S_hyper_copy_span(a_spans))==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "can't copy hyperslab span tree");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "can't copy hyperslab span tree")
} /* end else */
} /* end if */
else {
@@ -5278,7 +5275,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
if(span_a->high<span_b->low) {
/* Merge/add span 'a' with/to the merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Advance span 'a' */
H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
@@ -5293,19 +5290,19 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) {
/* Merge/add copy of span 'a' with/to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* Merge/add lower part of span 'a' with/to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Get merged span tree for overlapped section */
tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down);
/* Merge/add overlapped section to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,tmp_spans,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Release merged span tree for overlapped section */
H5S_hyper_free_span_info(tmp_spans);
@@ -5317,7 +5314,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* Allocate new span node to append to list */
if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Advance span 'a' */
H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
@@ -5342,19 +5339,19 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) {
/* Merge/add copy of lower & middle parts of span 'a' to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* Merge/add lower part of span 'a' to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Get merged span tree for overlapped section */
tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down);
/* Merge/add overlapped section to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,tmp_spans,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Release merged span tree for overlapped section */
H5S_hyper_free_span_info(tmp_spans);
@@ -5364,7 +5361,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* Allocate new span node to append to list */
if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Set new span 'a' to tmp_span */
H5S_hyper_recover_span(&recover_a,&span_a,tmp_span);
@@ -5382,14 +5379,14 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) {
/* Merge/add copy of lower & middle parts of span 'b' to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* Check if there is a lower part of span 'b' */
if(span_a->low>span_b->low) {
/* Merge/add lower part of span 'b' to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* No lower part of span 'b' , keep going... */
@@ -5400,7 +5397,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* Merge/add overlapped section to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,tmp_spans,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Release merged span tree for overlapped section */
H5S_hyper_free_span_info(tmp_spans);
@@ -5412,7 +5409,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* Allocate new span node to append to list */
if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Advance span 'a' */
H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
@@ -5437,14 +5434,14 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) {
/* Merge/add copy of span 'b' to merged spans if so */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* Check if there is a lower part of span 'b' */
if(span_a->low>span_b->low) {
/* Merge/add lower part of span 'b' to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* No lower part of span 'b' , keep going... */
@@ -5455,7 +5452,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* Merge/add overlapped section to merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,tmp_spans,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Release merged span tree for overlapped section */
H5S_hyper_free_span_info(tmp_spans);
@@ -5465,7 +5462,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* Allocate new span node to append to list */
if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Set new span 'a' to tmp_span */
H5S_hyper_recover_span(&recover_a,&span_a,tmp_span);
@@ -5481,7 +5478,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
else {
/* Merge/add span 'b' with the merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Advance span 'b' */
H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
@@ -5493,7 +5490,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
while(span_a!=NULL) {
/* Merge/add all 'a' spans into the merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Advance to next 'a' span, until all processed */
H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
@@ -5505,7 +5502,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
while(span_b!=NULL) {
/* Merge/add all 'b' spans into the merged spans */
if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Advance to next 'b' span, until all processed */
H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
@@ -5523,7 +5520,7 @@ done:
HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, NULL, "failed to release merged hyperslab spans")
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_merge_spans_helper() */
@@ -5555,11 +5552,11 @@ done:
static herr_t
H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t can_own)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_merge_spans);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_merge_spans)
/* Check args */
- assert (space);
- assert (new_spans);
+ HDassert(space);
+ HDassert(new_spans);
/* If this is the first span tree in the hyperslab selection, just use it */
if(space->select.sel_info.hslab->span_lst==NULL) {
@@ -5575,7 +5572,7 @@ H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t c
merged_spans=H5S_hyper_merge_spans_helper(space->select.sel_info.hslab->span_lst, new_spans);
/* Sanity checking since we started with some spans, we should still have some after the merge */
- assert(merged_spans);
+ HDassert(merged_spans);
/* Free the previous spans */
H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst);
@@ -5584,7 +5581,7 @@ H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t c
space->select.sel_info.hslab->span_lst=merged_spans;
} /* end else */
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5S_hyper_merge_spans() */
@@ -5611,7 +5608,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans)
H5S_hyper_span_t *span; /* Hyperslab span */
hsize_t ret_value;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_spans_nelem);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_spans_nelem)
/* Count the number of elements in the span tree */
if(spans==NULL)
@@ -5632,7 +5629,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans)
} /* end while */
} /* end else */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_spans_nelem() */
@@ -5673,7 +5670,7 @@ H5S_hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride,
unsigned u; /* Counters */
H5S_hyper_span_info_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_make_spans);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_make_spans)
/* Check args */
HDassert(rank > 0);
@@ -6004,10 +6001,10 @@ H5S_hyper_generate_spans(H5S_t *space)
unsigned u; /* Counter */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_generate_spans);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_generate_spans)
- assert(space);
- assert(H5S_GET_SELECT_TYPE(space)==H5S_SEL_HYPERSLABS);
+ HDassert(space);
+ HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS);
/* Get the diminfo */
for(u=0; u<space->extent.rank; u++) {
@@ -6019,10 +6016,10 @@ H5S_hyper_generate_spans(H5S_t *space)
/* Build the hyperslab information also */
if(H5S_generate_hyperslab (space, H5S_SELECT_SET, tmp_start, tmp_stride, tmp_count, tmp_block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_generate_spans() */
#ifndef NEW_HYPERSLAB_API
@@ -6054,25 +6051,25 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
H5S_hyper_span_info_t *b_not_a=NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab)
/* Check args */
- assert(space);
- assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID);
- assert(start);
- assert(stride);
- assert(count);
- assert(block);
+ HDassert(space);
+ HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
+ HDassert(start);
+ HDassert(stride);
+ HDassert(count);
+ HDassert(block);
/* Generate span tree for new hyperslab information */
if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information")
/* Generate list of blocks to add/remove based on selection operation */
if(op==H5S_SELECT_SET) {
/* Add new spans to current selection */
if(H5S_hyper_merge_spans(space,new_spans,TRUE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Set the number of elements in current selection */
space->select.num_elem=H5S_hyper_spans_nelem(new_spans);
@@ -6085,14 +6082,14 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Generate lists of spans which overlap and don't overlap */
if(H5S_hyper_clip_spans(space->select.sel_info.hslab->span_lst,new_spans,&a_not_b,&a_and_b,&b_not_a)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
switch(op) {
case H5S_SELECT_OR:
/* Add any new spans from b_not_a to current selection */
if(b_not_a!=NULL) {
if(H5S_hyper_merge_spans(space,b_not_a,FALSE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
space->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
@@ -6105,7 +6102,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_AND:
/* Free the current selection */
if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
space->select.sel_info.hslab->span_lst=NULL;
/* Reset the number of items in selection */
@@ -6114,7 +6111,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there are any overlapped selections */
if(a_and_b!=NULL) {
if(H5S_hyper_merge_spans(space,a_and_b,TRUE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
space->select.num_elem=H5S_hyper_spans_nelem(a_and_b);
@@ -6130,7 +6127,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_XOR:
/* Free the current selection */
if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
space->select.sel_info.hslab->span_lst=NULL;
/* Reset the number of items in selection */
@@ -6139,7 +6136,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there are any non-overlapped selections */
if(a_not_b!=NULL) {
if(H5S_hyper_merge_spans(space,a_not_b,FALSE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
space->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
@@ -6149,7 +6146,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
} /* end if */
if(b_not_a!=NULL) {
if(H5S_hyper_merge_spans(space,b_not_a,FALSE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
space->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
@@ -6162,7 +6159,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_NOTB:
/* Free the current selection */
if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
space->select.sel_info.hslab->span_lst=NULL;
/* Reset the number of items in selection */
@@ -6171,7 +6168,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there are any non-overlapped selections */
if(a_not_b!=NULL) {
if(H5S_hyper_merge_spans(space,a_not_b,TRUE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
space->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
@@ -6187,7 +6184,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_NOTA:
/* Free the current selection */
if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
space->select.sel_info.hslab->span_lst=NULL;
/* Reset the number of items in selection */
@@ -6196,7 +6193,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there are any non-overlapped selections */
if(b_not_a!=NULL) {
if(H5S_hyper_merge_spans(space,b_not_a,TRUE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
space->select.num_elem=H5S_hyper_spans_nelem(b_not_a);
@@ -6215,7 +6212,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_PREPEND:
case H5S_SELECT_INVALID:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
/* Check if the resulting hyperslab span tree is empty */
@@ -6223,11 +6220,11 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
H5S_hyper_span_info_t *spans; /* Empty hyperslab span tree */
/* Sanity check */
- assert(space->select.num_elem==0);
+ HDassert(space->select.num_elem == 0);
/* Allocate a span info node */
if((spans = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Set the reference count */
spans->count=1;
@@ -6268,7 +6265,7 @@ done:
if(H5S_hyper_free_span_info(new_spans) < 0)
HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_generate_hyperslab() */
@@ -6300,13 +6297,13 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
unsigned u; /* Counters */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL);
+ FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL)
/* Check args */
- assert(space);
- assert(start);
- assert(count);
- assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID);
+ HDassert(space);
+ HDassert(start);
+ HDassert(count);
+ HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
/* Point to the correct stride values */
if(stride==NULL)
@@ -6322,7 +6319,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
for(u=0; u<space->extent.rank; u++) {
/* Check for overlapping hyperslab blocks in new selection. */
if(count[u]>1 && stride[u]<block[u])
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab blocks overlap");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab blocks overlap")
/* Detect zero-sized hyperslabs in new selection */
if(count[u] == 0 || block[u] == 0) {
@@ -6332,7 +6329,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */
/* Convert to "none" selection */
if(H5S_select_none(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
HGOTO_DONE(SUCCEED);
case H5S_SELECT_OR: /* Binary "or" operation for hyperslabs */
@@ -6345,7 +6342,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_PREPEND:
case H5S_SELECT_INVALID:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
} /* end if */
} /* end for */
@@ -6376,7 +6373,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
if(count[u]==1)
int_stride[u]=1;
else {
- assert(stride[u]>block[u]);
+ HDassert(stride[u] > block[u]);
int_stride[u]=stride[u];
} /* end else */
int_count[u]=count[u];
@@ -6408,7 +6405,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_PREPEND:
case H5S_SELECT_INVALID:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
break;
@@ -6445,14 +6442,14 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Convert to hyperslab selection */
if(H5S_select_hyperslab(space,H5S_SELECT_SET,tmp_start,tmp_stride,tmp_count,tmp_block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
} /* end case */
break;
case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */
/* Convert to "none" selection */
if(H5S_select_none(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
HGOTO_DONE(SUCCEED);
case H5S_SELECT_NOOP:
@@ -6460,7 +6457,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_PREPEND:
case H5S_SELECT_INVALID:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
break;
@@ -6476,7 +6473,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SEL_ERROR:
case H5S_SEL_N:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
if(op == H5S_SELECT_SET) {
@@ -6571,7 +6568,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Sselect_hyperslab, FAIL);
+ FUNC_ENTER_API(H5Sselect_hyperslab, FAIL)
H5TRACE6("e", "iSs*h*h*h*h", space_id, op, start, stride, count, block);
/* Check args */
@@ -6589,15 +6586,15 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
/* Check for 0-sized strides */
for(u=0; u<space->extent.rank; u++) {
if(stride[u]==0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value")
} /* end for */
} /* end if */
if (H5S_select_hyperslab(space, op, start, stride, count, block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
} /* end H5Sselect_hyperslab() */
#else /* NEW_HYPERSLAB_API */ /* Works */
@@ -6625,18 +6622,18 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
H5S_hyper_span_info_t *b_not_a=NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_operate_hyperslab);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_operate_hyperslab)
/* Check args */
- assert(result);
- assert(spans2);
- assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID);
+ HDassert(result);
+ HDassert(spans2);
+ HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
/* Just copy the selection from spans2 if we are setting the selection */
/* ('space1' to 'result' aliasing happens at the next layer up) */
if(op==H5S_SELECT_SET) {
if(H5S_hyper_merge_spans(result,spans2,can_own_span2)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
result->select.num_elem=H5S_hyper_spans_nelem(spans2);
@@ -6648,11 +6645,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
else {
hbool_t updated_spans = FALSE; /* Whether the spans in the selection were modified */
- assert(spans1);
+ HDassert(spans1);
/* Generate lists of spans which overlap and don't overlap */
if(H5S_hyper_clip_spans(spans1,spans2,&a_not_b,&a_and_b,&b_not_a)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Switch on the operation */
switch(op) {
@@ -6660,7 +6657,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Copy spans from spans1 to current selection */
if(spans1!=NULL) {
if(H5S_hyper_merge_spans(result,spans1,FALSE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
result->select.num_elem=H5S_hyper_spans_nelem(spans1);
@@ -6669,7 +6666,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Add any new spans from spans2 to current selection */
if(b_not_a!=NULL) {
if(H5S_hyper_merge_spans(result,b_not_a,FALSE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
result->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
@@ -6683,7 +6680,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Check if there are any overlapped selections */
if(a_and_b!=NULL) {
if(H5S_hyper_merge_spans(result,a_and_b,TRUE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
result->select.num_elem=H5S_hyper_spans_nelem(a_and_b);
@@ -6700,7 +6697,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Check if there are any non-overlapped selections */
if(a_not_b!=NULL) {
if(H5S_hyper_merge_spans(result,a_not_b,FALSE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
result->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
@@ -6710,7 +6707,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
} /* end if */
if(b_not_a!=NULL) {
if(H5S_hyper_merge_spans(result,b_not_a,FALSE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
result->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
@@ -6724,7 +6721,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Check if there are any non-overlapped selections */
if(a_not_b!=NULL) {
if(H5S_hyper_merge_spans(result,a_not_b,TRUE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
result->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
@@ -6741,7 +6738,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Check if there are any non-overlapped selections */
if(b_not_a!=NULL) {
if(H5S_hyper_merge_spans(result,b_not_a,TRUE)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
result->select.num_elem=H5S_hyper_spans_nelem(b_not_a);
@@ -6755,7 +6752,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
break;
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
/* Free the hyperslab trees generated from the clipping algorithm */
@@ -6771,11 +6768,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
H5S_hyper_span_info_t *spans; /* Empty hyperslab span tree */
/* Sanity check */
- assert(result->select.num_elem==0);
+ HDassert(result->select.num_elem == 0);
/* Allocate a span info node */
if((spans = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Set the reference count */
spans->count=1;
@@ -6802,7 +6799,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
} /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_operate_hyperslab() */
@@ -6832,19 +6829,19 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab)
/* Check args */
- assert(space);
- assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID);
- assert(start);
- assert(stride);
- assert(count);
- assert(block);
+ HDassert(space);
+ HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
+ HDassert(start);
+ HDassert(stride);
+ HDassert(count);
+ HDassert(block);
/* Generate span tree for new hyperslab information */
if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information")
/* Copy the original dataspace */
if(space->select.sel_info.hslab->span_lst!=NULL) {
@@ -6855,27 +6852,27 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Reset the other dataspace selection information */
if(H5S_SELECT_RELEASE(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection")
/* Allocate space for the hyperslab selection information */
if((space->select.sel_info.hslab=H5FL_MALLOC(H5S_hyper_sel_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info")
} /* end if */
/* Combine tmp_space (really space) & new_space, with the result in space */
if(H5S_operate_hyperslab(space,tmp_spans,op,new_spans,TRUE,&span2_owned)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
done:
/* Free temporary data structures */
if(tmp_spans!=NULL)
if(H5S_hyper_free_span_info(tmp_spans)<0)
- HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans");
+ HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
if(new_spans!=NULL && span2_owned==FALSE)
if(H5S_hyper_free_span_info(new_spans)<0)
- HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans");
+ HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_generate_hyperslab() */
@@ -6909,13 +6906,13 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
unsigned u; /* Counters */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL);
+ FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL)
/* Check args */
- assert(space);
- assert(start);
- assert(count);
- assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID);
+ HDassert(space);
+ HDassert(start);
+ HDassert(count);
+ HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
/* Point to the correct stride values */
if(stride==NULL)
@@ -6931,7 +6928,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
for(u=0; u<space->extent.rank; u++) {
/* Check for overlapping hyperslab blocks in new selection. */
if(count[u]>1 && stride[u]<block[u])
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab blocks overlap");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab blocks overlap")
/* Detect zero-sized hyperslabs in new selection */
if(count[u] == 0 || block[u] == 0) {
@@ -6941,7 +6938,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */
/* Convert to "none" selection */
if(H5S_select_none(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
HGOTO_DONE(SUCCEED);
case H5S_SELECT_OR: /* Binary "or" operation for hyperslabs */
@@ -6950,7 +6947,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_DONE(SUCCEED); /* Selection stays same */
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
} /* end if */
} /* end for */
@@ -6981,7 +6978,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
if(count[u]==1)
int_stride[u]=1;
else {
- assert(stride[u]>block[u]);
+ HDassert(stride[u] > block[u]);
int_stride[u]=stride[u];
} /* end else */
int_count[u]=count[u];
@@ -7009,7 +7006,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_DONE(SUCCEED); /* Selection stays "none" */
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
break;
@@ -7046,18 +7043,18 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Convert to hyperslab selection */
if(H5S_select_hyperslab(space,H5S_SELECT_SET,tmp_start,tmp_stride,tmp_count,tmp_block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
} /* end case */
break;
case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */
/* Convert to "none" selection */
if(H5S_select_none(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
HGOTO_DONE(SUCCEED);
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
break;
@@ -7071,18 +7068,18 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Else fall through to error */
default:
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
if(op==H5S_SELECT_SET) {
/* If we are setting a new selection, remove current selection first */
if(H5S_SELECT_RELEASE(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release hyperslab");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release hyperslab")
/* Allocate space for the hyperslab selection information */
if((space->select.sel_info.hslab=H5FL_MALLOC(H5S_hyper_sel_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info")
/* Save the diminfo */
space->select.num_elem=1;
@@ -7108,28 +7105,28 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
} /* end if */
else if(op>=H5S_SELECT_OR && op<=H5S_SELECT_NOTA) {
/* Sanity check */
- assert(H5S_GET_SELECT_TYPE(space)==H5S_SEL_HYPERSLABS);
+ HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS);
/* Check if there's no hyperslab span information currently */
if(space->select.sel_info.hslab->span_lst==NULL)
if(H5S_hyper_generate_spans(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Add in the new hyperslab information */
if(H5S_generate_hyperslab (space, op, start, opt_stride, opt_count, opt_block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs")
/* Indicate that the regular dimensions are no longer valid */
space->select.sel_info.hslab->diminfo_valid=FALSE;
} /* end if */
else
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
/* Set selection type */
space->select.type=H5S_sel_hyper;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_hyperslab() */
@@ -7166,35 +7163,35 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
H5S_t *space = NULL; /* Dataspace to modify selection of */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Sselect_hyperslab, FAIL);
+ FUNC_ENTER_API(H5Sselect_hyperslab, FAIL)
H5TRACE6("e", "iSs*h*h*h*h", space_id, op, start, stride, count, block);
/* Check args */
if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
if (H5S_SCALAR==H5S_GET_EXTENT_TYPE(space))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space")
if (H5S_NULL==H5S_GET_EXTENT_TYPE(space))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_NULL space");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_NULL space")
if(start==NULL || count==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified")
if(!(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID))
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
if(stride!=NULL) {
unsigned u; /* Local index variable */
/* Check for 0-sized strides */
for(u=0; u<space->extent.rank; u++) {
if(stride[u]==0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value")
} /* end for */
} /* end if */
if (H5S_select_hyperslab(space, op, start, stride, count, block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
} /* end H5Sselect_hyperslab() */
@@ -7235,35 +7232,35 @@ H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
H5S_t *new_space = NULL; /* New dataspace created */
hid_t ret_value;
- FUNC_ENTER_API(H5Scombine_hyperslab, FAIL);
+ FUNC_ENTER_API(H5Scombine_hyperslab, FAIL)
H5TRACE6("i", "iSs*h*h*h*h", space_id, op, start, stride, count, block);
/* Check args */
if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
if(start==NULL || count==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified")
if(!(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID))
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
/* Copy the first dataspace */
if (NULL == (new_space = H5S_copy (space, TRUE, TRUE)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy data space");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy data space")
/* Go modify the selection in the new dataspace */
if (H5S_select_hyperslab(new_space, op, start, stride, count, block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection")
/* Atomize */
if ((ret_value=H5I_register (H5I_DATASPACE, new_space, TRUE))<0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom");
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
done:
if (ret_value<0 && new_space)
H5S_close(new_space);
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
} /* end H5Scombine_hyperslab() */
@@ -7288,36 +7285,36 @@ H5S_combine_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */
H5S_t *ret_value; /* return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_combine_select);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_combine_select)
/* Check args */
- assert(space1);
- assert(space2);
- assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID);
+ HDassert(space1);
+ HDassert(space2);
+ HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
/* Check that the space selections both have span trees */
if(space1->select.sel_info.hslab->span_lst==NULL)
if(H5S_hyper_generate_spans(space1)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree")
if(space2->select.sel_info.hslab->span_lst==NULL)
if(H5S_hyper_generate_spans(space2)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree")
/* Copy the first dataspace */
if (NULL == (new_space = H5S_copy (space1, TRUE, TRUE)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy data space");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy data space")
/* Free the current selection for the new dataspace */
if(H5S_SELECT_RELEASE(new_space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, NULL, "can't release selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, NULL, "can't release selection")
/* Allocate space for the hyperslab selection information */
if((new_space->select.sel_info.hslab=H5FL_CALLOC(H5S_hyper_sel_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info")
/* Combine space1 & space2, with the result in new_space */
if(H5S_operate_hyperslab(new_space,space1->select.sel_info.hslab->span_lst,op,space2->select.sel_info.hslab->span_lst,FALSE,&span2_owned)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, NULL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, NULL, "can't clip hyperslab information")
/* Set return value */
ret_value=new_space;
@@ -7326,7 +7323,7 @@ done:
if(ret_value==NULL && new_space!=NULL)
H5S_close(new_space);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_combine_select() */
@@ -7360,38 +7357,38 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
H5S_t *new_space = NULL; /* New Dataspace */
hid_t ret_value;
- FUNC_ENTER_API(H5Scombine_select, FAIL);
+ FUNC_ENTER_API(H5Scombine_select, FAIL)
H5TRACE3("i", "iSsi", space1_id, op, space2_id);
/* Check args */
if (NULL == (space1=H5I_object_verify(space1_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
if (NULL == (space2=H5I_object_verify(space2_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
if(!(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID))
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
/* Check that both dataspaces have the same rank */
if(space1->extent.rank!=space2->extent.rank)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank")
/* Check that both dataspaces have hyperslab selections */
if(H5S_GET_SELECT_TYPE(space1)!=H5S_SEL_HYPERSLABS || H5S_GET_SELECT_TYPE(space2)!=H5S_SEL_HYPERSLABS)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections")
/* Go combine the dataspaces */
if ((new_space=H5S_combine_select(space1, op, space2))==NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to create hyperslab selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to create hyperslab selection")
/* Atomize */
if ((ret_value=H5I_register (H5I_DATASPACE, new_space, TRUE))<0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom");
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
done:
if (ret_value<0 && new_space)
H5S_close(new_space);
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
} /* end H5Scombine_select() */
@@ -7416,20 +7413,20 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_select_select);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_select_select)
/* Check args */
- assert(space1);
- assert(space2);
- assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID);
+ HDassert(space1);
+ HDassert(space2);
+ HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
/* Check that the space selections both have span trees */
if(space1->select.sel_info.hslab->span_lst==NULL)
if(H5S_hyper_generate_spans(space1)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
if(space2->select.sel_info.hslab->span_lst==NULL)
if(H5S_hyper_generate_spans(space2)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Take ownership of the dataspace's hyperslab spans */
/* (These are freed later) */
@@ -7438,21 +7435,21 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
/* Reset the other dataspace selection information */
if(H5S_SELECT_RELEASE(space1)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release selection")
/* Allocate space for the hyperslab selection information */
if((space1->select.sel_info.hslab=H5FL_CALLOC(H5S_hyper_sel_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info")
/* Combine tmp_spans (from space1) & spans from space2, with the result in space1 */
if(H5S_operate_hyperslab(space1,tmp_spans,op,space2->select.sel_info.hslab->span_lst,FALSE,&span2_owned)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
done:
if(tmp_spans!=NULL)
H5S_hyper_free_span_info(tmp_spans);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_select() */
@@ -7485,31 +7482,31 @@ H5Sselect_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
H5S_t *space2; /* Second Dataspace */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Sselect_select, FAIL);
+ FUNC_ENTER_API(H5Sselect_select, FAIL)
H5TRACE3("e", "iSsi", space1_id, op, space2_id);
/* Check args */
if (NULL == (space1=H5I_object_verify(space1_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
if (NULL == (space2=H5I_object_verify(space2_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
if(!(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID))
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
/* Check that both dataspaces have the same rank */
if(space1->extent.rank!=space2->extent.rank)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank")
/* Check that both dataspaces have hyperslab selections */
if(H5S_GET_SELECT_TYPE(space1)!=H5S_SEL_HYPERSLABS || H5S_GET_SELECT_TYPE(space2)!=H5S_SEL_HYPERSLABS)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections")
/* Go refine the first selection */
if (H5S_select_select(space1, op, space2)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to modify hyperslab selection");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to modify hyperslab selection")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
} /* end H5Sselect_select() */
#endif /* NEW_HYPERSLAB_API */ /* Works */
@@ -8726,7 +8723,6 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t
if(iter->u.hyp.iter_rank != 0 && iter->u.hyp.iter_rank < space->extent.rank) {
/* Set the aliases for a few important dimension ranks */
ndims = iter->u.hyp.iter_rank;
- fast_dim = ndims - 1;
/* Set the local copy of the selection offset */
sel_off = iter->u.hyp.sel_off;
@@ -8737,7 +8733,6 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t
else {
/* Set the aliases for a few important dimension ranks */
ndims = space->extent.rank;
- fast_dim = ndims - 1;
/* Set the local copy of the selection offset */
sel_off = space->select.offset;
@@ -8745,6 +8740,7 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t
/* Set up the pointer to the size of the memory space */
mem_size = space->extent.size;
} /* end else */
+ fast_dim = ndims - 1;
/* Check if we stopped in the middle of a sequence of elements */
if((iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start) % tdiminfo[fast_dim].stride != 0 ||