[PATCH:xdm 5/5] greeter: Rename valueMask for xpm window to avoid shadowing argument

Mark Kettenis mark.kettenis at xs4all.nl
Sun Feb 20 03:32:18 PST 2011


> From: Alan Coopersmith <alan.coopersmith at oracle.com>
> Date: Sat, 19 Feb 2011 22:36:41 -0800
> 
> The Realize function names one of its arguments valueMask, so rename
> the local variable to xpmValueMask to reduce confusion and clear the
> gcc -Wshadow warning:
> 
> Login.c: In function `Realize':
> Login.c:1901: warning: declaration of 'valueMask' shadows a parameter
> Login.c:1871: warning: shadowed declaration is here
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>  greeter/Login.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/greeter/Login.c b/greeter/Login.c
> index 5bc8c05..1a02846 100644
> --- a/greeter/Login.c
> +++ b/greeter/Login.c
> @@ -1898,7 +1898,7 @@ static void Realize (
>           * Create pixmap window
>           */
>          {
> -            unsigned long valueMask = CWBackPixel | CWBackPixmap;
> +            unsigned long xpmValueMask = CWBackPixel | CWBackPixmap;
>              XSetWindowAttributes windowAttributes = { 0 };
>  
>              windowAttributes.background_pixel = w->core.background_pixel;
> @@ -1911,7 +1911,7 @@ static void Realize (
>                  (w->core.height - w->login.logoHeight) /2,
>                  w->login.logoWidth, w->login.logoHeight, 0,
>                  CopyFromParent, InputOutput, CopyFromParent,
> -                valueMask, &windowAttributes);
> +                xpmValueMask, &windowAttributes);

Why not eliminate valueMask completely, and just use CWBackPixel |
CWBackPixmap directly in the function call?


More information about the xorg-devel mailing list