mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
21 lines
466 B
Plaintext
21 lines
466 B
Plaintext
|
/* Statement isomorphisms - replace explicit checks against NULL with a
|
||
|
* shorter variant, which relies on C's downgrade-to-bool feature.
|
||
|
* The expression metavariables should be declared as pointers, however,
|
||
|
* that doesn't work well with complex expressions like:
|
||
|
* if (UNIT(p)->default_dependencies != NULL)
|
||
|
*/
|
||
|
|
||
|
Statement
|
||
|
@@
|
||
|
expression X;
|
||
|
statement S;
|
||
|
@@
|
||
|
if (X == NULL) S => if (!X) S
|
||
|
|
||
|
Statement
|
||
|
@@
|
||
|
expression X;
|
||
|
statement S;
|
||
|
@@
|
||
|
if (X != NULL) S => if (X) S
|