Commit a4d78dcb authored by hybrid's avatar hybrid

Fix strict aliasing problem.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3988 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 5ec87d0b
...@@ -2328,10 +2328,11 @@ f32 CXMeshFileLoader::readFloat() ...@@ -2328,10 +2328,11 @@ f32 CXMeshFileLoader::readFloat()
if (FloatSize == 8) if (FloatSize == 8)
{ {
#ifdef __BIG_ENDIAN__ #ifdef __BIG_ENDIAN__
c8 ctmp[8]; //TODO: Check if data is properly converted here
*((f32*)(ctmp+4)) = os::Byteswap::byteswap(*(f32 *)P); f32 ctmp[2];
*((f32*)(ctmp)) = os::Byteswap::byteswap(*(f32 *)P+4); ctmp[1] = os::Byteswap::byteswap(*(f32*)P);
const f32 tmp = (f32)(*(f64 *)ctmp); ctmp[0] = os::Byteswap::byteswap(*(f32*)P+4);
const f32 tmp = (f32)(*(f64*)(void*)ctmp);
#else #else
const f32 tmp = (f32)(*(f64 *)P); const f32 tmp = (f32)(*(f64 *)P);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment