]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/macro.h
Add macro for checking if some flags are set
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 20 Apr 2018 13:36:20 +0000 (15:36 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 4 Jun 2018 09:50:44 +0000 (11:50 +0200)
commitd94a24ca2ea769755beaed0659b966b1ec75c8d4
treee809995a39930fbc317fecc96e403c13f76737f0
parent00bfe67f6b178056bffcfa9fbfb04ca3fa809989
Add macro for checking if some flags are set

This way we don't need to repeat the argument twice.
I didn't replace all instances. I think it's better to leave out:
- asserts
- comparisons like x & y == x, which are mathematically equivalent, but
  here we aren't checking if flags are set, but if the argument fits in the
  flags.
12 files changed:
coccinelle/flags-set.cocci [new file with mode: 0644]
src/basic/capability-util.h
src/basic/copy.c
src/basic/fs-util.c
src/basic/macro.h
src/basic/process-util.c
src/basic/rm-rf.c
src/core/cgroup.c
src/core/unit.c
src/import/curl-util.c
src/shared/condition.c
src/udev/udev-builtin-input_id.c