DEV: coccinelle: Add rule to use `istnext()` where possible

This matches both `istadv(..., 1)` as well as raw `.ptr++` uses.
This commit is contained in:
Tim Duesterhus 2021-11-04 22:35:43 +01:00 committed by Willy Tarreau
parent 025b93e3a2
commit ef00c533e1
1 changed files with 16 additions and 0 deletions

View File

@ -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)