1b12a3f7ef
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 some C casts. This pass attempts to process expressions that involve parenthesized or bracketed subexpressions, but only if those subexpressions do not themselves contain parenthesized or bracketed subexpressions. (int) f(1); // changed (int) f(g()); // not changed perl -p -i -e '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*-\s*[^>]))/\1\(\3\4\5\6\)\7/g' |
||
---|---|---|
.. | ||
2d | ||
3d | ||
arch | ||
editor | ||
include | ||
main | ||
maths | ||
mem | ||
misc | ||
texmap | ||
ui |