[PATCH] gsm0480.c: squelch compiler warning due to const (caused recently)

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/.

Neels Hofmeyr nhofmeyr at sysmocom.de
Mon Mar 14 22:52:39 UTC 2016


The introduction of gsm48_hdr_pdisc() caused a new compiler warning.
In gsm0480_decode_*(), the gsm48_hdr is const, which we can safely cast
away to avoid the warning.
---
 src/gsm/gsm0480.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 8963b78..bb47cc6 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -220,7 +220,7 @@ int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len,
 		return 0;
 	}
 
-	if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {
+	if (gsm48_hdr_pdisc((struct gsm48_hdr*)hdr) == GSM48_PDISC_NC_SS) {
 		req->transaction_id = hdr->proto_discr & 0x70;
 
 		ss.transaction_id = req->transaction_id;
@@ -254,7 +254,7 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len,
 		return 0;
 	}
 
-	if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) {
+	if (gsm48_hdr_pdisc((struct gsm48_hdr*)hdr) == GSM48_PDISC_NC_SS) {
 		req->transaction_id = hdr->proto_discr & 0x70;
 		rc = parse_ss(hdr, len, req);
 	}
-- 
2.1.4




More information about the OpenBSC mailing list