summaryrefslogtreecommitdiffstats
path: root/tests/gb
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-11-09 16:32:43 +0000
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-11-09 16:46:03 +0000
commitfdb46676094c50f1d2dcebfcb5e051c2baf984ac (patch)
treea8b1e18e185c02b46aee62db09e6d3d84982581e /tests/gb
parentee6652b4bcc1bffc0b7c181666c4c1b30f5abad2 (diff)
test: Fix compiler warnings on 64bit systems
Use %td to print ptrdiff_t use %zu to print size_t, include time.h on FreeBSD. Some more compiler warnings are left but they require more thinking.
Diffstat (limited to 'tests/gb')
-rw-r--r--tests/gb/gprs_bssgp_test.c4
-rw-r--r--tests/gb/gprs_ns_test.c14
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/gb/gprs_bssgp_test.c b/tests/gb/gprs_bssgp_test.c
index 14ba4d1d..707b64bf 100644
--- a/tests/gb/gprs_bssgp_test.c
+++ b/tests/gb/gprs_bssgp_test.c
@@ -45,7 +45,7 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
if (!real_sendto)
real_sendto = dlsym(RTLD_NEXT, "sendto");
- fprintf(stderr, "MESSAGE to 0x%08x, msg length %d\n%s\n",
+ fprintf(stderr, "MESSAGE to 0x%08x, msg length %zu\n%s\n",
dest_host, len, osmo_hexdump(buf, len));
return len;
@@ -55,7 +55,7 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
int gprs_ns_callback(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
struct msgb *msg, uint16_t bvci)
{
- fprintf(stderr, "CALLBACK, event %d, msg length %d, bvci 0x%04x\n%s\n\n",
+ fprintf(stderr, "CALLBACK, event %d, msg length %td, bvci 0x%04x\n%s\n\n",
event, msgb_bssgp_len(msg), bvci,
osmo_hexdump(msgb_bssgph(msg), msgb_bssgp_len(msg)));
return 0;
diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c
index a742130f..4c6fd391 100644
--- a/tests/gb/gprs_ns_test.c
+++ b/tests/gb/gprs_ns_test.c
@@ -249,7 +249,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 %td, bvci 0x%04x\n%s\n\n",
event, msgb_bssgp_len(msg), bvci,
osmo_hexdump(msgb_bssgph(msg), msgb_bssgp_len(msg)));
return 0;
@@ -270,9 +270,9 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
sent_pdu_type = len > 0 ? ((uint8_t *)buf)[0] : -1;
if (dest_host == REMOTE_BSS_ADDR)
- printf("MESSAGE to BSS, msg length %d\n%s\n\n", len, osmo_hexdump(buf, len));
+ printf("MESSAGE to BSS, msg length %zu\n%s\n\n", len, osmo_hexdump(buf, len));
else if (dest_host == REMOTE_SGSN_ADDR)
- printf("MESSAGE to SGSN, msg length %d\n%s\n\n", len, osmo_hexdump(buf, len));
+ printf("MESSAGE to SGSN, msg length %zu\n%s\n\n", len, osmo_hexdump(buf, len));
else
return real_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
@@ -294,10 +294,10 @@ int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg)
real_gprs_ns_sendmsg = dlsym(RTLD_NEXT, "gprs_ns_sendmsg");
if (nsei == SGSN_NSEI)
- printf("NS UNITDATA MESSAGE to SGSN, BVCI 0x%04x, msg length %d\n%s\n\n",
+ printf("NS UNITDATA MESSAGE to SGSN, BVCI 0x%04x, msg length %zu\n%s\n\n",
bvci, len, osmo_hexdump(buf, len));
else
- printf("NS UNITDATA MESSAGE to BSS, BVCI 0x%04x, msg length %d\n%s\n\n",
+ printf("NS UNITDATA MESSAGE to BSS, BVCI 0x%04x, msg length %zu\n%s\n\n",
bvci, len, osmo_hexdump(buf, len));
return real_gprs_ns_sendmsg(nsi, msg);
@@ -382,7 +382,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;
}
@@ -411,7 +411,7 @@ static int gprs_send_message(struct gprs_ns_inst *nsi, const char *text,
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;
}