Bug 1471632 - Fix angle mingw clang compilation. r?jrmuizel draft
authorJacek Caban <jacek@codeweavers.com>
Wed, 27 Jun 2018 17:23:54 +0200
changeset 817774 653157fc1618ece9140cfdc91569094cfe2dc0ea
parent 817773 c429f36612870767735a65165f5aa58361076159
push id116155
push userbmo:jacek@codeweavers.com
push dateFri, 13 Jul 2018 12:18:34 +0000
reviewersjrmuizel
bugs1471632
milestone60.1.1
Bug 1471632 - Fix angle mingw clang compilation. r?jrmuizel MozReview-Commit-ID: GywUtUKvAC3
gfx/angle/checkout/src/common/third_party/smhasher/src/PMurHash.cpp
--- a/gfx/angle/checkout/src/common/third_party/smhasher/src/PMurHash.cpp
+++ b/gfx/angle/checkout/src/common/third_party/smhasher/src/PMurHash.cpp
@@ -44,16 +44,17 @@ high byte in stream order.
 To handle endianess I simply use a macro that reads a uint32_t and define
 that macro to be a direct read on little endian machines, a read and swap
 on big endian machines, or a byte-by-byte read if the endianess is unknown.
 
 -----------------------------------------------------------------------------*/
 
 
 #include "PMurHash.h"
+#include <stdint.h>
 
 /* I used ugly type names in the header to avoid potential conflicts with
  * application or system typedefs & defines. Since I'm not including any more
  * headers below here I can rename these so that the code reads like C99 */
 #undef uint32_t
 #define uint32_t MH_UINT32
 #undef uint8_t
 #define uint8_t  MH_UINT8
@@ -203,17 +204,17 @@ void PMurHash32_Process(uint32_t *ph1, u
     uint32_t k1 = READ_UINT32(ptr);
     DOBLOCK(h1, k1);
   }
 
 #else /*UNALIGNED_SAFE*/
   /* This CPU does not handle unaligned word access */
 
   /* Consume enough so that the next data byte is word aligned */
-  int i = -(long)ptr & 3;
+  int i = -(intptr_t)ptr & 3;
   if(i && i <= len) {
       DOBYTES(i, h1, c, n, ptr, len);
   }
 
   /* We're now aligned. Process in aligned blocks. Specialise for each possible carry count */
   end = ptr + len/4*4;
   switch(n) { /* how many bytes in c */
   case 0: /* c=[----]  w=[3210]  b=[3210]=w            c'=[----] */