summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-01-01 12:32:03 +0100
committerHarald Welte <laforge@gnumonks.org>2015-01-01 12:32:03 +0100
commit7b1d25a11e44bbc1cb0d2acd9f1a3d4a16ec7c90 (patch)
tree066ebdd55b1df8e83748c3133b0c8a5e952404b9
parent7b129e76cebee739dc959d70d7c8c257e83c76b1 (diff)
Fix most compiler warnings with gcc-4.9.2
-rw-r--r--openbsc/include/openbsc/Makefile.am2
-rw-r--r--openbsc/include/openbsc/smpp.h4
-rw-r--r--openbsc/src/libbsc/bsc_api.c5
-rw-r--r--openbsc/src/libmgcp/mgcp_protocol.c2
-rw-r--r--openbsc/src/osmo-nitb/bsc_hack.c1
-rw-r--r--openbsc/src/utils/smpp_mirror.c6
-rw-r--r--openbsc/tests/abis/abis_test.c16
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.c16
8 files changed, 30 insertions, 22 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index 8d989ff7e..b55a20cd2 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -15,7 +15,7 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
bss.h gsm_data_shared.h ipaccess.h mncc_int.h \
arfcn_range_encode.h nat_rewrite_trie.h bsc_nat_callstats.h \
osmux.h mgcp_transcode.h rtp.h gprs_utils.h \
- gprs_gb_parse.h
+ gprs_gb_parse.h smpp.h
openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
openbscdir = $(includedir)/openbsc
diff --git a/openbsc/include/openbsc/smpp.h b/openbsc/include/openbsc/smpp.h
new file mode 100644
index 000000000..9941cee5c
--- /dev/null
+++ b/openbsc/include/openbsc/smpp.h
@@ -0,0 +1,4 @@
+#pragma once
+
+int smpp_openbsc_init(void *ctx, uint16_t port);
+void smpp_openbsc_set_net(struct gsm_network *net);
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index 5ce0bc41d..76ceb2d8b 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -89,6 +89,7 @@ static uint8_t lchan_to_chosen_channel(struct gsm_lchan *lchan)
channel = 0x9;
break;
case GSM_LCHAN_UNKNOWN:
+ default:
LOGP(DMSC, LOGL_ERROR, "Unknown lchan type: %p\n", lchan);
break;
}
@@ -416,7 +417,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: %zu\n",
msgb_l3len(msg) - sizeof(*gh));
return;
}
@@ -461,7 +462,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: %zu\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 5df357776..f22dd2012 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -309,7 +309,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: %zd (needed %d)\n",
size, len);
return -1;
}
diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c
index 753fd88cc..351789992 100644
--- a/openbsc/src/osmo-nitb/bsc_hack.c
+++ b/openbsc/src/osmo-nitb/bsc_hack.c
@@ -50,6 +50,7 @@
#include <osmocom/ctrl/ports.h>
#include <openbsc/ctrl.h>
#include <openbsc/osmo_bsc_rf.h>
+#include <openbsc/smpp.h>
#include "../../bscconfig.h"
diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c
index 488c4a193..cf3657e39 100644
--- a/openbsc/src/utils/smpp_mirror.c
+++ b/openbsc/src/utils/smpp_mirror.c
@@ -247,7 +247,7 @@ dead_socket:
return 0;
}
-static void esme_write_cb(struct osmo_fd *ofd, struct msgb *msg)
+static int esme_write_cb(struct osmo_fd *ofd, struct msgb *msg)
{
struct esme *esme = ofd->data;
int rc;
@@ -260,8 +260,10 @@ static void esme_write_cb(struct osmo_fd *ofd, struct msgb *msg)
exit(99);
} else if (rc < msgb_length(msg)) {
LOGP(DSMPP, LOGL_ERROR, "[%s] Short write\n", esme->system_id);
- return;
+ return 0;
}
+
+ return 0;
}
static int smpp_esme_init(struct esme *esme, const char *host, uint16_t port)
diff --git a/openbsc/tests/abis/abis_test.c b/openbsc/tests/abis/abis_test.c
index e7e78d202..df270bfbd 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: %ld 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: %ld 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: %ld 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: %ld 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: %ld 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 0fc8af202..0c18ab7b1 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -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 %ld, bvci 0x%04x\n%s\n\n",
event, msgb_bssgp_len(msg), bvci,
osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
@@ -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;
}