From c071f824ec2e952ff5f0f7294cca16cee678d3b9 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Mon, 29 May 2017 19:51:25 +0300 Subject: [PATCH] Pass `(u)intmax_t` instead of `(u)int64_t` to `check_(u)int_eq` (libtest) --- libtransmission/libtransmission-test.c | 8 ++++---- libtransmission/libtransmission-test.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libtransmission/libtransmission-test.c b/libtransmission/libtransmission-test.c index 7e71fe228..592b6554b 100644 --- a/libtransmission/libtransmission-test.c +++ b/libtransmission/libtransmission-test.c @@ -82,7 +82,7 @@ bool check_str_eq_impl(char const* file, int line, char const* expected, char co return pass; } -bool check_int_eq_impl(char const* file, int line, int64_t expected, int64_t actual) +bool check_int_eq_impl(char const* file, int line, intmax_t expected, intmax_t actual) { bool const pass = expected == actual; @@ -94,14 +94,14 @@ bool check_int_eq_impl(char const* file, int line, int64_t expected, int64_t act } else { - fprintf(stderr, "FAIL %s:%d, expected \"%" PRId64 "\", got \"%" PRId64 "\"\n", file, line, expected, actual); + fprintf(stderr, "FAIL %s:%d, expected \"%jd\", got \"%jd\"\n", file, line, expected, actual); } } return pass; } -bool check_uint_eq_impl(char const* file, int line, uint64_t expected, uint64_t actual) +bool check_uint_eq_impl(char const* file, int line, uintmax_t expected, uintmax_t actual) { bool const pass = expected == actual; @@ -113,7 +113,7 @@ bool check_uint_eq_impl(char const* file, int line, uint64_t expected, uint64_t } else { - fprintf(stderr, "FAIL %s:%d, expected \"%" PRIu64 "\", got \"%" PRIu64 "\"\n", file, line, expected, actual); + fprintf(stderr, "FAIL %s:%d, expected \"%ju\", got \"%ju\"\n", file, line, expected, actual); } } diff --git a/libtransmission/libtransmission-test.h b/libtransmission/libtransmission-test.h index 41b4777a7..8be526c34 100644 --- a/libtransmission/libtransmission-test.h +++ b/libtransmission/libtransmission-test.h @@ -23,8 +23,8 @@ extern bool verbose; bool should_print(bool pass); bool check_condition_impl(char const* file, int line, bool condition); -bool check_int_eq_impl(char const* file, int line, int64_t expected, int64_t actual); -bool check_uint_eq_impl(char const* file, int line, uint64_t expected, uint64_t actual); +bool check_int_eq_impl(char const* file, int line, intmax_t expected, intmax_t actual); +bool check_uint_eq_impl(char const* file, int line, uintmax_t expected, uintmax_t actual); bool check_ptr_eq_impl(char const* file, int line, void const* expected, void const* actual); bool check_str_eq_impl(char const* file, int line, char const* expected, char const* actual);