Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: Source/platform/CheckedInt.h

Issue 858663002: Fix template angle bracket syntax in platform (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/AsyncMethodRunner.h ('k') | Source/platform/CrossThreadCopier.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public 2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 5
6 /* Provides checked integers, detecting integer overflow and divide-by-0. */ 6 /* Provides checked integers, detecting integer overflow and divide-by-0. */
7 7
8 // Necessary modifications are made to the original CheckedInt.h file when 8 // Necessary modifications are made to the original CheckedInt.h file when
9 // incorporating it into WebKit: 9 // incorporating it into WebKit:
10 // 1) Comment out #define MOZ_CHECKEDINT_ENABLE_MOZ_ASSERTS 10 // 1) Comment out #define MOZ_CHECKEDINT_ENABLE_MOZ_ASSERTS
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 namespace detail { 741 namespace detail {
742 742
743 template<typename T, typename U> 743 template<typename T, typename U>
744 struct CastToCheckedIntImpl 744 struct CastToCheckedIntImpl
745 { 745 {
746 typedef CheckedInt<T> ReturnType; 746 typedef CheckedInt<T> ReturnType;
747 static CheckedInt<T> run(U u) { return u; } 747 static CheckedInt<T> run(U u) { return u; }
748 }; 748 };
749 749
750 template<typename T> 750 template<typename T>
751 struct CastToCheckedIntImpl<T, CheckedInt<T> > 751 struct CastToCheckedIntImpl<T, CheckedInt<T>>
752 { 752 {
753 typedef const CheckedInt<T>& ReturnType; 753 typedef const CheckedInt<T>& ReturnType;
754 static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; } 754 static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; }
755 }; 755 };
756 756
757 } // namespace detail 757 } // namespace detail
758 758
759 template<typename T, typename U> 759 template<typename T, typename U>
760 inline typename detail::CastToCheckedIntImpl<T, U>::ReturnType 760 inline typename detail::CastToCheckedIntImpl<T, U>::ReturnType
761 castToCheckedInt(U u) 761 castToCheckedInt(U u)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 typedef CheckedInt<int16_t> CheckedInt16; 809 typedef CheckedInt<int16_t> CheckedInt16;
810 typedef CheckedInt<uint16_t> CheckedUint16; 810 typedef CheckedInt<uint16_t> CheckedUint16;
811 typedef CheckedInt<int32_t> CheckedInt32; 811 typedef CheckedInt<int32_t> CheckedInt32;
812 typedef CheckedInt<uint32_t> CheckedUint32; 812 typedef CheckedInt<uint32_t> CheckedUint32;
813 typedef CheckedInt<int64_t> CheckedInt64; 813 typedef CheckedInt<int64_t> CheckedInt64;
814 typedef CheckedInt<uint64_t> CheckedUint64; 814 typedef CheckedInt<uint64_t> CheckedUint64;
815 815
816 } // namespace blink 816 } // namespace blink
817 817
818 #endif /* mozilla_CheckedInt_h_ */ 818 #endif /* mozilla_CheckedInt_h_ */
OLDNEW
« no previous file with comments | « Source/platform/AsyncMethodRunner.h ('k') | Source/platform/CrossThreadCopier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698