misc: Fix warnings about size of size_t in printf

Fixes warnings like:

warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat]
This commit is contained in:
Holger Hans Peter Freyther 2015-04-23 11:55:23 -04:00
parent adc17268fc
commit 8e6ecc9667
4 changed files with 16 additions and 16 deletions

View File

@ -153,7 +153,7 @@ static int decode_auth_info(uint8_t *data, size_t data_len,
parse_error:
LOGP(DGPRS, LOGL_ERROR,
"GSUP IE type %d, length %d invalid in PDP info\n", iei, value_len);
"GSUP IE type %d, length %zu invalid in PDP info\n", iei, value_len);
return -1;
}

View File

@ -197,7 +197,7 @@ static int gprs_subscr_handle_gsup_auth_res(struct gsm_subscriber *subscr,
struct sgsn_subscriber_data *sdata = subscr->sgsn_data;
LOGGSUBSCRP(LOGL_INFO, subscr,
"Got SendAuthenticationInfoResult, num_auth_tuples = %d\n",
"Got SendAuthenticationInfoResult, num_auth_tuples = %zu\n",
gsup_msg->num_auth_tuples);
if (gsup_msg->num_auth_tuples > 0) {
@ -210,10 +210,10 @@ static int gprs_subscr_handle_gsup_auth_res(struct gsm_subscriber *subscr,
for (idx = 0; idx < gsup_msg->num_auth_tuples; idx++) {
size_t key_seq = gsup_msg->auth_tuples[idx].key_seq;
LOGGSUBSCRP(LOGL_DEBUG, subscr,
"Adding auth tuple, cksn = %d\n", key_seq);
"Adding auth tuple, cksn = %zu\n", key_seq);
if (key_seq >= ARRAY_SIZE(sdata->auth_triplets)) {
LOGGSUBSCRP(LOGL_NOTICE, subscr,
"Skipping auth triplet with invalid cksn %d\n",
"Skipping auth triplet with invalid cksn %zu\n",
key_seq);
continue;
}
@ -275,14 +275,14 @@ static void gprs_subscr_gsup_insert_data(struct gsm_subscriber *subscr,
if (pdp_info->apn_enc_len >= sizeof(pdp_data->apn_str)-1) {
LOGGSUBSCRP(LOGL_ERROR, subscr,
"APN too long, context id = %d, APN = %s\n",
"APN too long, context id = %zu, APN = %s\n",
ctx_id, osmo_hexdump(pdp_info->apn_enc,
pdp_info->apn_enc_len));
continue;
}
LOGGSUBSCRP(LOGL_INFO, subscr,
"Will set PDP info, context id = %d, APN = %s\n",
"Will set PDP info, context id = %zu, APN = %s\n",
ctx_id, osmo_hexdump(pdp_info->apn_enc, pdp_info->apn_enc_len));
/* Set PDP info [ctx_id] */

View File

@ -61,7 +61,7 @@ static void test_simple_sw_config(void)
}
if (descr[0].len != 13) {
printf("WRONG SIZE: %d\n", descr[0].len);
printf("WRONG SIZE: %zu\n", descr[0].len);
abort();
}
@ -99,12 +99,12 @@ static void test_dual_sw_config(void)
}
if (descr[0].len != 13) {
printf("WRONG SIZE0: %d\n", descr[0].len);
printf("WRONG SIZE0: %zu\n", descr[0].len);
abort();
}
if (descr[1].len != 13) {
printf("WRONG SIZE1: %d\n", descr[1].len);
printf("WRONG SIZE1: %zu\n", descr[1].len);
abort();
}

View File

@ -983,15 +983,15 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
real_sendto = dlsym(RTLD_NEXT, "sendto");
if (dest_host == REMOTE_BSS_ADDR)
printf("MESSAGE to BSS at 0x%08x:%d, msg length %d\n%s\n\n",
printf("MESSAGE to BSS at 0x%08x:%d, msg length %zu\n%s\n\n",
dest_host, dest_port,
len, osmo_hexdump(buf, len));
else if (dest_host == REMOTE_SGSN_ADDR)
printf("MESSAGE to SGSN at 0x%08x:%d, msg length %d\n%s\n\n",
printf("MESSAGE to SGSN at 0x%08x:%d, msg length %zu\n%s\n\n",
dest_host, dest_port,
len, osmo_hexdump(buf, len));
else if (dest_host == REMOTE_SGSN2_ADDR)
printf("MESSAGE to SGSN 2 at 0x%08x:%d, msg length %d\n%s\n\n",
printf("MESSAGE to SGSN 2 at 0x%08x:%d, msg length %zu\n%s\n\n",
dest_host, dest_port,
len, osmo_hexdump(buf, len));
else
@ -1015,15 +1015,15 @@ int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg)
if (nsei == SGSN_NSEI)
printf("NS UNITDATA MESSAGE to SGSN, BVCI 0x%04x, "
"msg length %d (%s)\n",
"msg length %zu (%s)\n",
bvci, len, __func__);
else if (nsei == SGSN2_NSEI)
printf("NS UNITDATA MESSAGE to SGSN 2, BVCI 0x%04x, "
"msg length %d (%s)\n",
"msg length %zu (%s)\n",
bvci, len, __func__);
else
printf("NS UNITDATA MESSAGE to BSS, BVCI 0x%04x, "
"msg length %d (%s)\n",
"msg length %zu (%s)\n",
bvci, len, __func__);
if (received_messages) {
@ -1253,7 +1253,7 @@ static int gprs_process_message(struct gprs_ns_inst *nsi, const char *text, stru
struct msgb *msg;
int ret;
if (data_len > NS_ALLOC_SIZE - NS_ALLOC_HEADROOM) {
fprintf(stderr, "message too long: %d\n", data_len);
fprintf(stderr, "message too long: %zu\n", data_len);
return -1;
}