Skip to content

Commit

Permalink
C90 fixes: Removing declarations after statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Jan 27, 2025
1 parent c508c08 commit ac814a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion silk/x86/NSQ_del_dec_avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/opus_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/repacketizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;i<end;i++)
{
int j;
int j, ret;
opus_int32 frame_ext_count;
frame_ext_count = total_ext_count - ext_count;
int ret = opus_packet_extensions_parse(rp->paddings[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)
{
Expand Down

0 comments on commit ac814a4

Please sign in to comment.