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

Side by Side Diff: webrtc/base/mod_ops.h

Issue 2247253003: Fix incorrect example in mod_ops.h (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | 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 (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 25 matching lines...) Expand all
36 return M - (sub - a); 36 return M - (sub - a);
37 return a - sub; 37 return a - sub;
38 } 38 }
39 39
40 // Calculates the forward difference between two wrapping numbers. 40 // Calculates the forward difference between two wrapping numbers.
41 // 41 //
42 // Example: 42 // Example:
43 // uint8_t x = 253; 43 // uint8_t x = 253;
44 // uint8_t y = 2; 44 // uint8_t y = 2;
45 // 45 //
46 // ForwardDiff(x, y) == 4 46 // ForwardDiff(x, y) == 5
47 // 47 //
48 // 252 253 254 255 0 1 2 3 48 // 252 253 254 255 0 1 2 3
49 // ################################################# 49 // #################################################
50 // | | x | | | | | y | | 50 // | | x | | | | | y | |
51 // ################################################# 51 // #################################################
52 // |----->----->----->----->-----> 52 // |----->----->----->----->----->
53 // 53 //
54 // ForwardDiff(y, x) == 251 54 // ForwardDiff(y, x) == 251
55 // 55 //
56 // 252 253 254 255 0 1 2 3 56 // 252 253 254 255 0 1 2 3
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 template <typename T> 126 template <typename T>
127 inline T MinDiff(T a, T b) { 127 inline T MinDiff(T a, T b) {
128 static_assert(std::is_unsigned<T>::value, 128 static_assert(std::is_unsigned<T>::value,
129 "Type must be an unsigned integer."); 129 "Type must be an unsigned integer.");
130 return std::min(ForwardDiff(a, b), ReverseDiff(a, b)); 130 return std::min(ForwardDiff(a, b), ReverseDiff(a, b));
131 } 131 }
132 132
133 } // namespace webrtc 133 } // namespace webrtc
134 134
135 #endif // WEBRTC_BASE_MOD_OPS_H_ 135 #endif // WEBRTC_BASE_MOD_OPS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698