commit | ef00c533e1ed37b414aab912f492be794ab589cc | [log] [tgz] |
---|---|---|
author | Tim Duesterhus <tim@bastelstu.be> | Thu Nov 04 22:35:43 2021 +0100 |
committer | Willy Tarreau <w@1wt.eu> | Fri Nov 05 07:48:38 2021 +0100 |
tree | d13bb90ed27ab4a219203e1ba2f9a4a91c5de25b | |
parent | 025b93e3a20d6f132124ca73153af96a5563b1bf [diff] |
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 c324330..97ce0a2 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci
@@ -26,6 +26,22 @@ 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)