aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/mgcp.h3
-rw-r--r--openbsc/src/libmsc/db.c6
-rw-r--r--openbsc/src/libmsc/meas_feed.c2
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c4
-rw-r--r--openbsc/src/osmo-bsc_mgcp/mgcp_main.c2
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c4
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c2
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.c2
-rw-r--r--openbsc/tests/gsm0408/gsm0408_test.c2
9 files changed, 16 insertions, 11 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index f334ac86b..fb16cb40f 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -30,6 +30,9 @@
#include "debug.h"
#include <arpa/inet.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#define RTP_PORT_DEFAULT 4000
#define RTP_PORT_NET_DEFAULT 16000
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index 428f99bbc..035202de8 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -301,7 +301,7 @@ static int update_db_revision_3(void)
dbi_result_free(result);
/* Cycle through old messages and convert them to the new format */
- result = dbi_conn_queryf(conn, "SELECT * FROM SMS_3");
+ result = dbi_conn_query(conn, "SELECT * FROM SMS_3");
if (!result) {
LOGP(DDB, LOGL_ERROR,
"Failed fetch messages from the old SMS table (upgrade from rev 3).\n");
@@ -1095,8 +1095,8 @@ int db_subscriber_list_active(void (*cb)(struct gsm_subscriber*,void*), void *cl
{
dbi_result result;
- result = dbi_conn_queryf(conn,
- "SELECT * from Subscriber WHERE LAC != 0 AND authorized = 1");
+ result = dbi_conn_query(conn,
+ "SELECT * from Subscriber WHERE LAC != 0 AND authorized = 1");
if (!result) {
LOGP(DDB, LOGL_ERROR, "Failed to list active subscribers\n");
return -1;
diff --git a/openbsc/src/libmsc/meas_feed.c b/openbsc/src/libmsc/meas_feed.c
index 86d679abf..5fc7c4979 100644
--- a/openbsc/src/libmsc/meas_feed.c
+++ b/openbsc/src/libmsc/meas_feed.c
@@ -2,6 +2,8 @@
#include <unistd.h>
+#include <sys/socket.h>
+
#include <osmocom/core/msgb.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/write_queue.h>
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 1515aea0a..71fff936f 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -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;
}
diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
index 5f703c290..1c03f27d4 100644
--- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
@@ -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;
}
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c b/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c
index faceb59b5..9291c89e6 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c
@@ -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;
}
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index b830eb0df..a4b313c91 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -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();
}
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index 214d477c4..17f0a1795 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 %zu, bvci 0x%04x\n%s\n\n",
event, msgb_bssgp_len(msg), bvci,
osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c
index 692ec90b0..781ef6147 100644
--- a/openbsc/tests/gsm0408/gsm0408_test.c
+++ b/openbsc/tests/gsm0408/gsm0408_test.c
@@ -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); \
}