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

Side by Side Diff: third_party/base/numerics/safe_math_impl.h

Issue 900753002: Add namespace and re-arrange PDFium's local copy of chromium /base. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rename safemath target to pdfium_base Created 5 years, 10 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 | « third_party/base/numerics/safe_math.h ('k') | third_party/base/template_util.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SAFE_MATH_IMPL_H_ 5 #ifndef PDFIUM_THIRD_PARTY_SAFE_MATH_IMPL_H_
6 #define SAFE_MATH_IMPL_H_ 6 #define PDFIUM_THIRD_PARTY_SAFE_MATH_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cmath> 10 #include <cmath>
11 #include <cstdlib> 11 #include <cstdlib>
12 #include <limits> 12 #include <limits>
13 13
14 #include "../macros.h" 14 #include "../macros.h"
15 #include "../template_util.h" 15 #include "../template_util.h"
16 #include "safe_conversions.h" 16 #include "safe_conversions.h"
17 17
18 namespace pdfium {
18 namespace base { 19 namespace base {
19 namespace internal { 20 namespace internal {
20 21
21 // Everything from here up to the floating point operations is portable C++, 22 // Everything from here up to the floating point operations is portable C++,
22 // but it may not be fast. This code could be split based on 23 // but it may not be fast. This code could be split based on
23 // platform/architecture and replaced with potentially faster implementations. 24 // platform/architecture and replaced with potentially faster implementations.
24 25
25 // Integer promotion templates used by the portable checked integer arithmetic. 26 // Integer promotion templates used by the portable checked integer arithmetic.
26 template <size_t Size, bool IsSigned> 27 template <size_t Size, bool IsSigned>
27 struct IntegerForSizeAndSign; 28 struct IntegerForSizeAndSign;
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 StaticDstRangeRelationToSrcRange<T, Lhs>::value == 492 StaticDstRangeRelationToSrcRange<T, Lhs>::value ==
492 NUMERIC_RANGE_CONTAINED && 493 NUMERIC_RANGE_CONTAINED &&
493 sizeof(T) >= (2 * sizeof(Lhs)) && 494 sizeof(T) >= (2 * sizeof(Lhs)) &&
494 StaticDstRangeRelationToSrcRange<T, Rhs>::value != 495 StaticDstRangeRelationToSrcRange<T, Rhs>::value !=
495 NUMERIC_RANGE_CONTAINED && 496 NUMERIC_RANGE_CONTAINED &&
496 sizeof(T) >= (2 * sizeof(Rhs)); 497 sizeof(T) >= (2 * sizeof(Rhs));
497 }; 498 };
498 499
499 } // namespace internal 500 } // namespace internal
500 } // namespace base 501 } // namespace base
502 } // namespace pdfium
501 503
502 #endif // SAFE_MATH_IMPL_H_ 504 #endif // PDFIUM_THIRD_PARTY_SAFE_MATH_IMPL_H_
OLDNEW
« no previous file with comments | « third_party/base/numerics/safe_math.h ('k') | third_party/base/template_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698