diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-06-11 16:02:03 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-06-13 10:52:40 +0200 |
commit | 5d904a6aaaceae7fe2f11d6b848b0dd45e3fd1c4 (patch) | |
tree | b030bb7f74e44a28676f91d05faae95ed0c80a94 /src/timedate/timedatectl.c | |
parent | test-alloc-util: add a "test" for bool casts (diff) | |
download | systemd-5d904a6aaaceae7fe2f11d6b848b0dd45e3fd1c4.tar.xz systemd-5d904a6aaaceae7fe2f11d6b848b0dd45e3fd1c4.zip |
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 '')
-rw-r--r-- | src/timedate/timedatectl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index e52a64a9c5..f412082265 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -477,7 +477,7 @@ static int map_ntp_message(sd_bus *bus, const char *member, sd_bus_message *m, s memcpy(p->reference.str, d, sz); - p->spike = !!b; + p->spike = b; return 0; } |