Skip to content

Commit

Permalink
stagefright amr: Avoid C++/C99 for loops with variable declaration
Browse files Browse the repository at this point in the history
This makes the code compileable in C89 mode, too.

Change-Id: I9b76f8bfca148d1aec6081b8db139f351d64cfed
  • Loading branch information
mstorsjo committed Feb 27, 2012
1 parent f7f1280 commit b084141
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion media/libstagefright/codecs/amrnb/enc/src/ton_stab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@ void update_gp_clipping(tonStabState *st, /* i/o : State struct */
)
{
OSCL_UNUSED_ARG(pOverflow);
for (int i = 0; i < N_FRAME - 1; i++)
int i;
for (i = 0; i < N_FRAME - 1; i++)
{
st->gp[i] = st->gp[i+1];
}
Expand Down
3 changes: 2 additions & 1 deletion media/libstagefright/codecs/amrwb/src/get_amr_wb_bits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ int16 Serial_parm( /* Return the parameter */
)
{
int16 value = 0;
int16 i;

for (int16 i = no_of_bits >> 1; i != 0; i--)
for (i = no_of_bits >> 1; i != 0; i--)
{
value <<= 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ void AmrWbUp_samp(
{

int32 i;
int16 frac;
int16 frac, j;
int16 * pt_sig_u = sig_u;

frac = 1;
for (int16 j = 0; j < L_frame; j++)
for (j = 0; j < L_frame; j++)
{
i = ((int32)j * INV_FAC5) >> 13; /* integer part = pos * 1/5 */

Expand Down

0 comments on commit b084141

Please sign in to comment.