From 5a48f4f5a6172248fbb8462eba0d4498983ca29c Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 16 Jul 2019 16:04:07 +0200 Subject: gpm-upower: fix some build warnings ``` gpm-upower.c:222:51: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] gpm-upower.c:222:44: note: add parentheses around left hand side expression to silence this warning 222 | if (state == UP_DEVICE_STATE_CHARGING || !state == UP_DEVICE_STATE_DISCHARGING) { | ^~~~~~ ``` ``` gpm-upower.c:222:53: warning: comparison of constant '2' with boolean expression is always false [-Wbool-compare] 222 | if (state == UP_DEVICE_STATE_CHARGING || (!state) == UP_DEVICE_STATE_DISCHARGING) { | ``` --- src/gpm-upower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpm-upower.c b/src/gpm-upower.c index 168e879..5b25e63 100644 --- a/src/gpm-upower.c +++ b/src/gpm-upower.c @@ -219,7 +219,7 @@ gpm_upower_get_device_summary (UpDevice *device) /* we care if we are on AC */ if (kind == UP_DEVICE_KIND_PHONE) { - if (state == UP_DEVICE_STATE_CHARGING || !state == UP_DEVICE_STATE_DISCHARGING) { + if (state == UP_DEVICE_STATE_CHARGING || !(state == UP_DEVICE_STATE_DISCHARGING)) { /* TRANSLATORS: a phone is charging */ return g_strdup_printf (_("%s charging (%.1f%%)"), kind_desc, percentage); } -- cgit v1.2.1