This pass only targets commonly used standard types.
s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\*\)\s*)\s*(/reinterpret_cast<\1>(/g
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
Previously, Rebirth on __unix__ always set the write directory to
"~/.d*x-rebirth" (or "~/Library/Preferences/D*X Rebirth/" on Mac). Add
$D*X_REBIRTH_HOME and $REBIRTH_HOME to override it. If
$D*X_REBIRTH_HOME is set, use that. If not, then try $REBIRTH_HOME. If
that is also unset, then use the hardcoded default.
bmread copies from a stale pointer into a local buffer. If the stale
pointer points to null bytes, this is stupid but harmless. If the stale
pointer points to a large run of non-null bytes, this crashes the game.
Modify PHYSFSX_fgets to clear the unused portion of the return buffer to
work around this bmread bug. Otherwise using shareware data crashes the
game at startup.