Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Harris <mark.hsj@gmail.com>2017-02-21 06:51:40 +0300
committerMark Harris <mark.hsj@gmail.com>2017-02-27 06:10:45 +0300
commitd6d70371e85ec83307f6df0e067d353daa8e6f33 (patch)
tree9e118ef0267e2e0734cc9db4c5bbd6016aa0e089 /tests
parent8056706f48880bbf0bb7ee842f1067b85f613353 (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 'tests')
-rw-r--r--tests/opus_encode_regressions.c5
-rw-r--r--tests/test_opus_encode.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/opus_encode_regressions.c b/tests/opus_encode_regressions.c
index 2373884c..29234730 100644
--- a/tests/opus_encode_regressions.c
+++ b/tests/opus_encode_regressions.c
@@ -935,6 +935,7 @@ static int ec_enc_shrink_assert(void)
opus_encoder_ctl(enc, OPUS_SET_PACKET_LOSS_PERC(6));
opus_encoder_ctl(enc, OPUS_SET_BITRATE(6000));
data_len = opus_encode(enc, pcm1, 960, data, 2000);
+ assert(data_len > 0);
opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE));
opus_encoder_ctl(enc, OPUS_SET_PREDICTION_DISABLED(1));
@@ -942,11 +943,13 @@ static int ec_enc_shrink_assert(void)
opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC(1));
opus_encoder_ctl(enc, OPUS_SET_BITRATE(15600));
data_len = opus_encode(enc, pcm2, 2880, data, 122);
+ assert(data_len > 0);
opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC));
opus_encoder_ctl(enc, OPUS_SET_BITRATE(27000));
data_len = opus_encode(enc, pcm3, 2880, data, 122); /* assertion failure */
- (void)data_len;
+ assert(data_len > 0);
+
opus_encoder_destroy(enc);
return 0;
}
diff --git a/tests/test_opus_encode.c b/tests/test_opus_encode.c
index b8427138..dae49c3d 100644
--- a/tests/test_opus_encode.c
+++ b/tests/test_opus_encode.c
@@ -582,7 +582,7 @@ int run_test1(int no_fuzz)
the decoders in order to compare them. */
if(opus_packet_parse(packet,len,&toc,frames,size,&payload_offset)<=0)test_failed();
if((fast_rand()&1023)==0)len=0;
- for(j=(frames[0]-packet);j<len;j++)for(jj=0;jj<8;jj++)packet[j]^=((!no_fuzz)&&((fast_rand()&1023)==0))<<jj;
+ for(j=(opus_int32)(frames[0]-packet);j<len;j++)for(jj=0;jj<8;jj++)packet[j]^=((!no_fuzz)&&((fast_rand()&1023)==0))<<jj;
out_samples = opus_decode(dec_err[0], len>0?packet:NULL, len, out2buf, MAX_FRAME_SAMP, 0);
if(out_samples<0||out_samples>MAX_FRAME_SAMP)test_failed();
if((len>0&&out_samples!=frame_size))test_failed(); /*FIXME use lastframe*/