diff options
Diffstat (limited to 'test/vfd.c')
-rw-r--r-- | test/vfd.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -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() */ |