aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarbenium <carbenium@outlook.com>2015-11-25 13:56:33 +0100
committerCarbenium <carbenium@outlook.com>2015-11-26 23:54:25 +0100
commit260005a7e7dcd43dde447b0c313156ac43eb18a4 (patch)
treed2ff539a54434ecf96ac178c84c3ebf8c5f8429c
parent63cf1c6edfdac4bd70f2e53e3e478f655f0f034b (diff)
Dep/SFMT: Fix a strict-aliasing warning reported by GCC 4.9
(cherry picked from commit dd55e41c8158fe1f60e120b0b89469d4112158d2)
-rw-r--r--dep/SFMT/SFMT.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/dep/SFMT/SFMT.h b/dep/SFMT/SFMT.h
index 3d15d651e5b..ccf21cecd5f 100644
--- a/dep/SFMT/SFMT.h
+++ b/dep/SFMT/SFMT.h
@@ -173,7 +173,8 @@ public:
uint32_t statesize = SFMT_N*4; // Size of state vector
// Fill state vector with random numbers from seed
- ((uint32_t*)state)[0] = y;
+ uint32_t* s = (uint32_t*)&state;
+ s[0] = y;
const uint32_t factor = 1812433253U;// Multiplication factor
for (i = 1; i < statesize; i++) {