From 15ac76178ac47dcd427f24d2772ac2b68add07cd Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Sat, 29 Oct 2005 13:03:23 +0000 Subject: 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 --- include/asterisk/utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/asterisk/utils.h') 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) -- cgit v1.2.3