[FFmpeg-devel] [PATCH] dca.c: In function 'dca_exss_skip_mix_coeffs': 'for' loop initial declaration used outside C99 mode

Måns Rullgård mans
Tue Feb 1 13:38:16 CET 2011


Gianluigi Tiesi <mplayer at netfarm.it> writes:

> I'm still using gcc 4.2 on mingw, and I have to disable c99,

Why?

> I suppose other compilers would complain anyway and the fix is
> trivial

Obviously none of the ones we routinely test with have problem with it.
There are some more obscure ones that do, however, so I don't mind the
change.

> diff --git a/libavcodec/dca.c b/libavcodec/dca.c
> index 3861813..3a3eb25 100644
> --- a/libavcodec/dca.c
> +++ b/libavcodec/dca.c
> @@ -1354,7 +1354,9 @@ static int dca_exss_mask2count(int mask)
>   */
>  static void dca_exss_skip_mix_coeffs(GetBitContext *gb, int channels, int out_ch)
>  {
> -    for (int i = 0; i < channels; i++) {
> +    int i;
> +
> +    for (i = 0; i < channels; i++) {
>          int mix_map_mask = get_bits(gb, out_ch);
>          int num_coeffs = av_popcount(mix_map_mask);
>          skip_bits_long(gb, num_coeffs * 6);

FWIW, this is the one case of mixed declarations and statements I will
tolerate.  That said, patch queued.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list