From: Tim Duesterhus Date: Wed, 15 Sep 2021 11:58:43 +0000 (+0200) Subject: DEV: coccinelle: Add ist.cocci X-Git-Tag: v2.5-dev8~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1af0bae69296eed069f7db03e3bdde1629b9b23;p=thirdparty%2Fhaproxy.git DEV: coccinelle: Add ist.cocci This commits the Coccinelle patch to clean up ist handling. --- diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci new file mode 100644 index 0000000000..c3243302f8 --- /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)) +)