[dcoppa at gmail.com: two small fixes for xcompmgr]

Peter Hutterer peter.hutterer at who-t.net
Mon Dec 7 17:42:31 PST 2009


On Mon, Dec 07, 2009 at 10:09:26PM +0100, Matthieu Herrb wrote:
> ----- Forwarded message from David Coppa <dcoppa at gmail.com> -----
> 
> Date: Wed, 2 Dec 2009 09:34:40 +0100
> From: David Coppa <dcoppa at gmail.com>
> To: x11 at openbsd.org
> Cc: Matthieu Herrb <matthieu.herrb at laas.fr>
> Subject: two small fixes for xcompmgr
> 
> Hi,
> 
> This fixes two small glitches in app/xcompmgr:
> 
> uninitialized bool variable
> wrong casting
> 
> cheers,
> david
> 
> 
> Index: xcompmgr.c
> ===================================================================
> RCS file: /cvs/xenocara/app/xcompmgr/xcompmgr.c,v
> retrieving revision 1.4
> diff -N -u -p xcompmgr.c
> --- xcompmgr.c	8 Nov 2009 10:27:36 -0000	1.4
> +++ xcompmgr.c	2 Dec 2009 07:55:05 -0000
> @@ -389,7 +389,7 @@ static conv *
>  make_gaussian_map (Display *dpy, double r)
>  {
>      conv	    *c;
> -    int		    size = ((int) ceil ((r * 3)) + 1) & ~1;
> +    int		    size = (int)(ceil ((r * 3)) + 1) & ~1;

doesn't this produce the same result either way?
((int)1.0 + 1) should be the same as (int)(1.0 + 1) - what am I missing
here?

>      int		    center = size / 2;
>      int		    x, y;
>      double	    t;
> @@ -774,7 +774,9 @@ root_tile (Display *dpy)
>      XRenderPictureAttributes	pa;
>      int		    p;
>  
> +    fill = False;
>      pixmap = None;

looking at the flow, fill can't be unset by the time it's used.
It adds a bit of obviousness though.

> +
>      for (p = 0; backgroundProps[p]; p++)
>      {
>  	if (XGetWindowProperty (dpy, root, XInternAtom (dpy, backgroundProps[p], False),

Cheers,
  Peter


More information about the xorg-devel mailing list