1:255.16-alt1
[systemd_ALT.git] / coccinelle / isempty.cocci
blobb1b927727079e1a56d5970a88d5e3c871481c6a8
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 @@
3 /* Disable this transformation for the test-string-util.c */
4 position p : script:python() { p[0].file != "src/test/test-string-util.c" };
5 expression s;
6 @@
8 - strv_length@p(s) == 0
9 + strv_isempty(s)
11 - strv_length@p(s) <= 0
12 + strv_isempty(s)
14 - strv_length@p(s) > 0
15 + !strv_isempty(s)
17 - strv_length@p(s) != 0
18 + !strv_isempty(s)
20 - strlen@p(s) == 0
21 + isempty(s)
23 - strlen@p(s) <= 0
24 + isempty(s)
26 - strlen@p(s) > 0
27 + !isempty(s)
29 - strlen@p(s) != 0
30 + !isempty(s)
32 - strlen_ptr@p(s) == 0
33 + isempty(s)
35 - strlen_ptr@p(s) <= 0
36 + isempty(s)
38 - strlen_ptr@p(s) > 0
39 + !isempty(s)
41 - strlen_ptr@p(s) != 0
42 + !isempty(s)