Follow-up Comment #1, patch #1158 (project wesnoth):
NAK, you are breaking aliasing rules. If it works, it's only by chance. With
an optimizing compiler, the result of the comparison will become random once
the function starts being aggressively inlined.
Why not something simpler, like ((y << 16) | x)? It is deterministic,
compiler-independent; and on little endian architectures, the compiler will
optimize it to what you thought you were implementing.
Also, you don't need to change the signature of the constructor. This makes
it slower than needed, since the caller has to truncate the inputs beforehand
on some ABI (e.g. the x86 one).
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?1158>
_______________________________________________
Message posté via/par Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs