image_streams: fix -Wformat warnings (#1948)

The main sources of warnings were:

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

* Printing of 64-bit values which is now done using the `PRI*64` macros
to ensure portability across 32 and 64-bit builds.

* Calling log_error with a format string of `"%f %f %f %f"` but
specifying only three arguments.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2024-07-02 18:38:36 +02:00
committed by GitHub
parent 2d8028668f
commit f775377e6a
9 changed files with 26 additions and 17 deletions

View File

@@ -17,6 +17,7 @@
#include <float.h>
#include <algorithm>
#include <cinttypes>
#if defined( __APPLE__ )
#include <signal.h>
@@ -1481,8 +1482,7 @@ int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel ke
char *imagePtr = (char *)imageValues + nextLevelOffset;
if( gTestMipmaps )
{
if(gDebugTrace)
log_info("\t- Working at mip level %d\n", lod);
if (gDebugTrace) log_info("\t- Working at mip level %zu\n", lod);
error = clSetKernelArg( kernel, idx, sizeof(float), &lod_float);
}
@@ -1743,7 +1743,10 @@ int test_read_image_set_2D(cl_device_id device, cl_context context,
do
{
if( gDebugTrace )
log_info( " at size %d,%d, starting round ramp at %llu for range %llu\n", (int)imageInfo.width, (int)imageInfo.height, gRoundingStartValue, typeRange );
log_info(" at size %d,%d, starting round ramp at %" PRIu64
" for range %" PRIu64 "\n",
(int)imageInfo.width, (int)imageInfo.height,
gRoundingStartValue, typeRange);
int retCode = test_read_image_2D( context, queue, kernel, &imageInfo, imageSampler, floatCoords, outputType, seed );
if( retCode )
return retCode;