[MERGED] libosmocore[master]: osmo_{fr, hr}_check_sid(): Use const input argument

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 Jun 9 08:48:14 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: osmo_{fr,hr}_check_sid(): Use const input argument
......................................................................


osmo_{fr,hr}_check_sid(): Use const input argument

Change-Id: If779cce63f06a18d4f3b0cb3d6dd7a99aa52a646
---
M include/osmocom/codec/codec.h
M src/codec/gsm610.c
M src/codec/gsm620.c
3 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/codec/codec.h b/include/osmocom/codec/codec.h
index fb127b5..05da911 100644
--- a/include/osmocom/codec/codec.h
+++ b/include/osmocom/codec/codec.h
@@ -63,8 +63,8 @@
 	}
 }
 
-bool osmo_fr_check_sid(uint8_t *rtp_payload, size_t payload_len);
-bool osmo_hr_check_sid(uint8_t *rtp_payload, size_t payload_len);
+bool osmo_fr_check_sid(const uint8_t *rtp_payload, size_t payload_len);
+bool osmo_hr_check_sid(const uint8_t *rtp_payload, size_t payload_len);
 int osmo_amr_rtp_enc(uint8_t *payload, uint8_t cmr, enum osmo_amr_type ft,
 		     enum osmo_amr_quality bfi);
 int osmo_amr_rtp_dec(const uint8_t *payload, int payload_len, uint8_t *cmr,
diff --git a/src/codec/gsm610.c b/src/codec/gsm610.c
index 165484d..3346ffc 100644
--- a/src/codec/gsm610.c
+++ b/src/codec/gsm610.c
@@ -303,7 +303,7 @@
  *  \param[in] payload_len Length of payload
  *  \returns true if code word is found, false otherwise
  */
-bool osmo_fr_check_sid(uint8_t *rtp_payload, size_t payload_len)
+bool osmo_fr_check_sid(const uint8_t *rtp_payload, size_t payload_len)
 {
 	struct bitvec bv;
 	uint16_t i, z_bits[] = { 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, 72, 73,
@@ -321,7 +321,7 @@
 	if ((rtp_payload[0] >> 4) != 0xD)
 		return false;
 
-	bv.data = rtp_payload;
+	bv.data = (uint8_t *) rtp_payload;
 	bv.data_len = payload_len;
 
 	/* code word is all 0 at given bits, numbered from 1 */
diff --git a/src/codec/gsm620.c b/src/codec/gsm620.c
index 6f1a95b..29ae4f5 100644
--- a/src/codec/gsm620.c
+++ b/src/codec/gsm620.c
@@ -277,11 +277,11 @@
  *  \param[in] payload_len Length of payload
  *  \returns true if code word is found, false otherwise
  */
-bool osmo_hr_check_sid(uint8_t *rtp_payload, size_t payload_len)
+bool osmo_hr_check_sid(const uint8_t *rtp_payload, size_t payload_len)
 {
 	uint8_t i, bits[] = { 1, 2, 8, 9, 5, 4, 9, 5, 4, 9, 5, 4, 9, 5 };
 	struct bitvec bv;
-	bv.data = rtp_payload;
+	bv.data = (uint8_t *) rtp_payload;
 	bv.data_len = payload_len;
 	bv.cur_bit = 33;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If779cce63f06a18d4f3b0cb3d6dd7a99aa52a646
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list