This commits the Coccinelle patch to clean up ist handling.
---
 scripts/coccinelle/ist.cocci | 42 ++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 scripts/coccinelle/ist.cocci

diff --git a/scripts/coccinelle/ist.cocci b/scripts/coccinelle/ist.cocci
new file mode 100644
index 000000000..c3243302f
--- /dev/null
+++ b/scripts/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))
+)
-- 
2.33.0


Reply via email to