⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 118643 in webkit


Ignore:
Timestamp:
May 27, 2012, 7:26:35 PM (14 years ago)
Author:
yosin@chromium.org
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:
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r118603 r118643  
     12012-05-27  Yoshifumi Inoue  <yosin@chromium.org>
     2
     3        [WTF] Introduce UINT64_C to MathExtras.h
     4        https://bugs.webkit.org/show_bug.cgi?id=87485
     5
     6        Reviewed by Kent Tamura.
     7
     8        * wtf/MathExtras.h:
     9
    1102012-05-25  Filip Pizlo  <fpizlo@apple.com>
    211
  • trunk/Source/WTF/wtf/MathExtras.h

    r117779 r118643  
    303303#endif
    304304
     305#ifndef UINT64_C
     306#if COMPILER(MSVC)
     307#define UINT64_C(c) c ## ui64
     308#else
     309#define UINT64_C(c) c ## ull
     310#endif
     311#endif
     312
    305313
    306314// decompose 'number' to its sign, exponent, and mantissa components.
  • trunk/Source/WebCore/ChangeLog

    r118639 r118643  
     12012-05-27  Yoshifumi Inoue  <yosin@chromium.org>
     2
     3        [WTF] Introduce UINT64_C to MathExtras.h
     4        https://bugs.webkit.org/show_bug.cgi?id=87485
     5
     6        Reviewed by Kent Tamura.
     7
     8        This patch introduces UINT64_C for all platforms to avoid using
     9        conditional compilation.
     10
     11        No new tests. This patch doesn't change behavior.
     12
     13        * Modules/websockets/WebSocketFrame.cpp:
     14        (WebCore::WebSocketFrame::parseFrame): Replace conditional compilation with UINT64_C.
     15
    1162012-05-27  Luke Macpherson  <macpherson@chromium.org>
    217
  • trunk/Source/WebCore/Modules/websockets/WebSocketFrame.cpp

    r113580 r118643  
    2828
    2929#include <wtf/CryptographicallyRandomNumber.h>
     30#include <wtf/MathExtras.h>
    3031
    3132using namespace std;
     
    9596    }
    9697
    97     // FIXME: UINT64_C(0x7FFFFFFFFFFFFFFF) should be used but it did not compile on Qt bots.
    98 #if COMPILER(MSVC)
    99     static const uint64_t maxPayloadLength = 0x7FFFFFFFFFFFFFFFui64;
    100 #else
    101     static const uint64_t maxPayloadLength = 0x7FFFFFFFFFFFFFFFull;
    102 #endif
     98    static const uint64_t maxPayloadLength = UINT64_C(0x7FFFFFFFFFFFFFFF);
    10399    size_t maskingKeyLength = masked ? maskingKeyWidthInBytes : 0;
    104100    if (payloadLength64 > maxPayloadLength || payloadLength64 + maskingKeyLength > numeric_limits<size_t>::max()) {
Note: See TracChangeset for help on using the changeset viewer.