diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-12-26 16:01:51 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-12-26 16:01:51 (GMT) |
commit | 74a3710a996fca5ed7fcb4dd8919a7a8521de1de (patch) | |
tree | bc8301379acaebf47fb5c0319508a98edcd38826 /src/H5FA.c | |
parent | 22bc8ba7bfb2c82b6cea6b5f5d1da2f2119c348b (diff) | |
download | hdf5-74a3710a996fca5ed7fcb4dd8919a7a8521de1de.zip hdf5-74a3710a996fca5ed7fcb4dd8919a7a8521de1de.tar.gz hdf5-74a3710a996fca5ed7fcb4dd8919a7a8521de1de.tar.bz2 |
Revised per review.
Description:
Changed H5EA_iterate and H5FA_iterate as suggested.
Platforms tested:
Linux/64 (jelly)
Linux/64 (platypus)
Darwin (osx1010test)
Diffstat (limited to 'src/H5FA.c')
-rw-r--r-- | src/H5FA.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -685,21 +685,26 @@ END_FUNC(PRIV) /* end H5FA_delete() */ * Note: This is not very efficient, we should be iterating directly * over the fixed array's direct block [pages]. * - * Return: SUCCEED/FAIL + * Return: H5_ITER_CONT/H5_ITER_ERROR * * Programmer: Vailin Choi * Thursday, April 30, 2009 * + * Modification: + * Prototype changed (HDFFV-10661) + * - herr_t to int + * - SUCCEED/FAIL to H5_ITER_CONT/H5_ITER_ERROR + * December 24, 2018 -BMR *------------------------------------------------------------------------- */ BEGIN_FUNC(PRIV, ERR, -herr_t, SUCCEED, FAIL, +int, H5_ITER_CONT, H5_ITER_ERROR, H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata)) /* Local variables */ uint8_t *elmt = NULL; hsize_t u; - int ret_value = H5_ITER_CONT; /* Return value from callback */ + int cb_ret = H5_ITER_CONT; /* Return value from callback */ /* * Check arguments. @@ -713,15 +718,15 @@ H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata)) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array element") /* Iterate over all elements in array */ - for(u = 0; u < fa->hdr->stats.nelmts && ret_value == H5_ITER_CONT; u++) { + for(u = 0; u < fa->hdr->stats.nelmts && cb_ret == H5_ITER_CONT; u++) { /* Get array element */ if(H5FA_get(fa, u, elmt) < 0) H5E_THROW(H5E_CANTGET, "unable to delete fixed array") /* Make callback */ - if((ret_value = (*op)(u, elmt, udata)) < 0) { + if((cb_ret = (*op)(u, elmt, udata)) < 0) { H5E_PRINTF(H5E_BADITER, "iterator function failed"); - H5_LEAVE(ret_value) + H5_LEAVE(cb_ret) } /* end if */ } /* end for */ |