[FFmpeg-devel] [PATCH] Remove unused variable from videogen.c

Michael Niedermayer michaelni
Tue Jul 21 00:06:01 CEST 2009


On Mon, Jul 20, 2009 at 11:44:28PM +0200, Carl Eugen Hoyos wrote:
> icc reports:
> tests/videogen.c(203): remark #593: variable "dy" was set but never used
>       int r, g, b, x, y, i, dx, dy, x1, y1;
>                                 ^
>
> Ok to apply?
>
> Carl Eugen

>  videogen.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 757424de2c22475085d34d589655be2483a69499  patchvideogen.diff
> Index: tests/videogen.c
> ===================================================================
> --- tests/videogen.c	(revision 19472)
> +++ tests/videogen.c	(working copy)
> @@ -200,7 +200,7 @@
>  
>  static void gen_image(int num, int w, int h)
>  {
> -    int r, g, b, x, y, i, dx, dy, x1, y1;
> +    int r, g, b, x, y, i, dx, x1, y1;
>      unsigned int seed1;
>  
>      if (num == 0) {
> @@ -218,7 +218,6 @@
>      /* first a moving background with gradients */
>      /* test motion estimation */
>      dx = int_cos(num * FRAC_ONE / 50) * 35;
> -    dy = int_cos(num * FRAC_ONE / 50 + FRAC_ONE / 10) * 30;
>      for(y=0;y<h;y++) {
>          for(x=0;x<w;x++) {
>              x1 = (x << FRAC_BITS) + dx;

id rather suspect the following

            x1 = (x << FRAC_BITS) + dx;
            y1 = (y << FRAC_BITS) + dx;
                                    ^^
                            should probably be dy

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090721/4119c4fe/attachment.pgp>



More information about the ffmpeg-devel mailing list