d2x::segment has all members of d1x::segment, as well as two new members
exclusive to d2x::segment. Structure layout is such that d1x::segment
requires the same size allocation, and places anonymous pad members in
the locations that become named members in d2x::segment. Thus, reusing
d2x::segment for d1x::segment does not change the size of the structure
nor the offsets of any members used. This reuse may enable some
functions to be better shared by the dsx project.
`value` is generic and unclear. It is always meant to be used as an
index into the Station array, so rename it `station_idx` to show this.
Define and consistently use `station_none` to represent that no station
is assigned.
Delete stub "compiler-type_traits.h" header. Redirect all uses to the
standard <type_traits> header.
git grep -wlz 'compiler-type_traits.h' -- '*.cpp' '*.h' | xargs -0 perl -p -i <<EOF
BEGIN {
$i = 0;
}
if (($i == 1 && $_ eq "\n") || ($i < 2 && /^#include "/)) {
# First blank line or first user-include after a system-include.
# Print, then never again for this file.
print "#include <type_traits>\n";
$i = 2;
} elsif ($i == 0) {
$i = 1 if (/^#include </);
} elsif ($_ eq "#include \"compiler-type_traits.h\"\n") {
# Remove this line if found.
$_ = '';
}
# Reset state machine when moving to next file.
$i = 0 if eof;
EOF
All supported compilers have an acceptable <type_traits>. Commit
4cb3d46148 ("Move <type_traits> test to Cxx11RequiredFeature") made
<type_traits> support mandatory in August and no one has objected.
Remove the indirection and use namespace std directly for type_traits
members.
Previously, valptridx used PREFIX for allow-invalid+mutable, c#PREFIX
for allow-invalid+const, v#PREFIX for require-valid+mutable, vc#PREFIX
for require-valid+const. Convert the types, factories, and all usage
sites to specify a qualifier for all four combinations:
im#PREFIX -> allow-invalid+mutable
ic#PREFIX -> allow-invalid+const
vm#PREFIX -> require-valid+mutable
vc#PREFIX -> require-valid+const
Changes to common/include/valptridx.h and common/include/fwd-valptridx.h
are manual. All other changes are generated by:
git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\(v\?\)\(\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/\1m\2/g'
for the 'm' prefix and:
git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\([cm]\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/i&/g'
for the 'i' prefix.
Use std::equal_range to find the upper and lower bounds in a single
binary search, rather than relying on a linear search to find the first
sought element.
The declaration of valptridx_specialized_types needed to be found by
Argument Dependent Lookup, but this was inconvenient for some types.
Split the declaration of valptridx_specialized_types out from the
definition of valptridx global subtype.
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library. Move it to dxxsconf.h to
shorten the command line.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
bitproxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`. This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x. Rename the parameter
to eliminate the warning.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
tmpl_multibit_proxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`. This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x. Rename the parameter
to eliminate the warning.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
tmpl_maskproxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`. This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x. Rename the parameter
to eliminate the warning.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
bitproxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`. This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x. Rename the parameter
to eliminate the warning.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
tmpl_bitproxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`. This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x. Rename the parameter
to eliminate the warning.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
base_maskproxy_t has a method named `shift` and its constructor took a
parameter named `shift`. This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x. Rename the parameter
to eliminate the warning.
Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/197>
sides[] is large and caused all members after it to require disp32
offsets. Move it to the end so that all members can use disp8 offsets.
This saves ~1300 bytes of text on an editor+debug build.
Various functions use the non-macro form, so support for =delete is
already mandatory. Remove the remnants of support for compilers which
lack =delete and replace it with a hard stop when the compiler rejects
declaring explicitly deleted functions.