mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 14:09:03 +00:00
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:
committed by
GitHub
parent
9c5999bc1d
commit
ea934a7648
@@ -189,7 +189,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue,
|
||||
}
|
||||
|
||||
char name[32];
|
||||
sprintf( name, "%s%ld", vector_table[i].name, j );
|
||||
sprintf(name, "%s%zu", vector_table[i].name, j);
|
||||
|
||||
test = CL_ULONG_MAX;
|
||||
err = get_type_size( context, queue, name, &test, device );
|
||||
@@ -197,12 +197,16 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue,
|
||||
return err;
|
||||
if( test != j * vector_table[i].size )
|
||||
{
|
||||
log_error( "\nFAILED: Type %s has size %lld, but expected size %lld!\n", name, test, j * vector_table[i].size );
|
||||
log_error(
|
||||
"\nFAILED: Type %s has size %lld, but expected size %zu!\n",
|
||||
name, test, j * vector_table[i].size);
|
||||
return -1;
|
||||
}
|
||||
if( test != j * vector_table[i].cl_size )
|
||||
{
|
||||
log_error( "\nFAILED: Type %s has size %lld, but cl_ size is %lld!\n", name, test, j * vector_table[i].cl_size );
|
||||
log_error(
|
||||
"\nFAILED: Type %s has size %lld, but cl_ size is %zu!\n",
|
||||
name, test, j * vector_table[i].cl_size);
|
||||
return -2;
|
||||
}
|
||||
log_info( "%16s", name );
|
||||
@@ -317,7 +321,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue,
|
||||
for( j = 2; j <= 16; j *= 2 )
|
||||
{
|
||||
char name[32];
|
||||
sprintf( name, "double%ld", j );
|
||||
sprintf(name, "double%zu", j);
|
||||
|
||||
test = CL_ULONG_MAX;
|
||||
err = get_type_size( context, queue, name, &test, device );
|
||||
@@ -325,7 +329,8 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue,
|
||||
return err;
|
||||
if( test != 8*j )
|
||||
{
|
||||
log_error( "\nFAILED: %s has size %lld, but must be %ld!\n", name, test, 8 * j);
|
||||
log_error("\nFAILED: %s has size %lld, but must be %zu!\n",
|
||||
name, test, 8 * j);
|
||||
return -1;
|
||||
}
|
||||
log_info( "%16s", name );
|
||||
@@ -352,7 +357,7 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue,
|
||||
for( j = 2; j <= 16; j *= 2 )
|
||||
{
|
||||
char name[32];
|
||||
sprintf( name, "half%ld", j );
|
||||
sprintf(name, "half%zu", j);
|
||||
|
||||
test = CL_ULONG_MAX;
|
||||
err = get_type_size( context, queue, name, &test, device );
|
||||
@@ -360,7 +365,8 @@ int test_sizeof(cl_device_id device, cl_context context, cl_command_queue queue,
|
||||
return err;
|
||||
if( test != 2*j )
|
||||
{
|
||||
log_error( "\nFAILED: %s has size %lld, but must be %ld!\n", name, test, 2 * j);
|
||||
log_error("\nFAILED: %s has size %lld, but must be %zu!\n",
|
||||
name, test, 2 * j);
|
||||
return -1;
|
||||
}
|
||||
log_info( "%16s", name );
|
||||
|
||||
Reference in New Issue
Block a user