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