From e933fd2dadfabc04add3caed9f9496761fadba8c Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 19 Oct 2023 12:34:30 +1300 Subject: [PATCH] lib/torture: Use portable format specifiers BUG: https://bugzilla.samba.org/show_bug.cgi?id=15498 Signed-off-by: Joseph Sutton Reviewed-by: Andreas Schneider --- lib/torture/torture.h | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/torture/torture.h b/lib/torture/torture.h index 6818084ea96..94d8543770c 100644 --- a/lib/torture/torture.h +++ b/lib/torture/torture.h @@ -561,9 +561,9 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) do { uint32_t __got = (got), __expected = (expected); \ if (__got != __expected) { \ torture_result(torture_ctx, TORTURE_FAIL, \ - __location__": "#got" was %ju (0x%jX), expected %ju (0x%jX): %s", \ - (uintmax_t)__got, (uintmax_t)__got, \ - (uintmax_t)__expected, (uintmax_t)__expected, \ + __location__": "#got" was %"PRIu32" (0x%"PRIX32"), expected %"PRIu32" (0x%"PRIX32"): %s", \ + __got, __got, \ + __expected, __expected, \ cmt); \ return false; \ } \ @@ -573,9 +573,9 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) do { uint32_t __got = (got), __expected = (expected); \ if (__got != __expected) { \ torture_result(torture_ctx, TORTURE_FAIL, \ - __location__": "#got" was %ju (0x%jX), expected %ju (0x%jX): %s", \ - (uintmax_t)__got, (uintmax_t)__got, \ - (uintmax_t)__expected, (uintmax_t)__expected, \ + __location__": "#got" was %"PRIu32" (0x%"PRIX32"), expected %"PRIu32" (0x%"PRIX32"): %s", \ + __got, __got, \ + __expected, __expected, \ cmt); \ ret = false; \ goto label; \ @@ -586,8 +586,8 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) do { uint32_t __got = (got), __not_expected = (not_expected); \ if (__got == __not_expected) { \ torture_result(torture_ctx, TORTURE_FAIL, \ - __location__": "#got" was %ju (0x%jX), expected a different number: %s", \ - (uintmax_t)__got, (uintmax_t)__got, \ + __location__": "#got" was %"PRIu32" (0x%"PRIX32"), expected a different number: %s", \ + __got, __got, \ cmt); \ return false; \ } \ @@ -597,8 +597,8 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) do { uint32_t __got = (got), __not_expected = (not_expected); \ if (__got == __not_expected) { \ torture_result(torture_ctx, TORTURE_FAIL, \ - __location__": "#got" was %ju (0x%jX), expected a different number: %s", \ - (uintmax_t)__got, (uintmax_t)__got, \ + __location__": "#got" was %"PRIu32" (0x%"PRIX32"), expected a different number: %s", \ + __got, __got, \ cmt); \ ret = false; \ goto label; \ @@ -609,9 +609,9 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) do { uint64_t __got = (got), __expected = (expected); \ if (__got != __expected) { \ torture_result(torture_ctx, TORTURE_FAIL, \ - __location__": "#got" was %llu (0x%llX), expected %llu (0x%llX): %s", \ - (unsigned long long)__got, (unsigned long long)__got, \ - (unsigned long long)__expected, (unsigned long long)__expected, \ + __location__": "#got" was %"PRIu64" (0x%"PRIX64"), expected %"PRIu64" (0x%"PRIX64"): %s", \ + __got, __got, \ + __expected, __expected, \ cmt); \ return false; \ } \ @@ -621,9 +621,9 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) do { uint64_t __got = (got), __expected = (expected); \ if (__got != __expected) { \ torture_result(torture_ctx, TORTURE_FAIL, \ - __location__": "#got" was %llu (0x%llX), expected %llu (0x%llX): %s", \ - (unsigned long long)__got, (unsigned long long)__got, \ - (unsigned long long)__expected, (unsigned long long)__expected, \ + __location__": "#got" was %"PRIu64" (0x%"PRIX64"), expected %"PRIu64" (0x%"PRIX64"): %s", \ + __got, __got, \ + __expected, __expected, \ cmt); \ ret = false; \ goto label; \ @@ -634,8 +634,8 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) do { uint64_t __got = (got), __not_expected = (not_expected); \ if (__got == __not_expected) { \ torture_result(torture_ctx, TORTURE_FAIL, \ - __location__": "#got" was %llu (0x%llX), expected a different number: %s", \ - (unsigned long long)__got, (unsigned long long)__got, \ + __location__": "#got" was %"PRIu64" (0x%"PRIX64"), expected a different number: %s", \ + __got, __got, \ cmt); \ return false; \ } \ @@ -645,8 +645,8 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) do { uint64_t __got = (got), __not_expected = (not_expected); \ if (__got == __not_expected) { \ torture_result(torture_ctx, TORTURE_FAIL, \ - __location__": "#got" was %llu (0x%llX), expected a different number: %s", \ - (unsigned long long)__got, (unsigned long long)__got, \ + __location__": "#got" was %"PRIu64" (0x%"PRIX64"), expected a different number: %s", \ + __got, __got, \ cmt); \ ret = false; \ goto label; \ -- 2.47.3