gcc-8 warns that static_cast<dt &>(d) is useless. In general, it is
useless. It is present to force a compile error in cases when `d` is
not convertible to `dt &`. Switch to a compound statement that declares
a local reference to `d` of type `dt &`. This achieves the same
checking effect, but does not provoke the -Wuseless-cast warning.
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/388>
Rename symbol WORDS_NEED_ALIGNMENT to DXX_WORDS_NEED_ALIGNMENT to show that it is a DXX
symbol, not one inherited from a library.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -wl WORDS_NEED_ALIGNMENT -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(WORDS_NEED_ALIGNMENT\)\>/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(WORDS_NEED_ALIGNMENT\))/#\1if \2DXX_\3/' -e 's/^\s*#ifndef \(WORDS_NEED_ALIGNMENT\)\>/#if !DXX_\1/'
Rename symbol WORDS_BIGENDIAN to DXX_WORDS_BIGENDIAN to show that it is a DXX
symbol, not one inherited from a library.
This is a mostly automated transform, but the changes to SConstruct were
manual.
git grep -wl WORDS_BIGENDIAN -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(WORDS_BIGENDIAN\)\>/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(WORDS_BIGENDIAN\))/#\1if \2DXX_\3/' -e 's/^\s*#ifndef \(WORDS_BIGENDIAN\)\>/#if !DXX_\1/'
The cast provokes a warning on systems that require alignment, so remove
it. memcpy takes const void* input, so the cast is unnecessary.
Reported-by: MattWatt <https://github.com/dxx-rebirth/dxx-rebirth/issues/119>
This fixes a regression from 6e96ff3e00
where WORDS_BIGENDIAN somehow was confused with WORDS_NEED_ALIGNMENT,
so that setting WORDS_NEED_ALIGNMENT resulted in assuming a big endian
machine. This completely broke the RPi build, which is little endian.
Fixes: 6e96ff3e00 ("Fix ambiguous use of INTEL_SHORT/INTEL_INT")
[Kp: added Fixes tag.]