mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
44 stars 46 forks source link

cppcheck warning: known condition is always true #350

Closed rbuj closed 3 years ago

rbuj commented 3 years ago
 plugins/common/msd-input-helper.c:123:25: style: Condition 'device_info!=NULL' is always true [knownConditionTrueFalse]
         if (device_info != NULL)
                         ^
 plugins/common/msd-input-helper.c:111:25: note: Assuming that condition 'device_info==NULL' is not redundant
         if (device_info == NULL)
                         ^
 plugins/common/msd-input-helper.c:123:25: note: Condition 'device_info!=NULL' is always true
         if (device_info != NULL)
                         ^
 plugins/xrandr/msd-xrandr-manager.c:2057:39: style: Condition 'config==NULL' is always false [knownConditionTrueFalse]
                 if (!config || config == NULL){
                                       ^
 plugins/xrandr/msd-xrandr-manager.c:2057:21: note: Assuming that condition '!config' is not redundant
                 if (!config || config == NULL){
                     ^
 plugins/xrandr/msd-xrandr-manager.c:2057:39: note: Condition 'config==NULL' is always false
                 if (!config || config == NULL){
                                       ^
 plugins/xrandr/msd-xrandr-manager.c:2057:29: style: Same expression on both sides of '||' because '!config' and 'config==NULL' represent the same value. [knownConditionTrueFalse]
                 if (!config || config == NULL){
                             ^
plugins/common/msd-keygrab.c:243:21: style: Condition 'key!=NULL' is always true [knownConditionTrueFalse]
        return (key != NULL
                    ^
plugins/common/msd-keygrab.c:212:10: note: Assuming that condition 'key==NULL' is not redundant
 if (key == NULL)
         ^
plugins/common/msd-keygrab.c:225:42: note: Assuming condition is false
 if (gdk_keymap_translate_keyboard_state (gdk_keymap_get_for_display (gdk_display_get_default ()), event->xkey.keycode,
                                         ^
plugins/common/msd-keygrab.c:243:21: note: Condition 'key!=NULL' is always true
        return (key != NULL
                    ^