[Asterisk-code-review] codec gsm: Avoid shifting a negative signed value. (asterisk[13])

Jenkins2 asteriskteam at digium.com
Tue Jan 9 05:59:46 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7854 )

Change subject: codec_gsm: Avoid shifting a negative signed value.
......................................................................

codec_gsm: Avoid shifting a negative signed value.

clang 5.0 warned about this.

ASTERISK-27558

Change-Id: Icc452ecb0d86bbeba78dae768cc472ec540699df
---
M codecs/gsm/src/short_term.c
1 file changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/codecs/gsm/src/short_term.c b/codecs/gsm/src/short_term.c
index 4172d32..d22d276 100644
--- a/codecs/gsm/src/short_term.c
+++ b/codecs/gsm/src/short_term.c
@@ -55,21 +55,21 @@
 	 */
 
 #undef	STEP
-#define	STEP( B, MIC, INVA )	\
+#define	STEP( B_TIMES_TWO, MIC, INVA )	\
 		temp1    = GSM_ADD( *LARc++, MIC ) << 10;	\
-		temp1    = GSM_SUB( temp1, B << 1 );		\
+		temp1    = GSM_SUB( temp1, B_TIMES_TWO );	\
 		temp1    = (word)GSM_MULT_R( INVA, temp1 );		\
 		*LARpp++ = GSM_ADD( temp1, temp1 );
 
 	STEP(      0,  -32,  13107 );
 	STEP(      0,  -32,  13107 );
-	STEP(   2048,  -16,  13107 );
-	STEP(  -2560,  -16,  13107 );
+	STEP(   4096,  -16,  13107 );
+	STEP(  -5120,  -16,  13107 );
 
-	STEP(     94,   -8,  19223 );
-	STEP(  -1792,   -8,  17476 );
-	STEP(   -341,   -4,  31454 );
-	STEP(  -1144,   -4,  29708 );
+	STEP(    188,   -8,  19223 );
+	STEP(  -3584,   -8,  17476 );
+	STEP(   -682,   -4,  31454 );
+	STEP(  -2288,   -4,  29708 );
 
 	/* NOTE: the addition of *MIC is used to restore
 	 * 	 the sign of *LARc.

-- 
To view, visit https://gerrit.asterisk.org/7854
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Icc452ecb0d86bbeba78dae768cc472ec540699df
Gerrit-Change-Number: 7854
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180109/f8608818/attachment-0001.html>


More information about the asterisk-code-review mailing list