]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: drop !! casts to booleans
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Jun 2018 14:02:03 +0000 (16:02 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 13 Jun 2018 08:52:40 +0000 (10:52 +0200)
commit5d904a6aaaceae7fe2f11d6b848b0dd45e3fd1c4
treeb030bb7f74e44a28676f91d05faae95ed0c80a94
parent37e744e8661c3edd8b8efa723a3d3c71f73ef542
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
18 files changed:
coccinelle/bool-cast.cocci [new file with mode: 0644]
src/analyze/analyze.c
src/basic/btrfs-util.c
src/basic/format-table.c
src/basic/verbs.c
src/basic/virt.c
src/busctl/busctl.c
src/core/dbus-execute.c
src/core/namespace.c
src/core/service.c
src/core/shutdown.c
src/journal/journald-stream.c
src/login/logind-dbus.c
src/network/networkd-dhcp6.c
src/shared/bus-util.c
src/shared/condition.c
src/shared/conf-parser.c
src/timedate/timedatectl.c