diff options
author | Martin Storsjo <martin@martin.st> | 2011-06-23 18:21:23 +0300 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2012-02-27 21:35:48 +0200 |
commit | b08414134218f9013c2187bbee54d0816bffff05 (patch) | |
tree | 711e69312317c50b19471fd6e7f0d116d859dfbf /media/libstagefright/codecs | |
parent | f7f1280e0c71d64098efb42b58a922d056164b5e (diff) | |
download | frameworks_base-b08414134218f9013c2187bbee54d0816bffff05.zip frameworks_base-b08414134218f9013c2187bbee54d0816bffff05.tar.gz frameworks_base-b08414134218f9013c2187bbee54d0816bffff05.tar.bz2 |
stagefright amr: Avoid C++/C99 for loops with variable declaration
This makes the code compileable in C89 mode, too.
Change-Id: I9b76f8bfca148d1aec6081b8db139f351d64cfed
Diffstat (limited to 'media/libstagefright/codecs')
3 files changed, 6 insertions, 4 deletions
diff --git a/media/libstagefright/codecs/amrnb/enc/src/ton_stab.cpp b/media/libstagefright/codecs/amrnb/enc/src/ton_stab.cpp index 3c4494d..455a510 100644 --- a/media/libstagefright/codecs/amrnb/enc/src/ton_stab.cpp +++ b/media/libstagefright/codecs/amrnb/enc/src/ton_stab.cpp @@ -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]; } diff --git a/media/libstagefright/codecs/amrwb/src/get_amr_wb_bits.cpp b/media/libstagefright/codecs/amrwb/src/get_amr_wb_bits.cpp index d7287f3..b325e8f 100644 --- a/media/libstagefright/codecs/amrwb/src/get_amr_wb_bits.cpp +++ b/media/libstagefright/codecs/amrwb/src/get_amr_wb_bits.cpp @@ -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; diff --git a/media/libstagefright/codecs/amrwb/src/oversamp_12k8_to_16k.cpp b/media/libstagefright/codecs/amrwb/src/oversamp_12k8_to_16k.cpp index 143c26e..ea5769a 100644 --- a/media/libstagefright/codecs/amrwb/src/oversamp_12k8_to_16k.cpp +++ b/media/libstagefright/codecs/amrwb/src/oversamp_12k8_to_16k.cpp @@ -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 */ |