[FFmpeg-devel] [PATCH 3/3] FATE/bprint: Convert a VLA to a normal array
nicolas.george at normalesup.org
Tue Sep 11 22:55:30 CEST 2012
Le sextidi 26 fructidor, an CCXX, Derek Buitenhuis a écrit :
> -static void bprint_pascal(AVBPrint *b, unsigned size)
> +static void bprint_pascal(AVBPrint *b, unsigned *p, unsigned size)
> - unsigned p[size + 1], i, j;
> + unsigned i, j;
It would probably be slightly simpler to just write:
av_assert0(size < FF_ARRAY_ELEMS(p));
It is a test program, after all, arbitrary limitations in computing the
Pascal triangle are not really an issue (and that was also the reason I used
a VLA in the first place).
Either way ok.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel