summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-05-25 20:47:30 (GMT)
committerGitHub <noreply@github.com>2023-05-25 20:47:30 (GMT)
commit8dd7a016b14347266d2a2de8bc22f6d1214976a9 (patch)
tree2773d0552d3258af8619713c9ba3ed192fa35b52 /test
parent90293ccec3bf58b6152606138410e80d46604e5d (diff)
downloadhdf5-8dd7a016b14347266d2a2de8bc22f6d1214976a9.zip
hdf5-8dd7a016b14347266d2a2de8bc22f6d1214976a9.tar.gz
hdf5-8dd7a016b14347266d2a2de8bc22f6d1214976a9.tar.bz2
Suppress vfd.c test warning (#3014)
Diffstat (limited to 'test')
-rw-r--r--test/vfd.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/test/vfd.c b/test/vfd.c
index 4a5351b..cd4c793 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -4957,10 +4957,6 @@ error:
*
* Return: Success: TRUE
* Failure: FALSE
- *
- * Programmer: Neil Fortner
- * 7/1/21
- *
*-------------------------------------------------------------------------
*/
/* Array dimensions, used for all selection I/O tests. Currently both must be
@@ -4972,23 +4968,32 @@ static herr_t
test_selection_io_write(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t mem_spaces[], hid_t file_spaces[],
haddr_t offsets[], size_t element_sizes[], int *wbufs[])
{
- int i;
- int j;
+ const void **bufs; /* Avoids cast/const warnings */
+ int i;
+ int j;
+
+ if (NULL == (bufs = HDcalloc(count, sizeof(void *))))
+ TEST_ERROR;
/* Update write buffer */
- for (i = 0; i < (int)count; i++)
+ for (i = 0; i < (int)count; i++) {
if (wbufs[i] && (i == 0 || wbufs[i] != wbufs[i - 1]))
for (j = 0; j < SEL_IO_DIM0 * SEL_IO_DIM1; j++)
wbufs[i][j] += 2 * SEL_IO_DIM0 * SEL_IO_DIM1;
+ bufs[i] = wbufs[i];
+ }
/* Issue write call */
if (H5FDwrite_selection(lf, type, H5P_DEFAULT, count, mem_spaces, file_spaces, offsets, element_sizes,
- (const void **)wbufs) < 0)
+ bufs) < 0)
TEST_ERROR;
+ HDfree(bufs);
+
return 0;
error:
+ HDfree(bufs);
return -1;
} /* end test_selection_io_write() */