From patchwork Wed Oct 22 14:50:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max X-Patchwork-Id: 402164 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [IPv6:2001:780:45:1d:225:90ff:fe52:c662]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 331A9140081 for ; Thu, 23 Oct 2014 01:50:57 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=ganesha.gnumonks.org) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1XgxFL-0006Ex-M1; Wed, 22 Oct 2014 16:50:43 +0200 Received: from hylle06.itea.ntnu.no ([129.241.56.235]) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1XgxEy-0006Dq-Po for openbsc@lists.osmocom.org; Wed, 22 Oct 2014 16:50:25 +0200 Received: from localhost (localhost [127.0.0.1]) by hylle06.itea.ntnu.no (Postfix) with ESMTP id 600CE66123F for ; Wed, 22 Oct 2014 16:50:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hylle06.itea.ntnu.no Received: from alumnimail.it.ntnu.no (alumnimail.it.ntnu.no [129.241.18.22]) by hylle06.itea.ntnu.no (Postfix) with ESMTP id AAB046611FF for ; Wed, 22 Oct 2014 16:50:19 +0200 (CEST) Received: from localhost (nat.sec.t-labs.tu-berlin.de [130.149.230.1]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: suraev) by alumnimail.it.ntnu.no (Postfix) with ESMTPSA id 6D37C580276 for ; Wed, 22 Oct 2014 16:50:19 +0200 (CEST) From: Max To: openbsc@lists.osmocom.org Subject: [PATCH] Fix bunch of printf warnings Date: Wed, 22 Oct 2014 16:50:08 +0200 Message-Id: <1413989408-14993-1-git-send-email-max.suraev@fairwaves.co> X-Mailer: git-send-email 1.9.1 X-Spam-Score: -2.1 (--) X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openbsc-bounces@lists.osmocom.org Errors-To: openbsc-bounces@lists.osmocom.org Signed-off-by: Max --- openbsc/src/libbsc/bsc_api.c | 4 ++-- openbsc/src/libmgcp/mgcp_protocol.c | 2 +- openbsc/tests/abis/abis_test.c | 16 ++++++++-------- openbsc/tests/gbproxy/gbproxy_test.c | 16 ++++++++-------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index 5ce0bc4..f4121de 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -416,7 +416,7 @@ static void handle_ass_compl(struct gsm_subscriber_connection *conn, gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { - LOGP(DMSC, LOGL_ERROR, "Assignment Compl invalid: %u\n", + LOGP(DMSC, LOGL_ERROR, "Assignment Compl invalid: %lu\n", msgb_l3len(msg) - sizeof(*gh)); return; } @@ -461,7 +461,7 @@ static void handle_ass_fail(struct gsm_subscriber_connection *conn, gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { - LOGP(DMSC, LOGL_ERROR, "assignemnt failure unhandled: %u\n", + LOGP(DMSC, LOGL_ERROR, "assignemnt failure unhandled: %lu\n", msgb_l3len(msg) - sizeof(*gh)); rr_failure = NULL; } else { diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c index 79422fe..00315fb 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -308,7 +308,7 @@ static int write_response_sdp(struct mgcp_endpoint *endp, return len; buffer_too_small: - LOGP(DMGCP, LOGL_ERROR, "SDP buffer too small: %d (needed %d)\n", + LOGP(DMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n", size, len); return -1; } diff --git a/openbsc/tests/abis/abis_test.c b/openbsc/tests/abis/abis_test.c index e7e78d2..f82740f 100644 --- a/openbsc/tests/abis/abis_test.c +++ b/openbsc/tests/abis/abis_test.c @@ -61,11 +61,11 @@ 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(); } - printf("Start: %u len: %zu\n", descr[0].start - simple_config, descr[0].len); + printf("Start: %lu len: %zu\n", descr[0].start - simple_config, descr[0].len); printf("file_id: %s\n", osmo_hexdump(descr[0].file_id, descr[0].file_id_len)); printf("file_ver: %s\n", osmo_hexdump(descr[0].file_ver, descr[0].file_ver_len)); } @@ -99,20 +99,20 @@ 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(); } - printf("Start: %u len: %zu\n", descr[0].start - dual_config, descr[0].len); + printf("Start: %lu len: %zu\n", descr[0].start - dual_config, descr[0].len); printf("file_id: %s\n", osmo_hexdump(descr[0].file_id, descr[0].file_id_len)); printf("file_ver: %s\n", osmo_hexdump(descr[0].file_ver, descr[0].file_ver_len)); - printf("Start: %u len: %zu\n", descr[1].start - dual_config, descr[1].len); + printf("Start: %lu len: %zu\n", descr[1].start - dual_config, descr[1].len); printf("file_id: %s\n", osmo_hexdump(descr[1].file_id, descr[1].file_id_len)); printf("file_ver: %s\n", osmo_hexdump(descr[1].file_ver, descr[1].file_ver_len)); } @@ -129,11 +129,11 @@ static void test_sw_selection(void) abort(); } - printf("Start: %u len: %zu\n", descr[0].start - load_config, descr[0].len); + printf("Start: %lu len: %zu\n", descr[0].start - load_config, descr[0].len); printf("file_id: %s\n", osmo_hexdump(descr[0].file_id, descr[0].file_id_len)); printf("file_ver: %s\n", osmo_hexdump(descr[0].file_ver, descr[0].file_ver_len)); - printf("Start: %u len: %zu\n", descr[1].start - load_config, descr[1].len); + printf("Start: %lu len: %zu\n", descr[1].start - load_config, descr[1].len); printf("file_id: %s\n", osmo_hexdump(descr[1].file_id, descr[1].file_id_len)); printf("file_ver: %s\n", osmo_hexdump(descr[1].file_ver, descr[1].file_ver_len)); diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index 5aa301b..161f7fd 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -898,7 +898,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))); @@ -925,15 +925,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 @@ -957,15 +957,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) { @@ -1195,7 +1195,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; }