Title: [225412] trunk/Source/ThirdParty/ANGLE
- Revision
- 225412
- Author
- [email protected]
- Date
- 2017-12-01 14:09:19 -0800 (Fri, 01 Dec 2017)
Log Message
Unreviewed, fix byte order macros and address new -Wunknown-pragmas warnings
https://bugs.webkit.org/show_bug.cgi?id=180177
<rdar://problem/35774734>
I'm not sure how this code was developed, as it seems to have been designed for GCC, but it
does not use any of GCC's documented byte order macros, and accordingly does not work. Let's
fix it to guarantee there are no problems when building with GCC. I presume it should help
Clang as well.
* src/common/third_party/smhasher/src/PMurHash.cpp:
(angle::PMurHash32_Process):
Modified Paths
Diff
Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (225411 => 225412)
--- trunk/Source/ThirdParty/ANGLE/ChangeLog 2017-12-01 21:58:36 UTC (rev 225411)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog 2017-12-01 22:09:19 UTC (rev 225412)
@@ -1,3 +1,17 @@
+2017-12-01 Michael Catanzaro <[email protected]>
+
+ Unreviewed, fix byte order macros and address new -Wunknown-pragmas warnings
+ https://bugs.webkit.org/show_bug.cgi?id=180177
+ <rdar://problem/35774734>
+
+ I'm not sure how this code was developed, as it seems to have been designed for GCC, but it
+ does not use any of GCC's documented byte order macros, and accordingly does not work. Let's
+ fix it to guarantee there are no problems when building with GCC. I presume it should help
+ Clang as well.
+
+ * src/common/third_party/smhasher/src/PMurHash.cpp:
+ (angle::PMurHash32_Process):
+
2017-12-01 Tomoki Imai <[email protected]>
Fix WinCairo build break after r225340
Modified: trunk/Source/ThirdParty/ANGLE/src/common/third_party/smhasher/src/PMurHash.cpp (225411 => 225412)
--- trunk/Source/ThirdParty/ANGLE/src/common/third_party/smhasher/src/PMurHash.cpp 2017-12-01 21:58:36 UTC (rev 225411)
+++ trunk/Source/ThirdParty/ANGLE/src/common/third_party/smhasher/src/PMurHash.cpp 2017-12-01 22:09:19 UTC (rev 225412)
@@ -74,6 +74,12 @@
* ROTL32(x,r) Rotate x left by r bits
*/
+#if defined(__GNUC__)
+ #define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
+ #define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
+ #define __BYTE_ORDER __BYTE_ORDER__
+#endif
+
/* Convention is to define __BYTE_ORDER == to one of these values */
#if !defined(__BIG_ENDIAN)
#define __BIG_ENDIAN 4321
@@ -111,10 +117,14 @@
/* Now find best way we can to READ_UINT32 */
#if __BYTE_ORDER==__LITTLE_ENDIAN
/* CPU endian matches murmurhash algorithm, so read 32-bit word directly */
+#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-align"
+#endif
#define READ_UINT32(ptr) (*((uint32_t*)(ptr)))
+#if defined(__clang__)
#pragma clang diagnostic pop
+#endif
#elif __BYTE_ORDER==__BIG_ENDIAN
/* TODO: Add additional cases below where a compiler provided bswap32 is available */
#if defined(__GNUC__) && (__GNUC__>4 || (__GNUC__==4 && __GNUC_MINOR__>=3))
@@ -221,10 +231,14 @@
switch(n) { /* how many bytes in c */
case 0: /* c=[----] w=[3210] b=[3210]=w c'=[----] */
for( ; ptr < end ; ptr+=4) {
+#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-align"
+#endif
uint32_t k1 = READ_UINT32(ptr);
+#if defined(__clang__)
#pragma clang diagnostic pop
+#endif
DOBLOCK(h1, k1);
}
break;
@@ -231,10 +245,14 @@
case 1: /* c=[0---] w=[4321] b=[3210]=c>>24|w<<8 c'=[4---] */
for( ; ptr < end ; ptr+=4) {
uint32_t k1 = c>>24;
+#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-align"
+#endif
c = READ_UINT32(ptr);
+#if defined(__clang__)
#pragma clang diagnostic pop
+#endif
k1 |= c<<8;
DOBLOCK(h1, k1);
}
@@ -242,10 +260,14 @@
case 2: /* c=[10--] w=[5432] b=[3210]=c>>16|w<<16 c'=[54--] */
for( ; ptr < end ; ptr+=4) {
uint32_t k1 = c>>16;
+#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-align"
+#endif
c = READ_UINT32(ptr);
+#if defined(__clang__)
#pragma clang diagnostic pop
+#endif
k1 |= c<<16;
DOBLOCK(h1, k1);
}
@@ -253,10 +275,14 @@
case 3: /* c=[210-] w=[6543] b=[3210]=c>>8|w<<24 c'=[654-] */
for( ; ptr < end ; ptr+=4) {
uint32_t k1 = c>>8;
+#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-align"
+#endif
c = READ_UINT32(ptr);
+#if defined(__clang__)
#pragma clang diagnostic pop
+#endif
k1 |= c<<24;
DOBLOCK(h1, k1);
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes