[PATCH 2/2] xkb: Initialize 'bad' Atom in _XkbSetNamesCheck

Peter Hutterer peter.hutterer at who-t.net
Mon Oct 27 22:35:44 PDT 2014


On Wed, Oct 22, 2014 at 02:48:38PM -0700, Keith Packard wrote:
> When _XkbCheckAtoms returns NULL for an error, it always sets the
> error return code, but GCC can't figure that out, so just initialize
> the local variable, 'bad', in _XkbSetNamesCheck to eliminate the warning.
> 
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  xkb/xkb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xkb/xkb.c b/xkb/xkb.c
> index dc570f0..fdc5923 100644
> --- a/xkb/xkb.c
> +++ b/xkb/xkb.c
> @@ -3986,7 +3986,7 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev,
>  {
>      XkbDescRec *xkb;
>      CARD32 *tmp;
> -    Atom bad;
> +    Atom bad = None;
>  
>      tmp = data;
>      xkb = dev->key->xkbInfo->desc;
> -- 
> 2.1.1

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
for both

Cheers,
   Peter



More information about the xorg-devel mailing list