Unverified Commit 60a9e53d authored by Mouse's avatar Mouse Committed by GitHub

Update check-INTEGER.c

Try to fix format-related compiler warnings for all systems
parent 1d155c23
...@@ -103,7 +103,7 @@ check_unsigned(uint8_t *buf, int size, unsigned long check_long, int check_ret) ...@@ -103,7 +103,7 @@ check_unsigned(uint8_t *buf, int size, unsigned long check_long, int check_ret)
printf("]: "); printf("]: ");
ret = asn_INTEGER2ulong(&val, &rlong); 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); rlong, ret, check_long, check_ret);
assert(ret == check_ret); assert(ret == check_ret);
assert(rlong == check_long); assert(rlong == check_long);
...@@ -134,7 +134,7 @@ check_unsigned(uint8_t *buf, int size, unsigned long check_long, int check_ret) ...@@ -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); ret = INTEGER_print(&asn_DEF_INTEGER, &val, 0, _print2buf, scratch);
assert(shared_scratch_start < scratch + sizeof(scratch)); assert(shared_scratch_start < scratch + sizeof(scratch));
assert(ret == 0); assert(ret == 0);
ret = snprintf(verify, sizeof(verify), "%lu", check_long); ret = snprintf(verify, sizeof(verify), "%ju", check_long);
assert(ret < (int)sizeof(verify)); assert(ret < (int)sizeof(verify));
ret = strcmp(scratch, verify); ret = strcmp(scratch, verify);
printf(" [%s] vs [%s]: %d%s\n", 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) { ...@@ -154,7 +154,7 @@ check_64(uint8_t *buf, size_t size, int64_t check_i64, int check_ret) {
char verify[32]; char verify[32];
INTEGER_t val; INTEGER_t val;
uint8_t *buf_end = buf + size; uint8_t *buf_end = buf + size;
int ret; int ret = 0;
int64_t rint64 = 123; int64_t rint64 = 123;
assert(buf); assert(buf);
...@@ -216,7 +216,7 @@ check_unsigned_64(uint8_t *buf, int size, uint64_t check_u64, int check_ret) { ...@@ -216,7 +216,7 @@ check_unsigned_64(uint8_t *buf, int size, uint64_t check_u64, int check_ret) {
char verify[32]; char verify[32];
INTEGER_t val; INTEGER_t val;
uint8_t *buf_end = buf + size; uint8_t *buf_end = buf + size;
int ret; int ret = -1;
uint64_t ruint64 = 123; uint64_t ruint64 = 123;
assert(buf); assert(buf);
...@@ -283,7 +283,7 @@ check_xer(int lineno, int tofail, char *xmldata, long orig_value) { ...@@ -283,7 +283,7 @@ check_xer(int lineno, int tofail, char *xmldata, long orig_value) {
INTEGER_t *st = 0; INTEGER_t *st = 0;
asn_dec_rval_t rc; asn_dec_rval_t rc;
long value; long value;
int ret; int ret = -1;
printf("%03d: [%s] vs %ld: ", lineno, xmldata, orig_value); printf("%03d: [%s] vs %ld: ", lineno, xmldata, orig_value);
...@@ -314,8 +314,8 @@ static void ...@@ -314,8 +314,8 @@ static void
check_jer(int lineno, int tofail, char *jsondata, long orig_value) { check_jer(int lineno, int tofail, char *jsondata, long orig_value) {
INTEGER_t *st = 0; INTEGER_t *st = 0;
asn_dec_rval_t rc; asn_dec_rval_t rc;
long value; long value = 0;
int ret; int ret = -1;
printf("%03d: [%s] vs %ld: ", lineno, jsondata, orig_value); printf("%03d: [%s] vs %ld: ", lineno, jsondata, orig_value);
fflush(stdout); fflush(stdout);
...@@ -350,9 +350,9 @@ check_strtoimax() { ...@@ -350,9 +350,9 @@ check_strtoimax() {
char positive_max[32]; char positive_max[32];
char negative_min[32]; char negative_min[32];
const int len_pmax = snprintf(positive_max, sizeof(positive_max), 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), 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_pmax < (int)sizeof(positive_max));
assert(len_nmin < (int)sizeof(negative_min)); assert(len_nmin < (int)sizeof(negative_min));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment