coccinelle: remove parentheses that become unnecessary
authorRené Scharfe <l.s.r@web.de>
Sun, 1 Oct 2017 15:12:08 +0000 (17:12 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Oct 2017 04:02:26 +0000 (13:02 +0900)
commit9ca356fa8b9843b6565a3620f20c7538c1966c7f
tree77c597048bc35fbd3bf795e55de5030068aaf9e0
parent4010f1d1b782eb7585e0e0abcefa794bd5ff29a0
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>
contrib/coccinelle/array.cocci