summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2019-07-16 16:04:07 +0200
committerVictor Kareh <[email protected]>2019-07-24 09:17:24 -0400
commit5a48f4f5a6172248fbb8462eba0d4498983ca29c (patch)
tree760c531a9f7eef9c2956ca38a2817a15486ef192 /src
parent67b0883a92607d52ece6ab7e8f8869e7f55bab29 (diff)
downloadmate-power-manager-5a48f4f5a6172248fbb8462eba0d4498983ca29c.tar.bz2
mate-power-manager-5a48f4f5a6172248fbb8462eba0d4498983ca29c.tar.xz
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) { | ```
Diffstat (limited to 'src')
-rw-r--r--src/gpm-upower.c2
1 files changed, 1 insertions, 1 deletions
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);
}