]> git.ipfire.org Git - thirdparty/systemd.git/blame_incremental - coccinelle/isempty.cocci
coccinelle: respect spacing from the semantic patch
[thirdparty/systemd.git] / coccinelle / isempty.cocci
... / ...
CommitLineData
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2@@
3/* Disable this transformation for the test-string-util.c */
4position p : script:python() { p[0].file != "src/test/test-string-util.c" };
5expression s;
6@@
7(
8- strv_length@p(s) == 0
9+ strv_isempty(s)
10|
11- strv_length@p(s) <= 0
12+ strv_isempty(s)
13|
14- strv_length@p(s) > 0
15+ !strv_isempty(s)
16|
17- strv_length@p(s) != 0
18+ !strv_isempty(s)
19|
20- strlen@p(s) == 0
21+ isempty(s)
22|
23- strlen@p(s) <= 0
24+ isempty(s)
25|
26- strlen@p(s) > 0
27+ !isempty(s)
28|
29- strlen@p(s) != 0
30+ !isempty(s)
31|
32- strlen_ptr@p(s) == 0
33+ isempty(s)
34|
35- strlen_ptr@p(s) <= 0
36+ isempty(s)
37|
38- strlen_ptr@p(s) > 0
39+ !isempty(s)
40|
41- strlen_ptr@p(s) != 0
42+ !isempty(s)
43)