]> git.ipfire.org Git - thirdparty/systemd.git/blob - coccinelle/systemd-definitions.iso
test-cpu-set-util: add test for dbus conversions
[thirdparty/systemd.git] / coccinelle / systemd-definitions.iso
1 /* Statement isomorphisms - replace explicit checks against NULL with a
2 * shorter variant, which relies on C's downgrade-to-bool feature.
3 * The expression metavariables should be declared as pointers, however,
4 * that doesn't work well with complex expressions like:
5 * if (UNIT(p)->default_dependencies != NULL)
6 */
7
8 Statement
9 @@
10 expression X;
11 statement S;
12 @@
13 if (X == NULL) S => if (!X) S
14
15 Statement
16 @@
17 expression X;
18 statement S;
19 @@
20 if (X != NULL) S => if (X) S