patch: fix of compiler warnings

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Andreas.Eversberg Andreas.Eversberg at versatel.de
Mon Nov 16 17:52:32 UTC 2009


this patch fixes (not all) compiler warnings.

diff --git a/openbsc/include/openbsc/talloc.h
b/openbsc/include/openbsc/talloc.h
index f7f7643..cd7ca17 100644
--- a/openbsc/include/openbsc/talloc.h
+++ b/openbsc/include/openbsc/talloc.h
@@ -189,4 +189,8 @@ char *talloc_asprintf_append_buffer(char *s, const
char *fmt, ...) PRINTF_ATTRIB
 
 void talloc_set_abort_fn(void (*abort_fn)(const char *reason));
 
+void talloc_ctx_init(void);
+void on_dso_load_token(void);
+void on_dso_load_rrlp(void);
+
 #endif
diff --git a/openbsc/src/bsc_init.c b/openbsc/src/bsc_init.c
index 815fe2b..3b451b1 100644
--- a/openbsc/src/bsc_init.c
+++ b/openbsc/src/bsc_init.c
@@ -433,8 +433,8 @@ int nm_state_event(enum nm_evt evt, u_int8_t
obj_class, void *obj,
 static int sw_activ_rep(struct msgb *mb)
 {
 	struct abis_om_fom_hdr *foh = msgb_l3(mb);
-	struct gsm_bts *bts = mb->trx->bts;
-	struct gsm_bts_trx *trx = gsm_bts_trx_num(bts,
foh->obj_inst.trx_nr);
+//	struct gsm_bts *bts = mb->trx->bts;
+//	struct gsm_bts_trx *trx = gsm_bts_trx_num(bts,
foh->obj_inst.trx_nr);
 
 
 	switch (foh->obj_class) {
diff --git a/openbsc/src/db.c b/openbsc/src/db.c
index b86348c..59dac2c 100644
--- a/openbsc/src/db.c
+++ b/openbsc/src/db.c
@@ -265,7 +265,7 @@ static int get_equipment_by_subscr(struct
gsm_subscriber *subscr)
 {
 	dbi_result result;
 	const char *string;
-	unsigned int cm1;
+	unsigned char cm1;
 	const unsigned char *cm2, *cm3;
 	struct gsm_equipment *equip = &subscr->equipment;
 
diff --git a/openbsc/src/rtp_proxy.c b/openbsc/src/rtp_proxy.c
index b92526e..42c2d15 100644
--- a/openbsc/src/rtp_proxy.c
+++ b/openbsc/src/rtp_proxy.c
@@ -676,7 +676,7 @@ int rtp_socket_proxy(struct rtp_socket *this, struct
rtp_socket *other)
 int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network
*net, u_int32_t callref)
 {
 	DEBUGP(DMUX, "rtp_socket_proxy(this=%p, callref=%lu)\n",
-		this, callref);
+		this, (unsigned long)callref);
 
 	if (callref) {
 		this->rx_action = RTP_RECV_UPSTREAM;
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index d623b3d..e3de43a 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -36,6 +36,8 @@
 #include <openbsc/db.h>
 #include <openbsc/talloc.h>
 
+int bsc_vty_init_extra(struct gsm_network *net);
+
 static struct gsm_network *gsmnet;
 
 struct cmd_node net_node = {
@@ -624,7 +626,7 @@ DEFUN(show_e1ts,
       "show e1_timeslot [line_nr] [ts_nr]",
 	SHOW_STR "Display information about a E1 timeslot\n")
 {
-	struct e1inp_line *line;
+	struct e1inp_line *line = NULL;
 	struct e1inp_ts *ts;
 	int ts_nr;
 
@@ -638,12 +640,14 @@ DEFUN(show_e1ts,
 		return CMD_SUCCESS;
 	}
 	if (argc >= 1) {
-		int num = atoi(argv[0]);
+		int num = atoi(argv[0]), found = 0;
 		llist_for_each_entry(line, &e1inp_line_list, list) {
-			if (line->num == num)
+			if (line->num == num) {
+				found = 1;
 				break;
+			}
 		}
-		if (!line || line->num != num) {
+		if (found < 0) {
 			vty_out(vty, "E1 line %s is invalid%s",
 				argv[0], VTY_NEWLINE);
 			return CMD_WARNING;
diff --git a/openbsc/tests/sms/sms_test.c b/openbsc/tests/sms/sms_test.c
index fa09636..2ce2cc6 100644
--- a/openbsc/tests/sms/sms_test.c
+++ b/openbsc/tests/sms/sms_test.c
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <openbsc/debug.h>
 #include <openbsc/msgb.h>
+#include <openbsc/gsm_data.h>
 #include <openbsc/gsm_utils.h>
 
 int main(int argc, char** argv)
diff --git a/openbsc/tests/timer/timer_test.c
b/openbsc/tests/timer/timer_test.c
index 26fcbc9..1515652 100644
--- a/openbsc/tests/timer/timer_test.c
+++ b/openbsc/tests/timer/timer_test.c
@@ -26,17 +26,17 @@
 static void timer_fired(unsigned long data);
 
 static struct timer_list timer_one = {
-    .cb = timer_fired,
+    .cb = (void *)timer_fired,
     .data = (void*)1,
 };
 
 static struct timer_list timer_two = {
-    .cb = timer_fired,
+    .cb = (void *)timer_fired,
     .data = (void*)2,
 };
 
 static struct timer_list timer_three = {
-    .cb = timer_fired,
+    .cb = (void *)timer_fired,
     .data = (void*)3,
 };
 




More information about the OpenBSC mailing list