diff options
author | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2019-03-07 20:47:38 (GMT) |
---|---|---|
committer | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2019-03-07 20:47:38 (GMT) |
commit | 07fde1e25c51e1c4294248311104ef02dbb7da21 (patch) | |
tree | eeeebf3da31ab3a47716759985c375203cf04976 /src/H5Eint.c | |
parent | 5a51c3677e25e8426d6cd8532baa46244d645cf9 (diff) | |
parent | 8d2a047c25d2bd34c52c8d437802c309a9ae0985 (diff) | |
download | hdf5-07fde1e25c51e1c4294248311104ef02dbb7da21.zip hdf5-07fde1e25c51e1c4294248311104ef02dbb7da21.tar.gz hdf5-07fde1e25c51e1c4294248311104ef02dbb7da21.tar.bz2 |
Merge branch 'develop' into H10621
Diffstat (limited to 'src/H5Eint.c')
-rw-r--r-- | src/H5Eint.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/src/H5Eint.c b/src/H5Eint.c index 540c9b1..7818879 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -422,7 +422,7 @@ done: * Purpose: Private function to print the error stack in some default * way. This is just a convenience function for H5Ewalk() and * H5Ewalk2() with a function that prints error messages. - * Users are encouraged to write there own more specific error + * Users are encouraged to write their own more specific error * handlers. * * Return: SUCCEED/FAIL @@ -511,10 +511,9 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o void *client_data) { int i; /* Local index variable */ - herr_t status; /* Status from callback function */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(estack); @@ -530,9 +529,9 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o if(op->u.func1) { H5E_error1_t old_err; - status = SUCCEED; + ret_value = SUCCEED; if(H5E_WALK_UPWARD == direction) { - for(i = 0; i < (int)estack->nused && status >= 0; i++) { + for(i = 0; i < (int)estack->nused && ret_value == H5_ITER_CONT; i++) { /* Point to each error record on the stack and pass it to callback function.*/ old_err.maj_num = estack->slot[i].maj_num; old_err.min_num = estack->slot[i].min_num; @@ -541,12 +540,12 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o old_err.desc = estack->slot[i].desc; old_err.line = estack->slot[i].line; - status = (op->u.func1)(i, &old_err, client_data); + ret_value = (op->u.func1)(i, &old_err, client_data); } /* end for */ } /* end if */ else { H5_CHECK_OVERFLOW(estack->nused - 1, size_t, int); - for(i = (int)(estack->nused - 1); i >= 0 && status >= 0; i--) { + for(i = (int)(estack->nused - 1); i >= 0 && ret_value == H5_ITER_CONT; i--) { /* Point to each error record on the stack and pass it to callback function.*/ old_err.maj_num = estack->slot[i].maj_num; old_err.min_num = estack->slot[i].min_num; @@ -555,12 +554,12 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o old_err.desc = estack->slot[i].desc; old_err.line = estack->slot[i].line; - status = (op->u.func1)((int)(estack->nused - (size_t)(i + 1)), &old_err, client_data); + ret_value = (op->u.func1)((int)(estack->nused - (size_t)(i + 1)), &old_err, client_data); } /* end for */ } /* end else */ - if(status < 0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") + if(ret_value < 0) + HERROR(H5E_ERROR, H5E_CANTLIST, "can't walk error stack"); } /* end if */ #else /* H5_NO_DEPRECATED_SYMBOLS */ HDassert(0 && "version 1 error stack walk without deprecated symbols!"); @@ -569,23 +568,22 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o else { HDassert(op->vers == 2); if(op->u.func2) { - status = SUCCEED; + ret_value = SUCCEED; if(H5E_WALK_UPWARD == direction) { - for(i = 0; i < (int)estack->nused && status >= 0; i++) - status = (op->u.func2)((unsigned)i, estack->slot + i, client_data); + for(i = 0; i < (int)estack->nused && ret_value == H5_ITER_CONT; i++) + ret_value = (op->u.func2)((unsigned)i, estack->slot + i, client_data); } /* end if */ else { H5_CHECK_OVERFLOW(estack->nused - 1, size_t, int); - for(i = (int)(estack->nused - 1); i >= 0 && status >= 0; i--) - status = (op->u.func2)((unsigned)(estack->nused - (size_t)(i + 1)), estack->slot + i, client_data); + for(i = (int)(estack->nused - 1); i >= 0 && ret_value == H5_ITER_CONT; i--) + ret_value = (op->u.func2)((unsigned)(estack->nused - (size_t)(i + 1)), estack->slot + i, client_data); } /* end else */ - if(status < 0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") + if(ret_value < 0) + HERROR(H5E_ERROR, H5E_CANTLIST, "can't walk error stack"); } /* end if */ } /* end else */ -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E__walk() */ @@ -706,7 +704,7 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin */ /* Start the variable-argument parsing */ - va_start(ap, fmt); + HDva_start(ap, fmt); va_started = TRUE; #ifdef H5_HAVE_VASPRINTF @@ -722,8 +720,8 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin /* If the description doesn't fit into the initial buffer size, allocate more space and try again */ while((desc_len = HDvsnprintf(tmp, (size_t)tmp_len, fmt, ap)) > (tmp_len - 1)) { /* shutdown & restart the va_list */ - va_end(ap); - va_start(ap, fmt); + HDva_end(ap); + HDva_start(ap, fmt); /* Release the previous description, it's too small */ H5MM_xfree(tmp); @@ -741,7 +739,7 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin done: if(va_started) - va_end(ap); + HDva_end(ap); #ifdef H5_HAVE_VASPRINTF /* Memory was allocated with HDvasprintf so it needs to be freed * with HDfree |