Title: [153440] trunk/Source/WTF
Revision
153440
Author
[email protected]
Date
2013-07-29 13:10:27 -0700 (Mon, 29 Jul 2013)

Log Message

Reintroduce convenience CheckedInt*, CheckedUint* types
https://bugs.webkit.org/show_bug.cgi?id=119213

Reviewed by Oliver Hunt.

Reintroduce CheckedInt* and CheckedUint* types that were previously provided for convenience
through the CheckedInt header that was removed in r153095. The types are now based on the
Checked class, using the RecordOverflow class as the overflow handler.

* wtf/CheckedArithmetic.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (153439 => 153440)


--- trunk/Source/WTF/ChangeLog	2013-07-29 20:09:26 UTC (rev 153439)
+++ trunk/Source/WTF/ChangeLog	2013-07-29 20:10:27 UTC (rev 153440)
@@ -1,3 +1,16 @@
+2013-07-29  Zan Dobersek  <[email protected]>
+
+        Reintroduce convenience CheckedInt*, CheckedUint* types
+        https://bugs.webkit.org/show_bug.cgi?id=119213
+
+        Reviewed by Oliver Hunt.
+
+        Reintroduce CheckedInt* and CheckedUint* types that were previously provided for convenience
+        through the CheckedInt header that was removed in r153095. The types are now based on the
+        Checked class, using the RecordOverflow class as the overflow handler.
+
+        * wtf/CheckedArithmetic.h:
+
 2013-07-27  Ryosuke Niwa  <[email protected]>
 
         REGRESSION(r153380): Can't open messages on Gmail

Modified: trunk/Source/WTF/wtf/CheckedArithmetic.h (153439 => 153440)


--- trunk/Source/WTF/wtf/CheckedArithmetic.h	2013-07-29 20:09:26 UTC (rev 153439)
+++ trunk/Source/WTF/wtf/CheckedArithmetic.h	2013-07-29 20:10:27 UTC (rev 153440)
@@ -712,10 +712,28 @@
     return Checked<U, OverflowHandler>(lhs) * rhs;
 }
 
+// Convenience typedefs.
+typedef Checked<int8_t, RecordOverflow> CheckedInt8;
+typedef Checked<uint8_t, RecordOverflow> CheckedUint8;
+typedef Checked<int16_t, RecordOverflow> CheckedInt16;
+typedef Checked<uint16_t, RecordOverflow> CheckedUint16;
+typedef Checked<int32_t, RecordOverflow> CheckedInt32;
+typedef Checked<uint32_t, RecordOverflow> CheckedUint32;
+typedef Checked<int64_t, RecordOverflow> CheckedInt64;
+typedef Checked<uint64_t, RecordOverflow> CheckedUint64;
+
 }
 
 using WTF::Checked;
 using WTF::CheckedState;
 using WTF::RecordOverflow;
+using WTF::CheckedInt8;
+using WTF::CheckedUint8;
+using WTF::CheckedInt16;
+using WTF::CheckedUint16;
+using WTF::CheckedInt32;
+using WTF::CheckedUint32;
+using WTF::CheckedInt64;
+using WTF::CheckedUint64;
 
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to