mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-23 22:12:46 +00:00
DEV: coccinelle: Add ist.cocci
This commits the Coccinelle patch to clean up ist handling.
This commit is contained in:
parent
b113b5ca24
commit
c1af0bae69
42
dev/coccinelle/ist.cocci
Normal file
42
dev/coccinelle/ist.cocci
Normal file
@ -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))
|
||||
)
|
Loading…
Reference in New Issue
Block a user