Fix more Wformat warnings related to size_t (#2166)

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

This fixes occurrences where the previous wrong specifier appears to
work in a typical 64-bit build, but causes a Wformat warning in 32-bit
builds.

---------

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2024-12-10 18:13:58 +01:00
committed by GitHub
parent d99b302f90
commit 56d383b2e9
17 changed files with 386 additions and 144 deletions

View File

@@ -136,7 +136,7 @@ cl_mem create_image( cl_context context, cl_command_queue queue, BufferOwningPtr
if (err != CL_SUCCESS)
{
log_error("ERROR: Could not create buffer for 1D buffer "
"image. %ld bytes\n",
"image. %zu bytes\n",
imageInfo->rowPitch);
return NULL;
}
@@ -149,7 +149,9 @@ cl_mem create_image( cl_context context, cl_command_queue queue, BufferOwningPtr
{
if ( NULL == host_ptr )
{
log_error( "ERROR: Unable to create backing store for pitched 3D image. %ld bytes\n", imageInfo->depth * imageInfo->slicePitch );
log_error("ERROR: Unable to create backing store for pitched 3D "
"image. %zu bytes\n",
imageInfo->depth * imageInfo->slicePitch);
return NULL;
}
if (imageInfo->type != CL_MEM_OBJECT_IMAGE1D_BUFFER)
@@ -418,7 +420,8 @@ int test_fill_image_generic( cl_context context, cl_command_queue queue, image_d
imgHost.reset(malloc(dataBytes),NULL,0,dataBytes);
if (imgHost == NULL)
{
log_error( "ERROR: Unable to malloc %lu bytes for imgHost\n", dataBytes );
log_error("ERROR: Unable to malloc %zu bytes for imgHost\n",
dataBytes);
return -1;
}
}