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*(/static_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
BM_XRGB doubles its inputs. 35a4736 doubled the inputs explicitly, but
passed them back to BM_XRGB, which doubled them again. Switch to a
direct call to gr_find_closest_color to skip the second double pass.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/192>
Fixes: 35a4736df0 ("Pass color to gr_urect")
Commit 3adc5fe77a added the ability to
bind mouse buttons to change weapons, but a copying error bound the
fusion/omega entry to joystick instead of mouse. Switch it to mouse as
clearly intended.
This fix is needed for any commit with the underlying feature, but only
applies cleanly to 0.58.1 after applying cleanup commits:
00381b2652 ("Abstract out weapon names")
d035fb258a ("Remove unused kc_item->id")
fc1e00dae6 ("Pre-compute labelx+inputx")
a4f3c93247 ("Separate mutable and const kconfig data")
953a1888d7 ("Combine state pointer and count pointer")
2bd302cddd ("Move Controls ubyte values into substructure")
ff8db8d39e ("Reduce relocations for Controls members")
593d0b25ff ("Remove duplicate kconfig labels")
dc36ee3ab3 ("Store kconfig labels separately")
Fixes: 3adc5fe77a ("Saving weapon keys in PLX like in D1X-Rebirth" ...)
Most call sites use unqualified begin/end and rely on using declarations
to pick an appropriate implementation. Fix the sites that explicitly
requested std::begin/std::end.
Fixes: similar/main/kconfig.cpp:81:12: error: no member named 'plus' in namespace 'std'
Fixes: similar/main/kconfig.cpp:82:12: error: no member named 'minus' in namespace 'std'
[Kp: fixed commit formatting. Git style says line 2 is always blank.]