summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-10-29 13:03:23 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-10-29 13:03:23 +0000
commit15ac76178ac47dcd427f24d2772ac2b68add07cd (patch)
tree1d9487e6e5fb5a4cb9be67fc85a8a48a1b5b3096 /include
parent80fb221f10135c73846365e234fd66a8a834d6e5 (diff)
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
Diffstat (limited to 'include')
-rwxr-xr-xinclude/asterisk/utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 9aa1a34c3..2f603a77a 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)