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

Side by Side Diff: webrtc/rtc_base/safe_minmax.h

Issue 2963273002: Update includes for webrtc/{base => rtc_base} rename (3/3) (Closed)
Patch Set: git cl format Created 3 years, 5 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 | « webrtc/rtc_base/safe_conversions.h ('k') | webrtc/rtc_base/safe_minmax_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2017 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2017 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // If the requested type is statically guaranteed to be able to represent the 72 // If the requested type is statically guaranteed to be able to represent the
73 // result, then everything's fine, and the return type is as requested. But if 73 // result, then everything's fine, and the return type is as requested. But if
74 // the requested type is too small, a static_assert is triggered. 74 // the requested type is too small, a static_assert is triggered.
75 75
76 #ifndef WEBRTC_RTC_BASE_SAFE_MINMAX_H_ 76 #ifndef WEBRTC_RTC_BASE_SAFE_MINMAX_H_
77 #define WEBRTC_RTC_BASE_SAFE_MINMAX_H_ 77 #define WEBRTC_RTC_BASE_SAFE_MINMAX_H_
78 78
79 #include <limits> 79 #include <limits>
80 #include <type_traits> 80 #include <type_traits>
81 81
82 #include "webrtc/base/checks.h" 82 #include "webrtc/rtc_base/checks.h"
83 #include "webrtc/base/safe_compare.h" 83 #include "webrtc/rtc_base/safe_compare.h"
84 #include "webrtc/base/type_traits.h" 84 #include "webrtc/rtc_base/type_traits.h"
85 85
86 namespace rtc { 86 namespace rtc {
87 87
88 namespace safe_minmax_impl { 88 namespace safe_minmax_impl {
89 89
90 // Make the range of a type available via something other than a constexpr 90 // Make the range of a type available via something other than a constexpr
91 // function, to work around MSVC limitations. See 91 // function, to work around MSVC limitations. See
92 // https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expres sion-sfinae-in-vs-2015-update-1/ 92 // https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expres sion-sfinae-in-vs-2015-update-1/
93 template <typename T> 93 template <typename T>
94 struct Limits { 94 struct Limits {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 "The third argument must be integral or floating-point"); 326 "The third argument must be integral or floating-point");
327 RTC_DCHECK_LE(min, max); 327 RTC_DCHECK_LE(min, max);
328 return SafeLe(x, min) 328 return SafeLe(x, min)
329 ? static_cast<R2>(min) 329 ? static_cast<R2>(min)
330 : SafeGe(x, max) ? static_cast<R2>(max) : static_cast<R2>(x); 330 : SafeGe(x, max) ? static_cast<R2>(max) : static_cast<R2>(x);
331 } 331 }
332 332
333 } // namespace rtc 333 } // namespace rtc
334 334
335 #endif // WEBRTC_RTC_BASE_SAFE_MINMAX_H_ 335 #endif // WEBRTC_RTC_BASE_SAFE_MINMAX_H_
OLDNEW
« no previous file with comments | « webrtc/rtc_base/safe_conversions.h ('k') | webrtc/rtc_base/safe_minmax_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698