[MERGED] osmo-ttcn3-hacks[master]: bsc: Fix tons of TTCN3 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/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Mar 23 12:32:18 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: bsc: Fix tons of TTCN3 compiler warnings
......................................................................


bsc: Fix tons of TTCN3 compiler warnings

Change-Id: I60dc054d19a249d46d44585c17626746c34f4b09
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M library/BSSMAP_Emulation.ttcn
M library/MGCP_Emulation.ttcn
M library/Osmocom_VTY_Functions.ttcn
M library/RSL_Emulation.ttcn
6 files changed, 32 insertions(+), 25 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index d392a71..e4601eb 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -353,11 +353,12 @@
 /* verify we get a CHAN_ACT after CHAN RQD */
 testcase TC_chan_act_noreply() runs on test_CT {
 	var BSSAP_N_UNITDATA_ind ud_ind;
+	var RSL_Message rsl_unused;
 
 	f_init(1);
 
 	IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23)));
-	f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
+	rsl_unused := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
 	setverdict(pass);
 }
 
@@ -365,12 +366,13 @@
 testcase TC_chan_act_counter() runs on test_CT {
 	var BSSAP_N_UNITDATA_ind ud_ind;
 	var integer chreq_total;
+	var RSL_Message rsl_unused;
 
 	f_init(1);
 
 	chreq_total := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total");
 	IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23)));
-	f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
+	rsl_unused := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
 	f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", chreq_total+1);
 
 	setverdict(pass);
@@ -479,7 +481,7 @@
 
 	/* expect 5xTCH/F to succeed */
 	for (i := 0; i < NUM_TCHF_PER_BTS + NUM_SDCCH_PER_BTS; i := i+1) {
-		f_chreq_act_ack('23'O, i);
+		var RslChannelNr chan_nr := f_chreq_act_ack('23'O, i);
 	}
 
 	IPA_RSL[0].clear;
@@ -1359,7 +1361,6 @@
 	[] IPA_RSL[0].receive { repeat }
 	[] T.timeout {
 		self.stop;
-		return false;
 		}
 	}
 
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 659ac36..e648427 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -119,7 +119,6 @@
 	}
 	setverdict(fail, "Only 2 Connections per EP!");
 	self.stop;
-	return -1;
 }
 
 private function f_get_mgcp_conn(MgcpConnectionId cid) runs on MSC_ConnHdlr return integer {
@@ -130,7 +129,6 @@
 	}
 	setverdict(fail, "No Connection for ID ", cid);
 	self.stop;
-	return -1;
 }
 
 
@@ -140,6 +138,7 @@
 	var RSL_Message rsl;
 	var MgcpCommand mgcp_cmd;
 	var RSL_IE_Body ie;
+	var boolean b_unused;
 	[not g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl {
 		/* Extract parameters from request + use in response */
 		if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) {
@@ -157,15 +156,15 @@
 		}
 	[g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{
 		/* Extract conn_id, ip, port, rtp_pt2 from request + use in response */
-		f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
+		b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
 		if (g_media.bts.conn_id != ie.ipa_conn_id) {
 			setverdict(fail, "IPA MDCX for unknown ConnId", rsl);
 			self.stop;
 		}
 		/* mandatory */
-		f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie);
+		b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie);
 		g_media.bts.peer.host := f_inet_ntoa(int2oct(ie.ipa_remote_ip, 4));
-		f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_PORT, ie);
+		b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_PORT, ie);
 		g_media.bts.peer.port_nr := ie.ipa_remote_port;
 		/* optional */
 		if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) {
@@ -201,15 +200,15 @@
 	/* on second (new) BTS during hand-over */
 	[g_media.bts1.ipa_crcx_seen] RSL1.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{
 		/* Extract conn_id, ip, port, rtp_pt2 from request + use in response */
-		f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
+		b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
 		if (g_media.bts1.conn_id != ie.ipa_conn_id) {
 			setverdict(fail, "IPA MDCX for unknown ConnId", rsl);
 			self.stop;
 		}
 		/* mandatory */
-		f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie);
+		b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie);
 		g_media.bts1.peer.host := f_inet_ntoa(int2oct(ie.ipa_remote_ip, 4));
-		f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_PORT, ie);
+		b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_PORT, ie);
 		g_media.bts1.peer.port_nr := ie.ipa_remote_port;
 		/* optional */
 		if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) {
@@ -330,11 +329,14 @@
 	create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback),
 	unitdata_cb := refers(UnitdataCallback),
 	decode_dtap := false,
-	role_ms := false
+	role_ms := false,
+	sccp_addr_local := omit,
+	sccp_addr_peer := omit
 }
 
 const MGCPOps MSC_MGCPOps := {
-	create_cb := refers(MGCP_Emulation.ExpectedCreateCallback)
+	create_cb := refers(MGCP_Emulation.ExpectedCreateCallback),
+	unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback)
 }
 
 /* register an expect with the BSSMAP core */
@@ -626,7 +628,7 @@
 }
 
 /* establish a channel fully, expecting an assignment matching 'exp' */
-function f_establish_fully(PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl)
+function f_establish_fully_ret(PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl)
 runs on MSC_ConnHdlr return PDU_BSSAP {
 	var PDU_BSSAP bssap;
 	timer T := 10.0;
@@ -699,6 +701,11 @@
 	return bssap;
 }
 
+function f_establish_fully(PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl)
+runs on MSC_ConnHdlr {
+	var PDU_BSSAP unused := f_establish_fully_ret(ass_cmd, exp_ass_cpl);
+}
+
 type record HandoverState {
 	/* Assignment related bits */
 	boolean rr_ho_cmpl_seen,
diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn
index 2d9effc..95b39f3 100644
--- a/library/BSSMAP_Emulation.ttcn
+++ b/library/BSSMAP_Emulation.ttcn
@@ -98,6 +98,7 @@
 
 template PDU_DTAP_MO tr_PDU_DTAP_MO(template PDU_ML3_MS_NW dtap, template OCT1 dlci := *) := {
 	dlci := dlci,
+	skip_seq_patching := ?,
 	dtap := dtap
 }
 
diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn
index adcb8b5..aaef39e 100644
--- a/library/MGCP_Emulation.ttcn
+++ b/library/MGCP_Emulation.ttcn
@@ -267,7 +267,7 @@
 			if (p.callagent_udp_port == -1) {
 				/* we aren't yet connected to the remote side port, let's fix this */
 				p.callagent_udp_port := mrf.remPort;
-				MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, g_mgcp_conn_id, { udp:={} });
+				res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, g_mgcp_conn_id, { udp:={} });
 			}
 			if (ischosen(mrf.msg.command)) {
 				cmd := mrf.msg.command;
diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn
index ccea0f2..9258fa5 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -74,7 +74,7 @@
 
 	/* send a VTY command and obtain response until prompt is received */
 	function f_vty_transceive(TELNETasp_PT pt, charstring tx) {
-		f_vty_transceive_ret(pt, tx);
+		var charstring unused := f_vty_transceive_ret(pt, tx);
 	}
 
 	type integer BtsNr (0..255);
diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn
index 20a54a9..b743d60 100644
--- a/library/RSL_Emulation.ttcn
+++ b/library/RSL_Emulation.ttcn
@@ -184,7 +184,7 @@
 
 /* create an ew client with given RA and FN */
 private function f_cid_create(OCT1 ra, GsmFrameNumber fn, RSL_DchanHdlr comp_ref)
-runs on RSL_Emulation_CT return integer {
+runs on RSL_Emulation_CT {
 	var integer i;
 	for (i := 0; i < sizeof(ConnectionTable); i := i+1) {
 		if (not ispresent(ConnectionTable[i].ra) and
@@ -192,16 +192,15 @@
 			ConnectionTable[i].ra := ra;
 			ConnectionTable[i].ra_fn := fn;
 			ConnectionTable[i].comp_ref := comp_ref;
-			return i;
+			return;
 		}
 	}
-	log("No free entry in conn table for ", ra, fn);
-	return -1;
+	setverdict(fail, "No free entry in conn table for ", ra, fn);
 }
 
 /* create an ew client with given RA and FN */
 private function f_cid_create_cnr(uint8_t trx_nr, RslChannelNr chan_nr,  RSL_DchanHdlr comp_ref)
-runs on RSL_Emulation_CT return integer {
+runs on RSL_Emulation_CT {
 	var integer i;
 	for (i := 0; i < sizeof(ConnectionTable); i := i+1) {
 		if (not ispresent(ConnectionTable[i].ra) and
@@ -210,11 +209,10 @@
 			ConnectionTable[i].trx_nr := trx_nr;
 			ConnectionTable[i].chan_nr := chan_nr;
 			ConnectionTable[i].comp_ref := comp_ref;
-			return i;
+			return;
 		}
 	}
-	log("No free entry in conn table for ", trx_nr, chan_nr, comp_ref);
-	return -1;
+	setverdict(fail, "No free entry in conn table for ", trx_nr, chan_nr, comp_ref);
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/7471
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I60dc054d19a249d46d44585c17626746c34f4b09
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list