1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-07 22:26:11 +02:00
git/contrib/coccinelle
René Scharfe 9ca356fa8b coccinelle: remove parentheses that become unnecessary
Transformations that hide multiplications can end up with an pair of
parentheses that is no longer needed.  E.g. with a rule like this:

  @@
  expression E;
  @@
  - E * 2
  + double(E)

... we might get a patch like this:

  -	x = (a + b) * 2;
  +	x = double((a + b));

Add a pair of parentheses to the preimage side of such rules.
Coccinelle will generate patches that remove them if they are present,
and it will still match expressions that lack them.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-02 13:02:26 +09:00
..
.gitignore gitignore: ignore output files of coccicheck make target 2016-09-27 14:02:19 -07:00
README
array.cocci coccinelle: remove parentheses that become unnecessary 2017-10-02 13:02:26 +09:00
free.cocci coccinelle: polish FREE_AND_NULL rules 2017-06-29 10:46:16 -07:00
object_id.cocci cocci: avoid self-references in object_id transformations 2016-11-01 10:58:39 -07:00
qsort.cocci remove unnecessary check before QSORT 2016-09-29 15:42:18 -07:00
strbuf.cocci strbuf: add strbuf_add_real_path() 2017-02-27 11:02:06 -08:00
swap.cocci add SWAP macro 2017-01-30 14:07:45 -08:00
xstrdup_or_null.cocci abspath: add absolute_pathdup() 2017-01-26 14:51:06 -08:00

This directory provides examples of Coccinelle (http://coccinelle.lip6.fr/)
semantic patches that might be useful to developers.