diff options
author | Mark Harris <mark.hsj@gmail.com> | 2017-02-21 06:51:40 +0300 |
---|---|---|
committer | Mark Harris <mark.hsj@gmail.com> | 2017-02-27 06:10:45 +0300 |
commit | d6d70371e85ec83307f6df0e067d353daa8e6f33 (patch) | |
tree | 9e118ef0267e2e0734cc9db4c5bbd6016aa0e089 /celt/fixed_generic.h | |
parent | 8056706f48880bbf0bb7ee842f1067b85f613353 (diff) |
Fix compiler warnings
- celt/modes.c:430:14: warning: cast from 'const unsigned char *' to
'opus_int16 *' increases required alignment from 1 to 2 [-Wcast-align]
- 'C[0][1]' may be used uninitialized [-Wmaybe-uninitialized]
- Unused variable/parameter
- Value stored is never read
- MSVC warnings about "possible loss of data" due to type conversions
- MSVC warning C4146: unary minus operator applied to unsigned type
- silk/NLSF_del_dec_quant.c:137:20: warning: array subscript is above
array bounds [-Warray-bounds] (gcc -O3 false positive)
- src/mlp_train.h:39:20: warning: function declaration isn't a prototype
[-Wstrict-prototypes]
- Remove SMALL_FOOTPRINT code from SSE 4.1 FIR implementation, matching
the C implementation.
The clang -Wcast-align warnings with SSE intrinsics are a known
clang issue: https://llvm.org/bugs/show_bug.cgi?id=20670
Diffstat (limited to 'celt/fixed_generic.h')
-rw-r--r-- | celt/fixed_generic.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/celt/fixed_generic.h b/celt/fixed_generic.h index 3561b93c..5f4abda7 100644 --- a/celt/fixed_generic.h +++ b/celt/fixed_generic.h @@ -122,9 +122,11 @@ /** Add two 32-bit values, ignore any overflows */ #define ADD32_ovflw(a,b) ((opus_val32)((opus_uint32)(a)+(opus_uint32)(b))) -/** Subtract two 32-bit values, ignore any overflows */ +/** Subtract two 32-bit values, ignore any overflows */ #define SUB32_ovflw(a,b) ((opus_val32)((opus_uint32)(a)-(opus_uint32)(b))) -#define NEG32_ovflw(a) ((opus_val32)(-(opus_uint32)(a))) +/* Avoid MSVC warning C4146: unary minus operator applied to unsigned type */ +/** Negate 32-bit value, ignore any overflows */ +#define NEG32_ovflw(a) ((opus_val32)(0-(opus_uint32)(a))) /** 16x16 multiplication where the result fits in 16 bits */ #define MULT16_16_16(a,b) ((((opus_val16)(a))*((opus_val16)(b)))) |