From: Tim Duesterhus Date: Mon, 8 Nov 2021 08:05:02 +0000 (+0100) Subject: DEV: coccinelle: Add rule to use `chunk_istcat()` instead of `chunk_memcat()` X-Git-Tag: v2.5-dev14~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=755d2419a45c19e12b72d1aa84b59242524178e9;p=thirdparty%2Fhaproxy.git DEV: coccinelle: Add rule to use `chunk_istcat()` instead of `chunk_memcat()` This replaces `chunk_memcat()` with `chunk_istcat()` if the parameters are the ist's `.ptr` and `.len`. --- diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index 7e9a6ac056..4945141b25 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci @@ -52,6 +52,14 @@ 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; @@