deathkiller / jazz2-native

🎮 · Jazz² Resurrection: Native C++ reimplementation of Jazz Jackrabbit 2
https://deat.tk/jazz2/
GNU General Public License v3.0
549 stars 37 forks source link

Use union for int-float type conversion #80

Closed arkamar closed 1 month ago

arkamar commented 1 month ago

Union based type punning seems to be safer for int-float type conversion as it works around strict aliasing rules, which improves portability.

This PR is related to Gentoo bug 940326.

deathkiller commented 1 month ago

Thank you for contribution! I forgot about these functions, fortunately it's used only in unreleased online multiplayer.