Coverity: CID 21028 Logically dead code
authorNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 15 Jun 2012 15:19:42 +0000 (11:19 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 15 Jun 2012 15:19:42 +0000 (11:19 -0400)
* src/ui/X11/event-Xt.c (x_handle_sticky_modifiers): This is a
false positive, but this little refactoring makes the analysis
easier...

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/ui/X11/event-Xt.c

index 4811a08..3db0524 100644 (file)
@@ -863,6 +863,7 @@ static void x_handle_sticky_modifiers(XEvent * ev, struct device *d)
        struct x_device *xd;
        KeyCode keycode;
        int type;
+       bool key_event_p;
 
        if (!modifier_keys_are_sticky) {
                /* Optimize for non-sticky modifiers */
@@ -877,11 +878,10 @@ static void x_handle_sticky_modifiers(XEvent * ev, struct device *d)
            keycode > xd->x_keysym_map_max_code) {
                return;
        }
+       key_event_p = (type == KeyPress || type == KeyRelease);
 
-       if (!((type == KeyPress || type == KeyRelease) &&
-             x_key_is_modifier_p(keycode, d))) {
+       if (!( key_event_p && x_key_is_modifier_p(keycode, d))) {
                /* Not a modifier key */
-               bool key_event_p = (type == KeyPress || type == KeyRelease);
 
                if (type == ButtonPress
                    || (type == KeyPress