From ac814a463e1cca3603f1b307d52e41ad2392ff51 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Fri, 24 Jan 2025 10:38:36 -0500 Subject: [PATCH] C90 fixes: Removing declarations after statement --- silk/x86/NSQ_del_dec_avx2.c | 3 ++- src/opus_encoder.c | 3 ++- src/repacketizer.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/silk/x86/NSQ_del_dec_avx2.c b/silk/x86/NSQ_del_dec_avx2.c index 5bf2756e9..84efca4eb 100644 --- a/silk/x86/NSQ_del_dec_avx2.c +++ b/silk/x86/NSQ_del_dec_avx2.c @@ -106,13 +106,14 @@ static OPUS_INLINE opus_int32 silk_sar_round_32(opus_int32 a, int bits) static OPUS_INLINE opus_int64 silk_sar_round_smulww(opus_int32 a, opus_int32 b, int bits) { + opus_int64 t; silk_assert(bits > 0 && bits < 63); #ifdef OPUS_CHECK_ASM return silk_RSHIFT_ROUND(silk_SMULWW(a, b), bits); #else /* This code is more correct, but it won't overflow like the C code in some rare cases. */ silk_assert(bits > 0 && bits < 63); - opus_int64 t = ((opus_int64)a) * ((opus_int64)b); + t = ((opus_int64)a) * ((opus_int64)b); bits += 16; t += 1ull << (bits-1); return t >> bits; diff --git a/src/opus_encoder.c b/src/opus_encoder.c index 31fae3c65..8e4aae37f 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -1626,6 +1626,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_res *pcm, int frame_si unsigned char *curr_data; int tmp_len; int dtx_count = 0; + int bak_to_mono; if (st->mode == MODE_SILK_ONLY) { @@ -1670,7 +1671,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_res *pcm, int frame_si opus_repacketizer_init(rp); - int bak_to_mono = st->silk_mode.toMono; + bak_to_mono = st->silk_mode.toMono; if (bak_to_mono) st->force_channels = 1; else diff --git a/src/repacketizer.c b/src/repacketizer.c index 79798b021..e093dae68 100644 --- a/src/repacketizer.c +++ b/src/repacketizer.c @@ -155,10 +155,10 @@ opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int /* incorporate any extensions from the repacketizer padding */ for (i=begin;ipaddings[i], rp->padding_len[i], + ret = opus_packet_extensions_parse(rp->paddings[i], rp->padding_len[i], &all_extensions[ext_count], &frame_ext_count); if (ret<0) {