diff options
author | Ran Benita <ran@unusedvar.com> | 2019-12-28 14:11:27 +0200 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2019-12-28 14:13:52 +0200 |
commit | d1e39c111ed9b1042f7e22ebb7379a99d44730a4 (patch) | |
tree | c741523d16616feb0a16f5ec894671818c15442d /test | |
parent | da4a90c13e03d5a8684c66e7e8e69b174af822a0 (diff) | |
download | xorg-lib-libxkbcommon-d1e39c111ed9b1042f7e22ebb7379a99d44730a4.tar.gz |
test/atom: use correct format specifier for size_t
From MSVC:
test\atom.c(98): note: consider using '%zu' in the format string
test\atom.c(98): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(100): note: consider using '%zu' in the format string
test\atom.c(100): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(114): note: consider using '%zu' in the format string
test\atom.c(114): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(128): note: consider using '%zu' in the format string
test\atom.c(128): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(130): note: consider using '%zu' in the format string
test\atom.c(130): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(137): note: consider using '%zu' in the format string
test\atom.c(137): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 2 has type 'size_t'
Signed-off-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/atom.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/atom.c b/test/atom.c index 955b7da..a2f7541 100644 --- a/test/atom.c +++ b/test/atom.c @@ -95,9 +95,9 @@ test_random_strings(void) if (arr[i].len != strlen(string) || strncmp(string, arr[i].string, arr[i].len) != 0) { fprintf(stderr, "got a collision, but strings don't match!\n"); - fprintf(stderr, "existing length %lu, string %s\n", + fprintf(stderr, "existing length %zu, string %s\n", strlen(string), string); - fprintf(stderr, "new length %lu, string %.*s\n", + fprintf(stderr, "new length %zu, string %.*s\n", arr[i].len, (int) arr[i].len, arr[i].string); fprintf(stderr, "seed: %u\n", seed); assert(false); @@ -111,7 +111,7 @@ test_random_strings(void) arr[i].atom = atom_intern(table, arr[i].string, arr[i].len, true); if (arr[i].atom == XKB_ATOM_NONE) { - fprintf(stderr, "failed to intern! len: %lu, string: %.*s\n", + fprintf(stderr, "failed to intern! len: %zu, string: %.*s\n", arr[i].len, (int) arr[i].len, arr[i].string); fprintf(stderr, "seed: %u\n", seed); assert(false); @@ -125,16 +125,16 @@ test_random_strings(void) if (arr[i].len != strlen(string) || strncmp(string, arr[i].string, arr[i].len) != 0) { fprintf(stderr, "looked-up string doesn't match!\n"); - fprintf(stderr, "found length %lu, string %s\n", + fprintf(stderr, "found length %zu, string %s\n", strlen(string), string); - fprintf(stderr, "expected length %lu, string %.*s\n", + fprintf(stderr, "expected length %zu, string %.*s\n", arr[i].len, (int) arr[i].len, arr[i].string); /* Since this is random, we need to dump the failing data, * so we might have some chance to reproduce. */ fprintf(stderr, "START dump of arr, N=%d\n", N); for (int j = 0; j < N; j++) { - fprintf(stderr, "%u\t\t%lu\t\t%.*s\n", arr[i].atom, + fprintf(stderr, "%u\t\t%zu\t\t%.*s\n", arr[i].atom, arr[i].len, (int) arr[i].len, arr[i].string); } fprintf(stderr, "END\n"); |