From da76459dc21b5af2449af2d36eb95226cb186ce2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:35:11 +0200 Subject: Adding upstream version 2.6.12. Signed-off-by: Daniel Baumann --- dev/coccinelle/ist.cocci | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 dev/coccinelle/ist.cocci (limited to 'dev/coccinelle/ist.cocci') diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci new file mode 100644 index 0000000..acde626 --- /dev/null +++ b/dev/coccinelle/ist.cocci @@ -0,0 +1,86 @@ +@@ +struct ist i; +expression p, l; +@@ + +( +- i.ptr = p; +- i.len = strlen(i.ptr); ++ i = ist(p); +| +- 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 = istadv(i, 1); ++ i = istnext(i); + +@@ +struct ist i; +@@ + +- i.ptr++; +- i.len--; ++ i = istnext(i); + +@@ +struct ist i; +@@ + +- (\(i.ptr\|istptr(i)\) + \(i.len\|istlen(i)\)) ++ istend(i) + +@@ +struct ist i; +expression e; +@@ + +- if (\(i.len\|istlen(i)\) > e) { i.len = e; } ++ i = isttrim(i, e); + +@@ +struct ist i; +struct buffer *b; +@@ + +- chunk_memcat(b, \(i.ptr\|istptr(i)\) , \(i.len\|istlen(i)\)); ++ chunk_istcat(b, i); + +@@ +struct ist i; +@@ + +- i.ptr != NULL ++ isttest(i) + +@@ +char *s; +@@ + +( +- ist2(s, strlen(s)) ++ ist(s) +| +- ist2(strdup(s), strlen(s)) ++ ist(strdup(s)) +) -- cgit v1.2.3