dxx-rebirth/similar
Kp 7fdce88558 Add parentheses around target of simple casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

This pass does not attempt to process expressions that involve
any subexpression that can nest arbitrarily, such as parentheses or
brackets.  It also works only on commonly used standard types.

	(int) a->b;	// changed
	(int) a[b];	// not changed

s/\((\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\**\s*)\s*\)\([&+-]\?\)\([[:alnum:]_.]\+\s*->\s*\)*\([[:alnum:]_.]\+\)\(\s*\([];+>)*\/^%,|&<>]\)\|$\|\(\s*-\s*[^>]\)\)/\1(\5\6\7)\8/g
2016-06-05 01:04:25 +00:00
..
2d Add parentheses around target of simple casts 2016-06-05 01:04:25 +00:00
3d Add parentheses around target of simple casts 2016-06-05 01:04:25 +00:00
arch Add parentheses around target of simple casts 2016-06-05 01:04:25 +00:00
editor Add parentheses around target of simple casts 2016-06-05 01:04:25 +00:00
main Add parentheses around target of simple casts 2016-06-05 01:04:25 +00:00
misc Add parentheses around target of simple casts 2016-06-05 01:04:25 +00:00