Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-06 01:26:18 +0300
committerJunio C Hamano <gitster@pobox.com>2019-02-06 01:26:18 +0300
commit5db562704ca1541f1ace2510f830ea1370ce60e4 (patch)
tree869a28a2909e7a1cebda9357731392a11aef587a /contrib
parentabf39e3396f597adfac1f37a3b5706950dadfec3 (diff)
parent28c23cd4c3902449aff72cb9a4a703220be0d6ac (diff)
Merge branch 'sg/strbuf-addbuf-cocci'
Cocci rule update. * sg/strbuf-addbuf-cocci: strbuf.cocci: suggest strbuf_addbuf() to add one strbuf to an other
Diffstat (limited to 'contrib')
-rw-r--r--contrib/coccinelle/strbuf.cocci30
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/coccinelle/strbuf.cocci b/contrib/coccinelle/strbuf.cocci
index e34eada1ad..d9ada69b43 100644
--- a/contrib/coccinelle/strbuf.cocci
+++ b/contrib/coccinelle/strbuf.cocci
@@ -13,6 +13,36 @@ constant fmt !~ "%";
);
@@
+expression E;
+struct strbuf SB;
+format F =~ "s";
+@@
+- strbuf_addf(E, "%@F@", SB.buf);
++ strbuf_addbuf(E, &SB);
+
+@@
+expression E;
+struct strbuf *SBP;
+format F =~ "s";
+@@
+- strbuf_addf(E, "%@F@", SBP->buf);
++ strbuf_addbuf(E, SBP);
+
+@@
+expression E;
+struct strbuf SB;
+@@
+- strbuf_addstr(E, SB.buf);
++ strbuf_addbuf(E, &SB);
+
+@@
+expression E;
+struct strbuf *SBP;
+@@
+- strbuf_addstr(E, SBP->buf);
++ strbuf_addbuf(E, SBP);
+
+@@
expression E1, E2;
format F =~ "s";
@@