On Sun, Dec 08, 2013 at 10:04:15AM -0800, Alan Coopersmith wrote:
> Fixes cppcheck warning:
> [src/XScrnSaver.c:104] -> [src/XScrnSaver.c:105]: (performance, inconclusive)
>  Variable 'window' is reassigned a value before the old one has been
>  used if variable is no semaphore variable.
> 
> Error seems to date back to revision 1.1 in X Consortium RCS,
> dated 1992-02-13, by "keith"
> 
> Signed-off-by: Alan Coopersmith <[email protected]>
> ---
>  src/XScrnSaver.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> While this seems more correct, and fills in a field left uninitialized
> before, I do wonder if after 21 years, applications all expect the root
> window id in the window field of the event now, and if they'll be broken
> by this.

Reviewed-by: Peter Hutterer <[email protected]>

Cheers,
   Peter

> diff --git a/src/XScrnSaver.c b/src/XScrnSaver.c
> index 2a89246..3947dd5 100644
> --- a/src/XScrnSaver.c
> +++ b/src/XScrnSaver.c
> @@ -102,7 +102,7 @@ static Bool wire_to_event (
>       se->send_event = (sevent->type & 0x80) != 0;
>       se->display = dpy;
>       se->window = sevent->window;
> -     se->window = sevent->root;
> +     se->root = sevent->root;
>       se->state = sevent->state;
>       se->kind = sevent->kind;
>       se->forced = True;
> -- 
> 1.7.9.2
> 
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to