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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/byte_io.h

Issue 1506823002: [rtp_rtcp] fixed namespaces lint warnings (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years 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 | webrtc/modules/rtp_rtcp/source/fec_private_tables_bursty.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 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // According to ISO C standard ISO/IEC 9899, section 6.2.6.2 (2), the three 45 // According to ISO C standard ISO/IEC 9899, section 6.2.6.2 (2), the three
46 // representations of signed integers allowed are two's complement, one's 46 // representations of signed integers allowed are two's complement, one's
47 // complement and sign/magnitude. We can detect which is used by looking at 47 // complement and sign/magnitude. We can detect which is used by looking at
48 // the two last bits of -1, which will be 11 in two's complement, 10 in one's 48 // the two last bits of -1, which will be 11 in two's complement, 10 in one's
49 // complement and 01 in sign/magnitude. 49 // complement and 01 in sign/magnitude.
50 // TODO(sprang): In the unlikely event that we actually need to support a 50 // TODO(sprang): In the unlikely event that we actually need to support a
51 // platform that doesn't use two's complement, implement conversion to/from 51 // platform that doesn't use two's complement, implement conversion to/from
52 // wire format. 52 // wire format.
53 53
54 namespace { 54 // Assume the if any one signed integer type is two's complement, then all
55 inline void AssertTwosComplement() { 55 // other will be too.
56 // Assume the if any one signed integer type is two's complement, then all 56 static_assert(
57 // other will be too. 57 (-1 & 0x03) == 0x03,
58 static_assert( 58 "Only two's complement representation of signed integers supported.");
59 (-1 & 0x03) == 0x03, 59
60 "Only two's complement representation of signed integers supported.");
61 }
62 // Plain const char* won't work for static_assert, use #define instead. 60 // Plain const char* won't work for static_assert, use #define instead.
63 #define kSizeErrorMsg "Byte size must be less than or equal to data type size." 61 #define kSizeErrorMsg "Byte size must be less than or equal to data type size."
64 }
65 62
66 // Utility class for getting the unsigned equivalent of a signed type. 63 // Utility class for getting the unsigned equivalent of a signed type.
67 template <typename T> 64 template <typename T>
68 struct UnsignedOf; 65 struct UnsignedOf;
69 66
70 // Class for reading integers from a sequence of bytes. 67 // Class for reading integers from a sequence of bytes.
71 // T = type of integer, B = bytes to read, is_signed = true if signed integer. 68 // T = type of integer, B = bytes to read, is_signed = true if signed integer.
72 // If is_signed is true and B < sizeof(T), sign extension might be needed. 69 // If is_signed is true and B < sizeof(T), sign extension might be needed.
73 template <typename T, 70 template <typename T,
74 unsigned int B = sizeof(T), 71 unsigned int B = sizeof(T),
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 data[4] = val >> 32; 392 data[4] = val >> 32;
396 data[5] = val >> 40; 393 data[5] = val >> 40;
397 data[6] = val >> 48; 394 data[6] = val >> 48;
398 data[7] = val >> 56; 395 data[7] = val >> 56;
399 } 396 }
400 }; 397 };
401 398
402 } // namespace webrtc 399 } // namespace webrtc
403 400
404 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_BYTE_IO_H_ 401 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_BYTE_IO_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/fec_private_tables_bursty.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698