From: Tim Duesterhus Date: Thu, 4 Nov 2021 21:35:43 +0000 (+0100) Subject: DEV: coccinelle: Add rule to use `istnext()` where possible X-Git-Tag: v2.5-dev13~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef00c533e1ed37b414aab912f492be794ab589cc;p=thirdparty%2Fhaproxy.git DEV: coccinelle: Add rule to use `istnext()` where possible This matches both `istadv(..., 1)` as well as raw `.ptr++` uses. --- diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index c3243302f8..97ce0a2ade 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci @@ -26,6 +26,22 @@ expression e; struct ist i; @@ +- i = istadv(i, 1); ++ i = istnext(i); + +@@ +struct ist i; +expression e; +@@ + +- i.ptr++; +- i.len--; ++ i = istnext(i); + +@@ +struct ist i; +@@ + - i.ptr != NULL + isttest(i)