projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b113b5c
)
DEV: coccinelle: Add ist.cocci
author
Tim Duesterhus
<tim@bastelstu.be>
Wed, 15 Sep 2021 11:58:43 +0000
(13:58 +0200)
committer
Willy Tarreau
<w@1wt.eu>
Fri, 17 Sep 2021 15:22:05 +0000
(17:22 +0200)
This commits the Coccinelle patch to clean up ist handling.
dev/coccinelle/ist.cocci
[new file with mode: 0644]
patch
|
blob
diff --git a/dev/coccinelle/ist.cocci
b/dev/coccinelle/ist.cocci
new file mode 100644
(file)
index 0000000..
c324330
--- /dev/null
+++ b/
dev/coccinelle/ist.cocci
@@ -0,0
+1,42
@@
+@@
+struct ist i;
+expression p, l;
+@@
+
+- i.ptr = p;
+- i.len = l;
++ i = ist2(p, l);
+
+@@
+@@
+
+- ist2(NULL, 0)
++ IST_NULL
+
+@@
+struct ist i;
+expression e;
+@@
+
+- i.ptr += e;
+- i.len -= e;
++ i = istadv(i, e);
+
+@@
+struct ist i;
+@@
+
+- i.ptr != NULL
++ isttest(i)
+
+@@
+char *s;
+@@
+
+(
+- ist2(s, strlen(s))
++ ist(s)
+|
+- ist2(strdup(s), strlen(s))
++ ist(strdup(s))
+)