Restore original casts, see bug 1738
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Fri, 02 Aug 2013 12:31:16 -0700
changeset 10109 99349b1cec14
parent 10108 d9fc1c7ebb10
child 10110 19cd300c6fc6
Restore original casts, see bug 1738
src/core/model/hash-murmur3.cc
--- a/src/core/model/hash-murmur3.cc	Fri Aug 02 12:13:34 2013 +0200
+++ b/src/core/model/hash-murmur3.cc	Fri Aug 02 12:31:16 2013 -0700
@@ -180,8 +180,7 @@
           k1 *= c1; k1 = rotl32(k1,15); k1 *= c2; h1 ^= k1;
   };
 
-  uint32_t * res = (uint32_t *)out;  //PDB: strict aliasing
-  *res = h1;
+  *(uint32_t *)out = h1;
 }
 
 //PDB - incremental hashing - finalization
@@ -197,8 +196,7 @@
 
   h1 = fmix(h1);
 
-  uint32_t * res = (uint32_t *)out;  //PDB: strict aliasing
-  *res = h1;
+  *(uint32_t *)out = h1;
 } 
 
 //-----------------------------------------------------------------------------
@@ -301,11 +299,10 @@
            k1 *= c1; k1  = rotl32(k1,15); k1 *= c2; h1 ^= k1;
   };
 
-  uint32_t * res = (uint32_t *)out;  //PDB: strict aliasing
-  res[0] = h1;
-  res[1] = h2;
-  res[2] = h3;
-  res[3] = h4;
+  ((uint32_t *)out)[0] = h1;
+  ((uint32_t *)out)[1] = h2;
+  ((uint32_t *)out)[2] = h3;
+  ((uint32_t *)out)[3] = h4;
 }
 
 //PDB - incremental hashing - finalization
@@ -333,11 +330,10 @@
   h1 += h2; h1 += h3; h1 += h4;
   h2 += h1; h3 += h1; h4 += h1;
 
-  uint32_t * res = (uint32_t *)out;  //PDB: strict aliasing
-  res[0] = h1;
-  res[1] = h2;
-  res[2] = h3;
-  res[3] = h4;
+  ((uint32_t *)out)[0] = h1;
+  ((uint32_t *)out)[1] = h2;
+  ((uint32_t *)out)[2] = h3;
+  ((uint32_t *)out)[3] = h4;
 }
 
 //-----------------------------------------------------------------------------
@@ -417,9 +413,8 @@
   h1 += h2;
   h2 += h1;
 
-  uint32_t * res = (uint32_t *)out;  //PDB: strict aliasing
-  res[0] = h1;
-  res[1] = h2;
+  ((uint32_t *)out)[0] = h1;
+  ((uint32_t *)out)[1] = h2;
 }