Changeset 177736 in webkit


Ignore:
Timestamp:
Dec 25, 2014, 10:48:41 AM (10 years ago)
Author:
ap@apple.com
Message:

Simplify saturated integer add/sub
https://bugs.webkit.org/show_bug.cgi?id=139854

Address Darin's post-commit feedback to fix API tests.

  • wtf/SaturatedArithmetic.h: (saturatedSubtraction):
Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r177729 r177736  
     12014-12-25  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Simplify saturated integer add/sub
     4        https://bugs.webkit.org/show_bug.cgi?id=139854
     5
     6        Address Darin's post-commit feedback to fix API tests.
     7
     8        * wtf/SaturatedArithmetic.h: (saturatedSubtraction):
     9
    1102014-12-24  Benjamin Poulain  <benjamin@webkit.org>
    211
  • trunk/Source/WTF/wtf/SaturatedArithmetic.h

    r177729 r177736  
    9797#else
    9898    if (signedSubtractOverflows(a, b, result))
    99         result = std::numeric_limits<uint32_t>::max() + (static_cast<uint32_t>(a) >> 31);
     99        result = std::numeric_limits<int32_t>::max() + (static_cast<uint32_t>(a) >> 31);
    100100#endif
    101101    return result;
Note: See TracChangeset for help on using the changeset viewer.