basic: fix size_t Wformat warnings (#2264)

Printing of a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2025-02-18 18:11:32 +01:00
committed by GitHub
parent 9c5999bc1d
commit ea934a7648
11 changed files with 113 additions and 81 deletions

View File

@@ -69,12 +69,14 @@ int test_simple_read_image_pitch(cl_device_id device, cl_context cl_context_, cl
for (size_t i=0;i<bufferW;++i) {
char val = host_buffer[j*bufferW+i];
if ((i<imageW*pixel_bytes) && (val != 0x1)) {
log_error("Bad value %x in image at (byte: %lu, row: %lu)\n",val,i,j);
++errors;
log_error("Bad value %x in image at (byte: %zu, row: %zu)\n", val, i,
j);
++errors;
}
else if ((i>=imageW*pixel_bytes) && (val != 0xa)) {
log_error("Bad value %x outside image at (byte: %lu, row: %lu)\n",val,i,j);
++errors;
log_error("Bad value %x outside image at (byte: %zu, row: %zu)\n",
val, i, j);
++errors;
}
}
}
@@ -136,8 +138,9 @@ int test_simple_write_image_pitch(cl_device_id device, cl_context cl_context_, c
for (size_t i=0;i<mapped_pitch;++i) {
char val = mapped_image[j*mapped_pitch+i];
if ((i<imageW*pixel_bytes) && (val != 0xa)) {
log_error("Bad value %x in image at (byte: %lu, row: %lu)\n",val,i,j);
++errors;
log_error("Bad value %x in image at (byte: %zu, row: %zu)\n", val, i,
j);
++errors;
}
}
}