Change in libosmocore[master]: gsm0808_utils: constify parameter
dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/11049 ) Change subject: gsm0808_utils: constify parameter .. gsm0808_utils: constify parameter parameter cfg in gsm0808_sc_cfg_from_gsm48_mr_cfg() is used read only. Lets add a const to make this clear to the compiler. Change-Id: I31e8d273b070b0afc446a298299d4f502d6c396b --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 0a7429e..8746ceb 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -104,7 +104,7 @@ int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch); int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch); -uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(struct gsm48_multi_rate_conf *cfg, bool fr); +uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(const struct gsm48_multi_rate_conf *cfg, bool fr); /*! Return 3GPP TS 48.008 3.2.2.49 Current Channel Type 1 from enum gsm_chan_t. */ static inline uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type) diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 4b2a5f5..0d6938e 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1166,7 +1166,7 @@ * \param[in] cfg AMR configuration in GSM 04.08 format. * \param[in] hint if the resulting configuration shall be used with a FR or HR TCH. * \returns configuration bits (S0-S15) */ -uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(struct gsm48_multi_rate_conf *cfg, +uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(const struct gsm48_multi_rate_conf *cfg, bool fr) { uint16_t s15_s0 = 0; -- To view, visit https://gerrit.osmocom.org/11049 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I31e8d273b070b0afc446a298299d4f502d6c396b Gerrit-Change-Number: 11049 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: dexter
Change in libosmocore[master]: gsm0808_utils: constify parameter
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/11049 ) Change subject: gsm0808_utils: constify parameter .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/11049 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I31e8d273b070b0afc446a298299d4f502d6c396b Gerrit-Change-Number: 11049 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Comment-Date: Fri, 21 Sep 2018 08:18:41 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in libosmocore[master]: gsm0808_utils: constify parameter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/11049 Change subject: gsm0808_utils: constify parameter .. gsm0808_utils: constify parameter parameter cfg in gsm0808_sc_cfg_from_gsm48_mr_cfg() is used read only. Lets add a const to make this clear to the compiler. Change-Id: I31e8d273b070b0afc446a298299d4f502d6c396b --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/11049/1 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 0a7429e..8746ceb 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -104,7 +104,7 @@ int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch); int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch); -uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(struct gsm48_multi_rate_conf *cfg, bool fr); +uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(const struct gsm48_multi_rate_conf *cfg, bool fr); /*! Return 3GPP TS 48.008 3.2.2.49 Current Channel Type 1 from enum gsm_chan_t. */ static inline uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type) diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 4b2a5f5..0d6938e 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -1166,7 +1166,7 @@ * \param[in] cfg AMR configuration in GSM 04.08 format. * \param[in] hint if the resulting configuration shall be used with a FR or HR TCH. * \returns configuration bits (S0-S15) */ -uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(struct gsm48_multi_rate_conf *cfg, +uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(const struct gsm48_multi_rate_conf *cfg, bool fr) { uint16_t s15_s0 = 0; -- To view, visit https://gerrit.osmocom.org/11049 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I31e8d273b070b0afc446a298299d4f502d6c396b Gerrit-Change-Number: 11049 Gerrit-PatchSet: 1 Gerrit-Owner: dexter