Selaa lähdekoodia

Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152)

Christophe Riccio 11 vuotta sitten
vanhempi
sitoutus
658d7e2788
2 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 4 2
      glm/detail/func_integer.inl
  2. 1 0
      readme.txt

+ 4 - 2
glm/detail/func_integer.inl

@@ -171,7 +171,8 @@ namespace glm
 		GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
 		GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
 
 
 		uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
 		uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
-		msb = *(reinterpret_cast<uint32*>(&Value64) + 1);
+		uint32* PointerMSB = (reinterpret_cast<uint32*>(&Value64) + 1);
+		msb = *PointerMSB;
 		lsb = reinterpret_cast<uint32&>(Value64);
 		lsb = reinterpret_cast<uint32&>(Value64);
 	}
 	}
 
 
@@ -230,7 +231,8 @@ namespace glm
 		GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
 		GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
 
 
 		int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
 		int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
-		msb = *(reinterpret_cast<int32*>(&Value64) + 1);
+		int32* PointerMSB = (reinterpret_cast<int32*>(&Value64) + 1);
+		msb = *PointerMSB;
 		lsb = reinterpret_cast<int32&>(Value64);
 		lsb = reinterpret_cast<int32&>(Value64);
 	}
 	}
 
 

+ 1 - 0
readme.txt

@@ -46,6 +46,7 @@ GLM 0.9.5.3: 2014-0X-XX
 - Added GLM_GTX_matrix_transform_2d extension (#178, #176)
 - Added GLM_GTX_matrix_transform_2d extension (#178, #176)
 - Fixed CUDA issues (#169, #168, #183, #182)
 - Fixed CUDA issues (#169, #168, #183, #182)
 - Added support for all extensions but GTX_string_cast to CUDA
 - Added support for all extensions but GTX_string_cast to CUDA
+- Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152)
 
 
 ================================================================================
 ================================================================================
 GLM 0.9.5.2: 2014-02-08
 GLM 0.9.5.2: 2014-02-08