From: Kevin P. Fleming Date: Sat, 29 Oct 2005 13:03:23 +0000 (+0000) Subject: do saturated math properly (thanks to the eagle-eyes of Tony Mountifield) X-Git-Tag: 1.2.0-beta2~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15ac76178ac47dcd427f24d2772ac2b68add07cd;p=thirdparty%2Fasterisk.git do saturated math properly (thanks to the eagle-eyes of Tony Mountifield) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6888 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index 9aa1a34c3f..2f603a77a2 100755 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -173,7 +173,7 @@ static inline void ast_slinear_saturated_add(short *input, short value) { int res; - res = *input + value; + res = (int) *input + value; if (res > 32767) *input = 32767; else if (res < -32767) @@ -186,7 +186,7 @@ static inline void ast_slinear_saturated_multiply(short *input, short value) { int res; - res = *input * value; + res = (int) *input * value; if (res > 32767) *input = 32767; else if (res < -32767)