64bit: Fix compiler warnings in regard to 64bit

vty_interface_layer3.c:584:4: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat=]
    sizeof(subscr->extension)-1, VTY_NEWLINE);
This commit is contained in:
Holger Hans Peter Freyther 2015-08-03 09:28:41 +02:00
parent 5c06e4045a
commit daaea0c84f
6 changed files with 8 additions and 8 deletions

View File

@ -547,7 +547,7 @@ DEFUN(ena_subscr_name,
if (strlen(name) > sizeof(subscr->name)-1) {
vty_out(vty,
"%% NAME is too long, max. %d characters are allowed%s",
"%% NAME is too long, max. %zu characters are allowed%s",
sizeof(subscr->name)-1, VTY_NEWLINE);
return CMD_WARNING;
}
@ -580,7 +580,7 @@ DEFUN(ena_subscr_extension,
if (strlen(ext) > sizeof(subscr->extension)-1) {
vty_out(vty,
"%% EXTENSION is too long, max. %d characters are allowed%s",
"%% EXTENSION is too long, max. %zu characters are allowed%s",
sizeof(subscr->extension)-1, VTY_NEWLINE);
return CMD_WARNING;
}

View File

@ -156,7 +156,7 @@ static int read_call_agent(struct osmo_fd *fd, unsigned int what)
return -1;
} else if (slen > sizeof(addr)) {
fprintf(stderr, "Gateway received message from outerspace: %zu %zu\n",
slen, sizeof(addr));
(size_t) slen, sizeof(addr));
return -1;
}

View File

@ -45,10 +45,10 @@ static void insert_rewrite_node(struct nat_rewrite_rule *rule, struct nat_rewrit
{
struct nat_rewrite_rule *new = &root->rule;
const size_t len = strlen(rule->prefix);
const int len = strlen(rule->prefix);
int i;
if (len == 0) {
if (len <= 0) {
LOGP(DNAT, LOGL_ERROR, "An empty prefix does not make sense.\n");
goto fail;
}

View File

@ -645,7 +645,7 @@ static void test_mgcp_rewrite(void)
}
if (msgb_l2len(output) != strlen(patc)) {
printf("Wrong sizes for test: %d %d != %d != %d\n", i, msgb_l2len(output), strlen(patc), strlen(orig));
printf("Wrong sizes for test: %d %u != %zu != %zu\n", i, msgb_l2len(output), strlen(patc), strlen(orig));
printf("String '%s' vs '%s'\n", (const char *) output->l2h, patc);
abort();
}

View File

@ -956,7 +956,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
int gprs_ns_callback(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
struct msgb *msg, uint16_t bvci)
{
printf("CALLBACK, event %d, msg length %d, bvci 0x%04x\n%s\n\n",
printf("CALLBACK, event %d, msg length %zu, bvci 0x%04x\n%s\n\n",
event, msgb_bssgp_len(msg), bvci,
osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));

View File

@ -48,7 +48,7 @@
#define VERIFY(res, cmp, wanted) \
if (!(res cmp wanted)) { \
printf("ASSERT failed: %s:%d Wanted: %d %s %d\n", \
__FILE__, __LINE__, res, # cmp, wanted); \
__FILE__, __LINE__, (int) res, # cmp, (int) wanted); \
}