diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-06-11 16:02:03 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | d9537fde9944a03f48054e0f4b6a9aea7d3c2a9d (patch) | |
tree | 1f4d52653dea6867cba74e3c950d251646581822 /src/login | |
parent | 5794614c99bdb57a405f293923bf17f24dad25e9 (diff) |
tree-wide: drop !! casts to booleans
They are not needed, because anything that is non-zero is converted
to true.
C11:
> 6.3.1.2: When any scalar value is converted to _Bool, the result is 0 if the
> value compares equal to 0; otherwise, the result is 1.
https://stackoverflow.com/questions/31551888/casting-int-to-bool-in-c-c
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-dbus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 507368604..26a4ed889 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -245,9 +245,9 @@ static int property_get_preparing( assert(m); if (streq(property, "PreparingForShutdown")) - b = !!(m->action_what & INHIBIT_SHUTDOWN); + b = m->action_what & INHIBIT_SHUTDOWN; else - b = !!(m->action_what & INHIBIT_SLEEP); + b = m->action_what & INHIBIT_SLEEP; return sd_bus_message_append(reply, "b", b); } |