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

Side by Side Diff: third_party/base/numerics/safe_math.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
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 BASE_SAFE_MATH_H_ 5 #ifndef PDFIUM_THIRD_PARTY_BASE_SAFE_MATH_H_
6 #define BASE_SAFE_MATH_H_ 6 #define PDFIUM_THIRD_PARTY_BASE_SAFE_MATH_H_
7 7
8 #include "safe_math_impl.h" 8 #include "safe_math_impl.h"
9 9
10 namespace pdfium {
10 namespace base { 11 namespace base {
11
12 namespace internal { 12 namespace internal {
13 13
14 // CheckedNumeric implements all the logic and operators for detecting integer 14 // CheckedNumeric implements all the logic and operators for detecting integer
15 // boundary conditions such as overflow, underflow, and invalid conversions. 15 // boundary conditions such as overflow, underflow, and invalid conversions.
16 // The CheckedNumeric type implicitly converts from floating point and integer 16 // The CheckedNumeric type implicitly converts from floating point and integer
17 // data types, and contains overloads for basic arithmetic operations (i.e.: +, 17 // data types, and contains overloads for basic arithmetic operations (i.e.: +,
18 // -, *, /, %). 18 // -, *, /, %).
19 // 19 //
20 // The following methods convert from CheckedNumeric to standard numeric values: 20 // The following methods convert from CheckedNumeric to standard numeric values:
21 // IsValid() - Returns true if the underlying numeric value is valid (i.e. has 21 // IsValid() - Returns true if the underlying numeric value is valid (i.e. has
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 BASE_NUMERIC_ARITHMETIC_OPERATORS(Div, /, /= ) 260 BASE_NUMERIC_ARITHMETIC_OPERATORS(Div, /, /= )
261 BASE_NUMERIC_ARITHMETIC_OPERATORS(Mod, %, %= ) 261 BASE_NUMERIC_ARITHMETIC_OPERATORS(Mod, %, %= )
262 262
263 #undef BASE_NUMERIC_ARITHMETIC_OPERATORS 263 #undef BASE_NUMERIC_ARITHMETIC_OPERATORS
264 264
265 } // namespace internal 265 } // namespace internal
266 266
267 using internal::CheckedNumeric; 267 using internal::CheckedNumeric;
268 268
269 } // namespace base 269 } // namespace base
270 } // namespace pdfium
270 271
271 #endif // BASE_SAFE_MATH_H_ 272 #endif // PDFIUM_THIRD_PARTY_BASE_SAFE_MATH_H_
OLDNEW
« no previous file with comments | « third_party/base/numerics/safe_conversions_impl.h ('k') | third_party/base/numerics/safe_math_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698