Suppress vfd.c test warning (#3014)

This commit is contained in:
Dana Robinson 2023-05-25 13:47:30 -07:00 committed by GitHub
parent 90293ccec3
commit 8dd7a016b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() */