mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
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:
committed by
GitHub
parent
d99b302f90
commit
56d383b2e9
@@ -84,8 +84,8 @@ int test_load_program_source(cl_device_id deviceID, cl_context context, cl_comma
|
||||
// Note: according to spec section 5.4.5, the length returned should include the null terminator
|
||||
if (length != line_length + 1)
|
||||
{
|
||||
log_error("ERROR: Length of program (%ld) does not match reference "
|
||||
"length (%ld)!\n",
|
||||
log_error("ERROR: Length of program (%zu) does not match reference "
|
||||
"length (%zu)!\n",
|
||||
length, line_length + 1);
|
||||
return -1;
|
||||
}
|
||||
@@ -520,7 +520,7 @@ int test_get_program_build_info(cl_device_id deviceID, cl_context context, cl_co
|
||||
error = clGetProgramBuildInfo( program, deviceID, CL_PROGRAM_BUILD_LOG, 0, NULL, &length );
|
||||
test_error( error, "Unable to get program build log length" );
|
||||
|
||||
log_info("Build log is %ld long.\n", length);
|
||||
log_info("Build log is %zu long.\n", length);
|
||||
|
||||
buffer = (char*)malloc(length);
|
||||
|
||||
|
||||
@@ -1999,14 +1999,14 @@ static int verifyCopyBuffer(cl_context context, cl_command_queue queue,
|
||||
|
||||
if (srcBuffer == NULL)
|
||||
{
|
||||
log_error("ERROR: Unable to allocate srcBuffer float array with %lu "
|
||||
log_error("ERROR: Unable to allocate srcBuffer float array with %zu "
|
||||
"floats! (in %s:%d)\n",
|
||||
cnDimension, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
if (dstBuffer == NULL)
|
||||
{
|
||||
log_error("ERROR: Unable to allocate dstBuffer float array with %lu "
|
||||
log_error("ERROR: Unable to allocate dstBuffer float array with %zu "
|
||||
"floats! (in %s:%d)\n",
|
||||
cnDimension, __FILE__, __LINE__);
|
||||
return -1;
|
||||
@@ -2067,7 +2067,7 @@ static int verifyCopyBuffer(cl_context context, cl_command_queue queue,
|
||||
{
|
||||
if (mismatch < 4)
|
||||
{
|
||||
log_info("Offset %08lX: Expected %08X, Got %08X\n", i * 4,
|
||||
log_info("Offset %08zX: Expected %08X, Got %08X\n", i * 4,
|
||||
pSrc[i], pDst[i]);
|
||||
}
|
||||
else
|
||||
@@ -2292,7 +2292,7 @@ int test_execute_after_serialize_reload_object(cl_device_id deviceID,
|
||||
binary = (unsigned char *)malloc(sizeof(unsigned char) * binarySize);
|
||||
if (binary == NULL)
|
||||
{
|
||||
log_error("ERROR: Unable to allocate binary character array with %lu "
|
||||
log_error("ERROR: Unable to allocate binary character array with %zu "
|
||||
"characters! (in %s:%d)\n",
|
||||
binarySize, __FILE__, __LINE__);
|
||||
return -1;
|
||||
@@ -2404,7 +2404,7 @@ int test_execute_after_serialize_reload_library(cl_device_id deviceID,
|
||||
binary = (unsigned char *)malloc(sizeof(unsigned char) * binarySize);
|
||||
if (binary == NULL)
|
||||
{
|
||||
log_error("ERROR: Unable to allocate binary character array with %lu "
|
||||
log_error("ERROR: Unable to allocate binary character array with %zu "
|
||||
"characters (in %s:%d)!",
|
||||
binarySize, __FILE__, __LINE__);
|
||||
return -1;
|
||||
@@ -3308,7 +3308,7 @@ int test_program_binary_type(cl_device_id deviceID, cl_context context,
|
||||
if (binary == NULL)
|
||||
{
|
||||
log_error("ERROR: Unable to allocate binary character array with "
|
||||
"%lu characters! (in %s:%d)\n",
|
||||
"%zu characters! (in %s:%d)\n",
|
||||
binarySize, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
@@ -3389,7 +3389,7 @@ int test_program_binary_type(cl_device_id deviceID, cl_context context,
|
||||
binary = (unsigned char *)malloc(sizeof(unsigned char) * binarySize);
|
||||
if (binary == NULL)
|
||||
{
|
||||
log_error("ERROR: Unable to allocate binary character array with %lu "
|
||||
log_error("ERROR: Unable to allocate binary character array with %zu "
|
||||
"characters! (in %s:%d)\n",
|
||||
binarySize, __FILE__, __LINE__);
|
||||
return -1;
|
||||
@@ -3487,7 +3487,7 @@ int test_program_binary_type(cl_device_id deviceID, cl_context context,
|
||||
if (binary == NULL)
|
||||
{
|
||||
log_error("ERROR: Unable to allocate binary character array with "
|
||||
"%lu characters! (in %s:%d)\n",
|
||||
"%zu characters! (in %s:%d)\n",
|
||||
binarySize, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user