From 60a9e53dd83b83ec94ec8f924c68201a8e6e6c6e Mon Sep 17 00:00:00 2001 From: Mouse Date: Sun, 31 Mar 2024 10:34:57 -0400 Subject: [PATCH] Update check-INTEGER.c Try to fix format-related compiler warnings for all systems --- tests/tests-skeletons/check-INTEGER.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/tests-skeletons/check-INTEGER.c b/tests/tests-skeletons/check-INTEGER.c index 21d7f20e9..15449df4c 100644 --- a/tests/tests-skeletons/check-INTEGER.c +++ b/tests/tests-skeletons/check-INTEGER.c @@ -103,7 +103,7 @@ check_unsigned(uint8_t *buf, int size, unsigned long check_long, int check_ret) printf("]: "); ret = asn_INTEGER2ulong(&val, &rlong); - printf(" (%lu, %d) vs (%lu, %d)\n", + printf(" (%ju, %d) vs (%ju, %d)\n", rlong, ret, check_long, check_ret); assert(ret == check_ret); assert(rlong == check_long); @@ -134,7 +134,7 @@ check_unsigned(uint8_t *buf, int size, unsigned long check_long, int check_ret) ret = INTEGER_print(&asn_DEF_INTEGER, &val, 0, _print2buf, scratch); assert(shared_scratch_start < scratch + sizeof(scratch)); assert(ret == 0); - ret = snprintf(verify, sizeof(verify), "%lu", check_long); + ret = snprintf(verify, sizeof(verify), "%ju", check_long); assert(ret < (int)sizeof(verify)); ret = strcmp(scratch, verify); printf(" [%s] vs [%s]: %d%s\n", @@ -154,7 +154,7 @@ check_64(uint8_t *buf, size_t size, int64_t check_i64, int check_ret) { char verify[32]; INTEGER_t val; uint8_t *buf_end = buf + size; - int ret; + int ret = 0; int64_t rint64 = 123; assert(buf); @@ -216,7 +216,7 @@ check_unsigned_64(uint8_t *buf, int size, uint64_t check_u64, int check_ret) { char verify[32]; INTEGER_t val; uint8_t *buf_end = buf + size; - int ret; + int ret = -1; uint64_t ruint64 = 123; assert(buf); @@ -283,7 +283,7 @@ check_xer(int lineno, int tofail, char *xmldata, long orig_value) { INTEGER_t *st = 0; asn_dec_rval_t rc; long value; - int ret; + int ret = -1; printf("%03d: [%s] vs %ld: ", lineno, xmldata, orig_value); @@ -314,8 +314,8 @@ static void check_jer(int lineno, int tofail, char *jsondata, long orig_value) { INTEGER_t *st = 0; asn_dec_rval_t rc; - long value; - int ret; + long value = 0; + int ret = -1; printf("%03d: [%s] vs %ld: ", lineno, jsondata, orig_value); fflush(stdout); @@ -350,9 +350,9 @@ check_strtoimax() { char positive_max[32]; char negative_min[32]; const int len_pmax = snprintf(positive_max, sizeof(positive_max), - "+%" ASN_PRId64, intmax_max); + "jd", intmax_max); const int len_nmin = snprintf(negative_min, sizeof(negative_min), - "%" ASN_PRId64, intmax_min); + "%jd", intmax_min); assert(len_pmax < (int)sizeof(positive_max)); assert(len_nmin < (int)sizeof(negative_min));