]> git.ipfire.org Git - thirdparty/git.git/blame - contrib/coccinelle/strbuf.cocci
cocci: use ALLOC_ARRAY
[thirdparty/git.git] / contrib / coccinelle / strbuf.cocci
CommitLineData
353d84c5
RS
1@ strbuf_addf_with_format_only @
2expression E;
3constant fmt;
a22ae753 4@@
353d84c5
RS
5 strbuf_addf(E,
6(
7 fmt
8|
9 _(fmt)
10)
11 );
12
13@ script:python @
14fmt << strbuf_addf_with_format_only.fmt;
a22ae753 15@@
353d84c5
RS
16cocci.include_match("%" not in fmt)
17
18@ extends strbuf_addf_with_format_only @
19@@
20- strbuf_addf
21+ strbuf_addstr
22 (E,
23(
24 fmt
25|
26 _(fmt)
27)
28 );
92d52fab
RS
29
30@@
31expression E1, E2;
32@@
33- strbuf_addf(E1, "%s", E2);
34+ strbuf_addstr(E1, E2);
f937d785
RS
35
36@@
37expression E1, E2, E3;
38@@
39- strbuf_addstr(E1, find_unique_abbrev(E2, E3));
40+ strbuf_add_unique_abbrev(E1, E2, E3);