diff options
author | Ralph Giles <giles@mozilla.com> | 2011-11-30 22:48:32 +0400 |
---|---|---|
committer | Ralph Giles <giles@mozilla.com> | 2012-03-06 05:09:54 +0400 |
commit | 2fa9e6e5386fa5ef0bbe41038ca30bc16810ebb3 (patch) | |
tree | 57cb25e3a19d35d73aec731b12f1b49f04495b73 /silk | |
parent | 9620cf7718d5f3e580b6457cf131ddf424312115 (diff) |
Fix a signed-compare warning.
The silk math debug macros include a bounds check on silk_abs.
Because INT_MIN = (-INT_MAX - 1), abs(INT_MIN) can't be
represented as an int. The macro was checking for this value
as 0x8000... without a cast to signed, warning on gcc.
silk/typedef.h already defines minimum values for the int
types, so we correct the warning by using those.
Diffstat (limited to 'silk')
-rw-r--r-- | silk/MacroDebug.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/silk/MacroDebug.h b/silk/MacroDebug.h index 9d7e1f8a..a0d77c7f 100644 --- a/silk/MacroDebug.h +++ b/silk/MacroDebug.h @@ -524,13 +524,13 @@ static inline opus_int32 silk_abs(opus_int32 a){ #undef silk_abs_int64 static inline opus_int64 silk_abs_int64(opus_int64 a){ - silk_assert(a != 0x8000000000000000); + silk_assert(a != silk_int64_MIN); return (((a) > 0) ? (a) : -(a)); /* Be careful, silk_abs returns wrong when input equals to silk_intXX_MIN */ } #undef silk_abs_int32 static inline opus_int32 silk_abs_int32(opus_int32 a){ - silk_assert(a != 0x80000000); + silk_assert(a != silk_int32_MIN); return abs(a); } |