Title: [118643] trunk/Source
Revision
118643
Author
[email protected]
Date
2012-05-27 19:26:35 -0700 (Sun, 27 May 2012)

Log Message

[WTF] Introduce UINT64_C to MathExtras.h
https://bugs.webkit.org/show_bug.cgi?id=87485

Reviewed by Kent Tamura.

Source/WebCore:

This patch introduces UINT64_C for all platforms to avoid using
conditional compilation.

No new tests. This patch doesn't change behavior.

* Modules/websockets/WebSocketFrame.cpp:
(WebCore::WebSocketFrame::parseFrame): Replace conditional compilation with UINT64_C.

Source/WTF:

* wtf/MathExtras.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (118642 => 118643)


--- trunk/Source/WTF/ChangeLog	2012-05-28 02:05:37 UTC (rev 118642)
+++ trunk/Source/WTF/ChangeLog	2012-05-28 02:26:35 UTC (rev 118643)
@@ -1,3 +1,12 @@
+2012-05-27  Yoshifumi Inoue  <[email protected]>
+
+        [WTF] Introduce UINT64_C to MathExtras.h
+        https://bugs.webkit.org/show_bug.cgi?id=87485
+
+        Reviewed by Kent Tamura.
+
+        * wtf/MathExtras.h:
+
 2012-05-25  Filip Pizlo  <[email protected]>
 
         weakCompareAndSwap should work on Windows

Modified: trunk/Source/WTF/wtf/MathExtras.h (118642 => 118643)


--- trunk/Source/WTF/wtf/MathExtras.h	2012-05-28 02:05:37 UTC (rev 118642)
+++ trunk/Source/WTF/wtf/MathExtras.h	2012-05-28 02:26:35 UTC (rev 118643)
@@ -302,7 +302,15 @@
 #define isnan(x) wtf_isnan(x)
 #endif
 
+#ifndef UINT64_C
+#if COMPILER(MSVC)
+#define UINT64_C(c) c ## ui64
+#else
+#define UINT64_C(c) c ## ull
+#endif
+#endif
 
+
 // decompose 'number' to its sign, exponent, and mantissa components.
 // The result is interpreted as:
 //     (sign ? -1 : 1) * pow(2, exponent) * (mantissa / (1 << 52))

Modified: trunk/Source/WebCore/ChangeLog (118642 => 118643)


--- trunk/Source/WebCore/ChangeLog	2012-05-28 02:05:37 UTC (rev 118642)
+++ trunk/Source/WebCore/ChangeLog	2012-05-28 02:26:35 UTC (rev 118643)
@@ -1,3 +1,18 @@
+2012-05-27  Yoshifumi Inoue  <[email protected]>
+
+        [WTF] Introduce UINT64_C to MathExtras.h
+        https://bugs.webkit.org/show_bug.cgi?id=87485
+
+        Reviewed by Kent Tamura.
+
+        This patch introduces UINT64_C for all platforms to avoid using
+        conditional compilation.
+
+        No new tests. This patch doesn't change behavior.
+
+        * Modules/websockets/WebSocketFrame.cpp:
+        (WebCore::WebSocketFrame::parseFrame): Replace conditional compilation with UINT64_C.
+
 2012-05-27  Luke Macpherson  <[email protected]>
 
         Use StringBuilder in WebKitCSSTransformValue::customCssText() to allow code reuse with CSS Variables.

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketFrame.cpp (118642 => 118643)


--- trunk/Source/WebCore/Modules/websockets/WebSocketFrame.cpp	2012-05-28 02:05:37 UTC (rev 118642)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketFrame.cpp	2012-05-28 02:26:35 UTC (rev 118643)
@@ -27,6 +27,7 @@
 #include "WebSocketFrame.h"
 
 #include <wtf/CryptographicallyRandomNumber.h>
+#include <wtf/MathExtras.h>
 
 using namespace std;
 
@@ -94,12 +95,7 @@
         }
     }
 
-    // FIXME: UINT64_C(0x7FFFFFFFFFFFFFFF) should be used but it did not compile on Qt bots.
-#if COMPILER(MSVC)
-    static const uint64_t maxPayloadLength = 0x7FFFFFFFFFFFFFFFui64;
-#else
-    static const uint64_t maxPayloadLength = 0x7FFFFFFFFFFFFFFFull;
-#endif
+    static const uint64_t maxPayloadLength = UINT64_C(0x7FFFFFFFFFFFFFFF);
     size_t maskingKeyLength = masked ? maskingKeyWidthInBytes : 0;
     if (payloadLength64 > maxPayloadLength || payloadLength64 + maskingKeyLength > numeric_limits<size_t>::max()) {
         errorString = "WebSocket frame length too large: " + String::number(payloadLength64) + " bytes";
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to