summaryrefslogtreecommitdiffstats
path: root/coccinelle/isempty.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'coccinelle/isempty.cocci')
-rw-r--r--coccinelle/isempty.cocci72
1 files changed, 27 insertions, 45 deletions
diff --git a/coccinelle/isempty.cocci b/coccinelle/isempty.cocci
index d8d5275889..e0a9f07ca6 100644
--- a/coccinelle/isempty.cocci
+++ b/coccinelle/isempty.cocci
@@ -1,60 +1,42 @@
@@
+/* 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(s) == 0
+(
+- strv_length@p(s) == 0
+ strv_isempty(s)
-@@
-expression s;
-@@
-- strv_length(s) <= 0
+|
+- strv_length@p(s) <= 0
+ strv_isempty(s)
-@@
-expression s;
-@@
-- strv_length(s) > 0
+|
+- strv_length@p(s) > 0
+ !strv_isempty(s)
-@@
-expression s;
-@@
-- strv_length(s) != 0
+|
+- strv_length@p(s) != 0
+ !strv_isempty(s)
-@@
-expression s;
-@@
-- strlen(s) == 0
+|
+- strlen@p(s) == 0
+ isempty(s)
-@@
-expression s;
-@@
-- strlen(s) <= 0
+|
+- strlen@p(s) <= 0
+ isempty(s)
-@@
-expression s;
-@@
-- strlen(s) > 0
+|
+- strlen@p(s) > 0
+ !isempty(s)
-@@
-expression s;
-@@
-- strlen(s) != 0
+|
+- strlen@p(s) != 0
+ !isempty(s)
-@@
-expression s;
-@@
-- strlen_ptr(s) == 0
+|
+- strlen_ptr@p(s) == 0
+ isempty(s)
-@@
-expression s;
-@@
-- strlen_ptr(s) <= 0
+|
+- strlen_ptr@p(s) <= 0
+ isempty(s)
-@@
-expression s;
-@@
-- strlen_ptr(s) > 0
+|
+- strlen_ptr@p(s) > 0
+ !isempty(s)
-@@
-expression s;
-@@
-- strlen_ptr(s) != 0
+|
+- strlen_ptr@p(s) != 0
+ !isempty(s)
+)