diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2019-01-02 20:28:40 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2019-01-02 20:28:40 (GMT) |
commit | 2713fb12b12c7d9c9a418494ac8c8c2b4ce93b88 (patch) | |
tree | 0521ea7663998496259b38c68cabd5bd0af9f34e /src/H5FA.c | |
parent | 600d44292bfbce3f6d6226260a654555278ef24b (diff) | |
parent | 74a3710a996fca5ed7fcb4dd8919a7a8521de1de (diff) | |
download | hdf5-2713fb12b12c7d9c9a418494ac8c8c2b4ce93b88.zip hdf5-2713fb12b12c7d9c9a418494ac8c8c2b4ce93b88.tar.gz hdf5-2713fb12b12c7d9c9a418494ac8c8c2b4ce93b88.tar.bz2 |
Merge pull request #1380 in HDFFV/hdf5 from ~BMRIBLER/hdf5_1_10_bmr:hdf5_1_10 to hdf5_1_10
This is merged now so it can be tested.
* commit '74a3710a996fca5ed7fcb4dd8919a7a8521de1de':
Revised per review. Description: Changed H5EA_iterate and H5FA_iterate as suggested. Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1010test)
Addressed HDFFV-10661 Description: - Fixed a bug triggered by tests in chunk_info.c. The returned value from a callback function was not checked in H5EA_iterate(), H5FA_iterate(), and H5D__none_idx_iterate(). This oversight caused a callback function to continue iterating even though it's supposed to stop. Vailin confirmed. - Addressed review comments and made various improvements on the tests. Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'src/H5FA.c')
-rw-r--r-- | src/H5FA.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -685,20 +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 cb_ret = H5_ITER_CONT; /* Return value from callback */ /* * Check arguments. @@ -712,9 +718,7 @@ 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; u++) { - int cb_ret; /* Return value from callback */ - + 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") |