Fix some Wformat size_t warnings (#1726)

Printing 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
2023-05-18 09:29:27 +01:00
committed by GitHub
parent 85c95297ac
commit 8f3027387a
2 changed files with 10 additions and 6 deletions

View File

@@ -104,15 +104,19 @@ test_get_linear_ids(cl_device_id device, cl_context context, cl_command_queue qu
switch (dims) { switch (dims) {
case 1: case 1:
log_info(" testing offset=%u global=%u local=%u...\n", gwo[0], gws[0], lws[0]); log_info(" testing offset=%zu global=%zu local=%zu...\n", gwo[0],
gws[0], lws[0]);
break; break;
case 2: case 2:
log_info(" testing offset=(%u,%u) global=(%u,%u) local=(%u,%u)...\n", log_info(" testing offset=(%zu,%zu) global=(%zu,%zu) "
gwo[0], gwo[1], gws[0], gws[1], lws[0], lws[1]); "local=(%zu,%zu)...\n",
gwo[0], gwo[1], gws[0], gws[1], lws[0], lws[1]);
break; break;
case 3: case 3:
log_info(" testing offset=(%u,%u,%u) global=(%u,%u,%u) local=(%u,%u,%u)...\n", log_info(" testing offset=(%zu,%zu,%zu) global=(%zu,%zu,%zu) "
gwo[0], gwo[1], gwo[2], gws[0], gws[1], gws[2], lws[0], lws[1], lws[2]); "local=(%zu,%zu,%zu)...\n",
gwo[0], gwo[1], gwo[2], gws[0], gws[1], gws[2], lws[0],
lws[1], lws[2]);
break; break;
} }

View File

@@ -28,7 +28,7 @@
{ \ { \
if (reference != result) \ if (reference != result) \
{ \ { \
log_error("Expected %d was %d at index %u\n", reference, result, \ log_error("Expected %d was %d at index %zu\n", reference, result, \
index); \ index); \
return TEST_FAIL; \ return TEST_FAIL; \
} \ } \