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/shared/bus-util.c | |
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/shared/bus-util.c')
-rw-r--r-- | src/shared/bus-util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 020fa885a..e69b53ea6 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1094,9 +1094,9 @@ static int map_basic(sd_bus *bus, const char *member, sd_bus_message *m, unsigne return r; if (flags & BUS_MAP_BOOLEAN_AS_BOOL) - * (bool*) userdata = !!b; + *(bool*) userdata = b; else - * (int*) userdata = b; + *(int*) userdata = b; return 0; } @@ -1413,7 +1413,7 @@ int bus_property_set_bool( if (r < 0) return r; - *(bool *) userdata = !!b; + *(bool*) userdata = b; return 0; } |