From 5c5bc168873c840f64545527cd245b2e87ada488 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 21 Jan 2021 19:36:58 +0100 Subject: cppcheck warning: known condition is always true --- plugins/common/msd-input-helper.c | 4 ++-- plugins/common/msd-keygrab.c | 3 +-- plugins/xrandr/msd-xrandr-manager.c | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/common/msd-input-helper.c b/plugins/common/msd-input-helper.c index 5434014..641c51c 100644 --- a/plugins/common/msd-input-helper.c +++ b/plugins/common/msd-input-helper.c @@ -120,8 +120,8 @@ touchpad_is_present (void) break; } } - if (device_info != NULL) - XFreeDeviceList (device_info); + + XFreeDeviceList (device_info); return retval; } diff --git a/plugins/common/msd-keygrab.c b/plugins/common/msd-keygrab.c index a0f4105..d112ae9 100644 --- a/plugins/common/msd-keygrab.c +++ b/plugins/common/msd-keygrab.c @@ -240,7 +240,6 @@ match_key (Key *key, XEvent *event) } /* The key we passed doesn't have a keysym, so try with just the keycode */ - return (key != NULL - && key->state == (event->xkey.state & msd_used_mods) + return (key->state == (event->xkey.state & msd_used_mods) && key_uses_keycode (key, event->xkey.keycode)); } diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c index 0e157a8..7e0a8d9 100644 --- a/plugins/xrandr/msd-xrandr-manager.c +++ b/plugins/xrandr/msd-xrandr-manager.c @@ -2050,11 +2050,10 @@ mirror_outputs_cb(GtkCheckMenuItem *item, gpointer data) struct MsdXrandrManagerPrivate *priv = manager->priv; MateRRScreen *screen = priv->rw_screen; - if (gtk_check_menu_item_get_active(item)){ - + if (gtk_check_menu_item_get_active (item)) { MateRRConfig *config; - config = make_clone_setup (screen); - if (!config || config == NULL){ + + if ((config = make_clone_setup (screen)) == NULL) { error_message (manager, _("Mirroring outputs not supported"), NULL, NULL); } -- cgit v1.2.1