gcc -Wlogical-op on Xorg git master says:

exevents.c: In function 'DeliverEmulatedMotionEvent':
exevents.c:1480:13: warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op]

The relevant snippet of exevents.c:

   1479         if (ti->listeners[0].type != LISTENER_POINTER_REGULAR ||
   1480             ti->listeners[0].type != LISTENER_POINTER_GRAB)
   1481             return;

The warning seems to be correct, as they are two different values in an enum,
all values are not equal to at least one of the two, so the return is always
followed and the following 20 lines in that block become dead code.

I'd guess the || should be &&, but figured you'd be in a better position to
evaluate & test that.

--
        -Alan Coopersmith-              alan.coopersm...@oracle.com
         Oracle Solaris Engineering - http://blogs.oracle.com/alanc
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to