Silence compiler warnings

clang -Wcast-align warnings with ambisonics enabled
clang -Wnull-pointer-arithmetic warnings in test_opus_api.c
gcc -Wimplicit-fallthrough warnings on arm
msvc warning C4244 in celt_encoder.c with fixed point
This commit is contained in:
Mark Harris 2018-07-21 17:55:24 -07:00
parent c1c247d7e7
commit 01b035f8ba
No known key found for this signature in database
GPG key ID: 92293B4D0118BDB0
6 changed files with 54 additions and 46 deletions

View file

@ -58,7 +58,8 @@ opus_int32 mapping_matrix_get_size(int rows, int cols)
opus_int16 *mapping_matrix_get_data(const MappingMatrix *matrix)
{
return (opus_int16*)((char*)matrix + align(sizeof(MappingMatrix)));
/* void* cast avoids clang -Wcast-align warning */
return (opus_int16*)(void*)((char*)matrix + align(sizeof(MappingMatrix)));
}
void mapping_matrix_init(MappingMatrix * const matrix,