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

Unified Diff: webrtc/base/bitbuffer.cc

Issue 1335923002: Add RTC_ prefix to (D)CHECKs and related macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/asyncinvoker.cc ('k') | webrtc/base/checks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/bitbuffer.cc
diff --git a/webrtc/base/bitbuffer.cc b/webrtc/base/bitbuffer.cc
index cd3661343b290ae25aed1e34a04a7390643c5ead..e8f69cbce0bd02f4c724914b14903aa82ea3a589 100644
--- a/webrtc/base/bitbuffer.cc
+++ b/webrtc/base/bitbuffer.cc
@@ -19,14 +19,14 @@ namespace {
// Returns the lowest (right-most) |bit_count| bits in |byte|.
uint8_t LowestBits(uint8_t byte, size_t bit_count) {
- DCHECK_LE(bit_count, 8u);
+ RTC_DCHECK_LE(bit_count, 8u);
return byte & ((1 << bit_count) - 1);
}
// Returns the highest (left-most) |bit_count| bits in |byte|, shifted to the
// lowest bits (to the right).
uint8_t HighestBits(uint8_t byte, size_t bit_count) {
- DCHECK_LE(bit_count, 8u);
+ RTC_DCHECK_LE(bit_count, 8u);
uint8_t shift = 8 - static_cast<uint8_t>(bit_count);
uint8_t mask = 0xFF << shift;
return (byte & mask) >> shift;
@@ -44,9 +44,9 @@ uint8_t WritePartialByte(uint8_t source,
size_t source_bit_count,
uint8_t target,
size_t target_bit_offset) {
- DCHECK(target_bit_offset < 8);
- DCHECK(source_bit_count < 9);
- DCHECK(source_bit_count <= (8 - target_bit_offset));
+ RTC_DCHECK(target_bit_offset < 8);
+ RTC_DCHECK(source_bit_count < 9);
+ RTC_DCHECK(source_bit_count <= (8 - target_bit_offset));
// Generate a mask for just the bits we're going to overwrite, so:
uint8_t mask =
// The number of bits we want, in the most significant bits...
@@ -75,8 +75,8 @@ namespace rtc {
BitBuffer::BitBuffer(const uint8_t* bytes, size_t byte_count)
: bytes_(bytes), byte_count_(byte_count), byte_offset_(), bit_offset_() {
- DCHECK(static_cast<uint64_t>(byte_count_) <=
- std::numeric_limits<uint32_t>::max());
+ RTC_DCHECK(static_cast<uint64_t>(byte_count_) <=
+ std::numeric_limits<uint32_t>::max());
}
uint64_t BitBuffer::RemainingBitCount() const {
@@ -88,7 +88,7 @@ bool BitBuffer::ReadUInt8(uint8_t* val) {
if (!ReadBits(&bit_val, sizeof(uint8_t) * 8)) {
return false;
}
- DCHECK(bit_val <= std::numeric_limits<uint8_t>::max());
+ RTC_DCHECK(bit_val <= std::numeric_limits<uint8_t>::max());
*val = static_cast<uint8_t>(bit_val);
return true;
}
@@ -98,7 +98,7 @@ bool BitBuffer::ReadUInt16(uint16_t* val) {
if (!ReadBits(&bit_val, sizeof(uint16_t) * 8)) {
return false;
}
- DCHECK(bit_val <= std::numeric_limits<uint16_t>::max());
+ RTC_DCHECK(bit_val <= std::numeric_limits<uint16_t>::max());
*val = static_cast<uint16_t>(bit_val);
return true;
}
@@ -173,14 +173,14 @@ bool BitBuffer::ReadExponentialGolomb(uint32_t* val) {
}
// We should either be at the end of the stream, or the next bit should be 1.
- DCHECK(!PeekBits(&peeked_bit, 1) || peeked_bit == 1);
+ RTC_DCHECK(!PeekBits(&peeked_bit, 1) || peeked_bit == 1);
// The bit count of the value is the number of zeros + 1. Make sure that many
// bits fits in a uint32_t and that we have enough bits left for it, and then
// read the value.
size_t value_bit_count = zero_bit_count + 1;
if (value_bit_count > 32 || !ReadBits(val, value_bit_count)) {
- CHECK(Seek(original_byte_offset, original_bit_offset));
+ RTC_CHECK(Seek(original_byte_offset, original_bit_offset));
return false;
}
*val -= 1;
@@ -189,8 +189,8 @@ bool BitBuffer::ReadExponentialGolomb(uint32_t* val) {
void BitBuffer::GetCurrentOffset(
size_t* out_byte_offset, size_t* out_bit_offset) {
- CHECK(out_byte_offset != NULL);
- CHECK(out_bit_offset != NULL);
+ RTC_CHECK(out_byte_offset != NULL);
+ RTC_CHECK(out_bit_offset != NULL);
*out_byte_offset = byte_offset_;
*out_bit_offset = bit_offset_;
}
« no previous file with comments | « webrtc/base/asyncinvoker.cc ('k') | webrtc/base/checks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698