RTC_[D]CHECK_op: Remove "u" suffix on integer constants

There's no longer any need to make the two arguments have the same
signedness, so we can drop the "u" suffix on literal integer
arguments.

NOPRESUBMIT=true
BUG=webrtc:6645

Review-Url: https://codereview.webrtc.org/2535593002
Cr-Commit-Position: refs/heads/master@{#15280}
This commit is contained in:
kwiberg 2016-11-28 15:21:39 -08:00 committed by Commit bot
parent 80ed35e21c
commit af476c737f
89 changed files with 167 additions and 167 deletions

View File

@ -68,8 +68,8 @@ int32_t AudioTransportProxy::NeedMorePlayData(const size_t nSamples,
int64_t* elapsed_time_ms,
int64_t* ntp_time_ms) {
RTC_DCHECK_EQ(sizeof(int16_t) * nChannels, nBytesPerSample);
RTC_DCHECK_GE(nChannels, 1u);
RTC_DCHECK_LE(nChannels, 2u);
RTC_DCHECK_GE(nChannels, 1);
RTC_DCHECK_LE(nChannels, 2);
RTC_DCHECK_GE(
samplesPerSec,
static_cast<uint32_t>(AudioProcessing::NativeRate::kSampleRate8kHz));
@ -111,8 +111,8 @@ void AudioTransportProxy::PullRenderData(int bits_per_sample,
int64_t* elapsed_time_ms,
int64_t* ntp_time_ms) {
RTC_DCHECK_EQ(static_cast<size_t>(bits_per_sample), 16);
RTC_DCHECK_GE(number_of_channels, 1u);
RTC_DCHECK_LE(number_of_channels, 2u);
RTC_DCHECK_GE(number_of_channels, 1);
RTC_DCHECK_LE(number_of_channels, 2);
RTC_DCHECK_GE(static_cast<int>(sample_rate),
AudioProcessing::NativeRate::kSampleRate8kHz);

View File

@ -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) {
RTC_DCHECK_LE(bit_count, 8u);
RTC_DCHECK_LE(bit_count, 8);
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) {
RTC_DCHECK_LE(bit_count, 8u);
RTC_DCHECK_LE(bit_count, 8);
uint8_t shift = 8 - static_cast<uint8_t>(bit_count);
uint8_t mask = 0xFF << shift;
return (byte & mask) >> shift;

View File

@ -37,8 +37,8 @@ FileRotatingStream::FileRotatingStream(const std::string& dir_path,
max_file_size,
num_files,
kWrite) {
RTC_DCHECK_GT(max_file_size, 0u);
RTC_DCHECK_GT(num_files, 1u);
RTC_DCHECK_GT(max_file_size, 0);
RTC_DCHECK_GT(num_files, 1);
}
FileRotatingStream::FileRotatingStream(const std::string& dir_path,
@ -248,7 +248,7 @@ bool FileRotatingStream::OpenCurrentFile() {
case kWrite:
mode = "w+";
// We should always we writing to the zero-th file.
RTC_DCHECK_EQ(current_file_index_, 0u);
RTC_DCHECK_EQ(current_file_index_, 0);
break;
case kRead:
mode = "r";
@ -360,7 +360,7 @@ CallSessionFileRotatingStream::CallSessionFileRotatingStream(
GetNumRotatingLogFiles(max_total_log_size) + 1),
max_total_log_size_(max_total_log_size),
num_rotations_(0) {
RTC_DCHECK_GE(max_total_log_size, 4u);
RTC_DCHECK_GE(max_total_log_size, 4);
}
const char* CallSessionFileRotatingStream::kLogPrefix = "webrtc_log";

View File

@ -258,7 +258,7 @@ int FlagList::SetFlagsFromCommandLine(int* argc, const char** argv,
void FlagList::Register(Flag* flag) {
RTC_DCHECK(flag);
RTC_DCHECK_GT(strlen(flag->name()), 0u);
RTC_DCHECK_GT(strlen(flag->name()), 0);
// NOTE: Don't call Lookup() within Register because it accesses the name_
// of other flags in list_, and if the flags are coming from two different
// compilation units, the initialization order between them is undefined, and

View File

@ -36,7 +36,7 @@ const int64_t kBweLogIntervalMs = 5000;
namespace {
double MediaRatio(uint32_t allocated_bitrate, uint32_t protection_bitrate) {
RTC_DCHECK_GT(allocated_bitrate, 0u);
RTC_DCHECK_GT(allocated_bitrate, 0);
if (protection_bitrate == 0)
return 1.0;
@ -382,7 +382,7 @@ void BitrateAllocator::DistributeBitrateEvenly(uint32_t bitrate,
}
auto it = list_max_bitrates.begin();
while (it != list_max_bitrates.end()) {
RTC_DCHECK_GT(bitrate, 0u);
RTC_DCHECK_GT(bitrate, 0);
uint32_t extra_allocation =
bitrate / static_cast<uint32_t>(list_max_bitrates.size());
uint32_t total_allocation =

View File

@ -166,7 +166,7 @@ class BitrateEstimatorTest : public test::CallTest {
send_stream_ = test_->sender_call_->CreateVideoSendStream(
test_->video_send_config_.Copy(),
test_->video_encoder_config_.Copy());
RTC_DCHECK_EQ(1u, test_->video_encoder_config_.number_of_streams);
RTC_DCHECK_EQ(1, test_->video_encoder_config_.number_of_streams);
frame_generator_capturer_.reset(test::FrameGeneratorCapturer::Create(
kDefaultWidth, kDefaultHeight, kDefaultFramerate,
Clock::GetRealTimeClock()));

View File

@ -549,7 +549,7 @@ void CallPerfTest::TestMinTransmitBitrate(bool pad_to_min_bitrate) {
Action OnSendRtp(const uint8_t* packet, size_t length) override {
VideoSendStream::Stats stats = send_stream_->GetStats();
if (stats.substreams.size() > 0) {
RTC_DCHECK_EQ(1u, stats.substreams.size());
RTC_DCHECK_EQ(1, stats.substreams.size());
int bitrate_kbps =
stats.substreams.begin()->second.total_bitrate_bps / 1000;
if (bitrate_kbps > min_acceptable_bitrate_ &&

View File

@ -109,7 +109,7 @@ class CompositionConverter : public AudioConverter {
public:
CompositionConverter(std::vector<std::unique_ptr<AudioConverter>> converters)
: converters_(std::move(converters)) {
RTC_CHECK_GE(converters_.size(), 2u);
RTC_CHECK_GE(converters_.size(), 2);
// We need an intermediate buffer after every converter.
for (auto it = converters_.begin(); it != converters_.end() - 1; ++it)
buffers_.push_back(

View File

@ -94,7 +94,7 @@ class ChannelBuffer {
// 0 <= sample < |num_frames_per_band_|
const T* const* bands(size_t channel) const {
RTC_DCHECK_LT(channel, num_channels_);
RTC_DCHECK_GE(channel, 0u);
RTC_DCHECK_GE(channel, 0);
return &bands_[channel * num_bands_];
}
T* const* bands(size_t channel) {

View File

@ -154,7 +154,7 @@ void DownmixInterleavedToMonoImpl(const T* interleaved,
int num_channels,
T* deinterleaved) {
RTC_DCHECK_GT(num_channels, 0);
RTC_DCHECK_GT(num_frames, 0u);
RTC_DCHECK_GT(num_frames, 0);
const T* const end = interleaved + num_frames * num_channels;

View File

@ -84,12 +84,12 @@ LappedTransform::LappedTransform(size_t num_in_channels,
cplx_length_,
RealFourier::kFftBufferAlignment) {
RTC_CHECK(num_in_channels_ > 0);
RTC_CHECK_GT(block_length_, 0u);
RTC_CHECK_GT(chunk_length_, 0u);
RTC_CHECK_GT(block_length_, 0);
RTC_CHECK_GT(chunk_length_, 0);
RTC_CHECK(block_processor_);
// block_length_ power of 2?
RTC_CHECK_EQ(0u, block_length_ & (block_length_ - 1));
RTC_CHECK_EQ(0, block_length_ & (block_length_ - 1));
}
LappedTransform::~LappedTransform() = default;

View File

@ -32,8 +32,8 @@ void CheckValidInitParams(int src_sample_rate_hz, int dst_sample_rate_hz,
#if !defined(WEBRTC_WIN) && defined(__clang__)
RTC_DCHECK_GT(src_sample_rate_hz, 0);
RTC_DCHECK_GT(dst_sample_rate_hz, 0);
RTC_DCHECK_GT(num_channels, 0u);
RTC_DCHECK_LE(num_channels, 2u);
RTC_DCHECK_GT(num_channels, 0);
RTC_DCHECK_LE(num_channels, 2);
#endif
}

View File

@ -22,8 +22,8 @@ SparseFIRFilter::SparseFIRFilter(const float* nonzero_coeffs,
offset_(offset),
nonzero_coeffs_(nonzero_coeffs, nonzero_coeffs + num_nonzero_coeffs),
state_(sparsity_ * (num_nonzero_coeffs - 1) + offset_, 0.f) {
RTC_CHECK_GE(num_nonzero_coeffs, 1u);
RTC_CHECK_GE(sparsity, 1u);
RTC_CHECK_GE(num_nonzero_coeffs, 1);
RTC_CHECK_GE(sparsity, 1);
}
SparseFIRFilter::~SparseFIRFilter() = default;

View File

@ -123,7 +123,7 @@ WavWriter::WavWriter(const std::string& filename, int sample_rate,
// Write a blank placeholder header, since we need to know the total number
// of samples before we can fill in the real data.
static const uint8_t blank_header[kWavHeaderSize] = {0};
RTC_CHECK_EQ(1u, fwrite(blank_header, kWavHeaderSize, 1, file_handle_));
RTC_CHECK_EQ(1, fwrite(blank_header, kWavHeaderSize, 1, file_handle_));
}
WavWriter::~WavWriter() {
@ -168,7 +168,7 @@ void WavWriter::Close() {
uint8_t header[kWavHeaderSize];
WriteWavHeader(header, num_channels_, sample_rate_, kWavFormat,
kBytesPerSample, num_samples_);
RTC_CHECK_EQ(1u, fwrite(header, kWavHeaderSize, 1, file_handle_));
RTC_CHECK_EQ(1, fwrite(header, kWavHeaderSize, 1, file_handle_));
RTC_CHECK_EQ(0, fclose(file_handle_));
file_handle_ = NULL;
}

View File

@ -1780,7 +1780,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodec(
const VideoCodecSettings& codec_settings) {
RTC_DCHECK_RUN_ON(&thread_checker_);
parameters_.encoder_config = CreateVideoEncoderConfig(codec_settings.codec);
RTC_DCHECK_GT(parameters_.encoder_config.number_of_streams, 0u);
RTC_DCHECK_GT(parameters_.encoder_config.number_of_streams, 0);
AllocatedEncoder new_encoder = CreateVideoEncoder(codec_settings.codec);
parameters_.config.encoder_settings.encoder = new_encoder.encoder;
@ -1961,7 +1961,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() {
return;
}
RTC_DCHECK_GT(parameters_.encoder_config.number_of_streams, 0u);
RTC_DCHECK_GT(parameters_.encoder_config.number_of_streams, 0);
RTC_CHECK(parameters_.codec_settings);
VideoCodecSettings codec_settings = *parameters_.codec_settings;

View File

@ -536,7 +536,7 @@ int32_t AudioCodingModuleImpl::Encode(const InputData& input_data) {
frame_type = kEmptyFrame;
encoded_info.payload_type = previous_pltype;
} else {
RTC_DCHECK_GT(encode_buffer_.size(), 0u);
RTC_DCHECK_GT(encode_buffer_.size(), 0);
frame_type = encoded_info.speech ? kAudioFrameSpeech : kAudioFrameCN;
}

View File

@ -211,7 +211,7 @@ bool CodecManager::MakeEncoder(RentACodec* rac, AudioCodingModule* acm) {
if (sub_enc.empty()) {
break;
}
RTC_CHECK_EQ(1u, sub_enc.size());
RTC_CHECK_EQ(1, sub_enc.size());
// Replace enc with its sub encoder. We need to put the sub encoder in
// a temporary first, since otherwise the old value of enc would be

View File

@ -240,9 +240,9 @@ AudioEncoder::EncodedInfo AudioEncoderCng::EncodeActive(
samples_per_10ms_frame),
encoded);
if (i + 1 == frames_to_encode) {
RTC_CHECK_GT(info.encoded_bytes, 0u) << "Encoder didn't deliver data.";
RTC_CHECK_GT(info.encoded_bytes, 0) << "Encoder didn't deliver data.";
} else {
RTC_CHECK_EQ(info.encoded_bytes, 0u)
RTC_CHECK_EQ(info.encoded_bytes, 0)
<< "Encoder delivered data too early.";
}
}

View File

@ -20,7 +20,7 @@ namespace webrtc {
class AudioDecoderPcmU final : public AudioDecoder {
public:
explicit AudioDecoderPcmU(size_t num_channels) : num_channels_(num_channels) {
RTC_DCHECK_GE(num_channels, 1u);
RTC_DCHECK_GE(num_channels, 1);
}
void Reset() override;
std::vector<ParseResult> ParsePayload(rtc::Buffer&& payload,
@ -44,7 +44,7 @@ class AudioDecoderPcmU final : public AudioDecoder {
class AudioDecoderPcmA final : public AudioDecoder {
public:
explicit AudioDecoderPcmA(size_t num_channels) : num_channels_(num_channels) {
RTC_DCHECK_GE(num_channels, 1u);
RTC_DCHECK_GE(num_channels, 1);
}
void Reset() override;
std::vector<ParseResult> ParsePayload(rtc::Buffer&& payload,

View File

@ -76,7 +76,7 @@ std::vector<AudioDecoder::ParseResult> AudioDecoderIlbc::ParsePayload(
return results;
}
RTC_DCHECK_EQ(0u, payload.size() % bytes_per_frame);
RTC_DCHECK_EQ(0, payload.size() % bytes_per_frame);
if (payload.size() == bytes_per_frame) {
std::unique_ptr<EncodedAudioFrame> frame(
new LegacyEncodedAudioFrame(this, std::move(payload)));

View File

@ -452,7 +452,7 @@ void AudioEncoderOpus::SetFrameLength(int frame_length_ms) {
}
void AudioEncoderOpus::SetNumChannelsToEncode(size_t num_channels_to_encode) {
RTC_DCHECK_GT(num_channels_to_encode, 0u);
RTC_DCHECK_GT(num_channels_to_encode, 0);
RTC_DCHECK_LE(num_channels_to_encode, config_.num_channels);
if (num_channels_to_encode_ == num_channels_to_encode)

View File

@ -180,7 +180,7 @@ namespace {
// Returns a vector with the n evenly-spaced numbers a, a + (b - a)/(n - 1),
// ..., b.
std::vector<double> IntervalSteps(double a, double b, size_t n) {
RTC_DCHECK_GT(n, 1u);
RTC_DCHECK_GT(n, 1);
const double step = (b - a) / (n - 1);
std::vector<double> points;
for (size_t i = 0; i < n; ++i)

View File

@ -21,7 +21,7 @@ AudioDecoderPcm16B::AudioDecoderPcm16B(int sample_rate_hz, size_t num_channels)
RTC_DCHECK(sample_rate_hz == 8000 || sample_rate_hz == 16000 ||
sample_rate_hz == 32000 || sample_rate_hz == 48000)
<< "Unsupported sample rate " << sample_rate_hz;
RTC_DCHECK_GE(num_channels, 1u);
RTC_DCHECK_GE(num_channels, 1);
}
void AudioDecoderPcm16B::Reset() {}

View File

@ -71,11 +71,11 @@ AudioEncoder::EncodedInfo AudioEncoderCopyRed::EncodeImpl(
// discarding the (empty) vector of redundant information. This is
// intentional.
info.redundant.push_back(info);
RTC_DCHECK_EQ(info.redundant.size(), 1u);
RTC_DCHECK_EQ(info.redundant.size(), 1);
if (secondary_info_.encoded_bytes > 0) {
encoded->AppendData(secondary_encoded_);
info.redundant.push_back(secondary_info_);
RTC_DCHECK_EQ(info.redundant.size(), 2u);
RTC_DCHECK_EQ(info.redundant.size(), 2);
}
// Save primary to secondary.
secondary_encoded_.SetData(encoded->data() + primary_offset,

View File

@ -66,7 +66,7 @@ uint64_t DelayPeakDetector::MaxPeakPeriod() const {
if (max_period_element == peak_history_.end()) {
return 0; // |peak_history_| is empty.
}
RTC_DCHECK_GT(max_period_element->period_ms, 0u);
RTC_DCHECK_GT(max_period_element->period_ms, 0);
return max_period_element->period_ms;
}

View File

@ -196,7 +196,7 @@ void NackTracker::Reset() {
}
void NackTracker::SetMaxNackListSize(size_t max_nack_list_size) {
RTC_CHECK_GT(max_nack_list_size, 0u);
RTC_CHECK_GT(max_nack_list_size, 0);
// Ugly hack to get around the problem of passing static consts by reference.
const size_t kNackListSizeLimitLocal = NackTracker::kNackListSizeLimit;
RTC_CHECK_LE(max_nack_list_size, kNackListSizeLimitLocal);

View File

@ -1724,7 +1724,7 @@ size_t NetEQTest_encode(webrtc::NetEqDecoder coder,
#ifdef CODEC_OPUS
cdlen = WebRtcOpus_Encode(opus_inst[k], indata, frameLen, kRtpDataSize - 12,
encoded);
RTC_CHECK_GT(cdlen, 0u);
RTC_CHECK_GT(cdlen, 0);
#endif
indata += frameLen;
encoded += cdlen;

View File

@ -59,7 +59,7 @@ void EncodeNetEqInput::CreatePacket() {
// Create a new PacketData object.
RTC_DCHECK(!packet_data_);
packet_data_.reset(new NetEqInput::PacketData);
RTC_DCHECK_EQ(packet_data_->payload.size(), 0u);
RTC_DCHECK_EQ(packet_data_->payload.size(), 0);
// Loop until we get a packet.
AudioEncoder::EncodedInfo info;

View File

@ -26,13 +26,13 @@ int FakeDecodeFromFile::DecodeInternal(const uint8_t* encoded,
// Decoder is asked to produce codec-internal comfort noise.
RTC_DCHECK(!encoded); // NetEq always sends nullptr in this case.
RTC_DCHECK(cng_mode_);
RTC_DCHECK_GT(last_decoded_length_, 0u);
RTC_DCHECK_GT(last_decoded_length_, 0);
std::fill_n(decoded, last_decoded_length_, 0);
*speech_type = kComfortNoise;
return last_decoded_length_;
}
RTC_CHECK_GE(encoded_len, 12u);
RTC_CHECK_GE(encoded_len, 12);
uint32_t timestamp_to_decode =
ByteReader<uint32_t>::ReadLittleEndian(encoded);
uint32_t samples_to_decode =
@ -66,7 +66,7 @@ int FakeDecodeFromFile::DecodeInternal(const uint8_t* encoded,
ByteReader<uint32_t>::ReadLittleEndian(&encoded[8]);
if (original_payload_size_bytes == 1) {
// This is a comfort noise payload.
RTC_DCHECK_GT(last_decoded_length_, 0u);
RTC_DCHECK_GT(last_decoded_length_, 0);
std::fill_n(decoded, last_decoded_length_, 0);
*speech_type = kComfortNoise;
cng_mode_ = true;
@ -90,7 +90,7 @@ void FakeDecodeFromFile::PrepareEncoded(uint32_t timestamp,
size_t samples,
size_t original_payload_size_bytes,
rtc::ArrayView<uint8_t> encoded) {
RTC_CHECK_GE(encoded.size(), 12u);
RTC_CHECK_GE(encoded.size(), 12);
ByteWriter<uint32_t>::WriteLittleEndian(&encoded[0], timestamp);
ByteWriter<uint32_t>::WriteLittleEndian(&encoded[4],
rtc::checked_cast<uint32_t>(samples));

View File

@ -70,7 +70,7 @@ void NetEqReplacementInput::ReplacePacket() {
RTC_DCHECK(packet_);
RTC_CHECK_EQ(forbidden_types_.count(packet_->header.header.payloadType), 0u)
RTC_CHECK_EQ(forbidden_types_.count(packet_->header.header.payloadType), 0)
<< "Payload type " << static_cast<int>(packet_->header.header.payloadType)
<< " is forbidden.";

View File

@ -145,8 +145,8 @@ int OpenSLESPlayer::StopPlayout() {
// Verify that the buffer queue is in fact cleared as it should.
SLAndroidSimpleBufferQueueState buffer_queue_state;
(*simple_buffer_queue_)->GetState(simple_buffer_queue_, &buffer_queue_state);
RTC_DCHECK_EQ(0u, buffer_queue_state.count);
RTC_DCHECK_EQ(0u, buffer_queue_state.index);
RTC_DCHECK_EQ(0, buffer_queue_state.count);
RTC_DCHECK_EQ(0, buffer_queue_state.index);
#endif
// The number of lower latency audio players is limited, hence we create the
// audio player in Start() and destroy it in Stop().

View File

@ -409,7 +409,7 @@ int32_t AudioDeviceBuffer::RequestPlayoutData(size_t samples_per_channel) {
int32_t AudioDeviceBuffer::GetPlayoutData(void* audio_buffer) {
RTC_DCHECK_RUN_ON(&playout_thread_checker_);
RTC_DCHECK_GT(play_buffer_.size(), 0u);
RTC_DCHECK_GT(play_buffer_.size(), 0);
const size_t bytes_per_sample = sizeof(int16_t);
memcpy(audio_buffer, play_buffer_.data(),
play_buffer_.size() * bytes_per_sample);

View File

@ -407,9 +407,9 @@ OSStatus AudioDeviceIOS::OnGetPlayoutData(AudioUnitRenderActionFlags* flags,
UInt32 num_frames,
AudioBufferList* io_data) {
// Verify 16-bit, noninterleaved mono PCM signal format.
RTC_DCHECK_EQ(1u, io_data->mNumberBuffers);
RTC_DCHECK_EQ(1, io_data->mNumberBuffers);
AudioBuffer* audio_buffer = &io_data->mBuffers[0];
RTC_DCHECK_EQ(1u, audio_buffer->mNumberChannels);
RTC_DCHECK_EQ(1, audio_buffer->mNumberChannels);
// Get pointer to internal audio buffer to which new audio data shall be
// written.
const size_t size_in_bytes = audio_buffer->mDataByteSize;

View File

@ -31,7 +31,7 @@ void Ramp(float start_gain, float target_gain, AudioFrame* audio_frame) {
RTC_DCHECK_GE(target_gain, 0.0f);
size_t samples = audio_frame->samples_per_channel_;
RTC_DCHECK_LT(0u, samples);
RTC_DCHECK_LT(0, samples);
float increment = (target_gain - start_gain) / samples;
float gain = start_gain;
for (size_t i = 0; i < samples; ++i) {
@ -45,8 +45,8 @@ void Ramp(float start_gain, float target_gain, AudioFrame* audio_frame) {
}
void RemixFrame(size_t target_number_of_channels, AudioFrame* frame) {
RTC_DCHECK_GE(target_number_of_channels, 1u);
RTC_DCHECK_LE(target_number_of_channels, 2u);
RTC_DCHECK_GE(target_number_of_channels, 1);
RTC_DCHECK_LE(target_number_of_channels, 2);
if (frame->num_channels_ == 1 && target_number_of_channels == 2) {
AudioFrameOperations::MonoToStereo(frame);
} else if (frame->num_channels_ == 2 && target_number_of_channels == 1) {

View File

@ -202,7 +202,7 @@ void BlockBuffer::Insert(const float block[PART_LEN]) {
void BlockBuffer::ExtractExtendedBlock(float extended_block[PART_LEN2]) {
float* block_ptr = NULL;
RTC_DCHECK_LT(0u, AvaliableSpace());
RTC_DCHECK_LT(0, AvaliableSpace());
// Extract the previous block.
WebRtc_MoveReadPtr(buffer_, -1);
@ -461,7 +461,7 @@ static void UpdateLogRatioMetric(Stats* metric, float numerator,
// Average.
metric->counter++;
// This is to protect overflow, which should almost never happen.
RTC_CHECK_NE(0u, metric->counter);
RTC_CHECK_NE(0, metric->counter);
metric->sum += metric->instant;
metric->average = metric->sum / metric->counter;
@ -469,7 +469,7 @@ static void UpdateLogRatioMetric(Stats* metric, float numerator,
if (metric->instant > metric->average) {
metric->hicounter++;
// This is to protect overflow, which should almost never happen.
RTC_CHECK_NE(0u, metric->hicounter);
RTC_CHECK_NE(0, metric->hicounter);
metric->hisum += metric->instant;
metric->himean = metric->hisum / metric->hicounter;
}

View File

@ -74,7 +74,7 @@ void WebRtcAec_ResampleLinear(void* resampInst,
float be, tnew;
size_t tn, mm;
RTC_DCHECK_LE(size, 2u * FRAME_LEN);
RTC_DCHECK_LE(size, 2 * FRAME_LEN);
RTC_DCHECK(resampInst);
RTC_DCHECK(inspeech);
RTC_DCHECK(outspeech);

View File

@ -104,9 +104,9 @@ void WebRtcAecm_CalcLinearEnergiesNeon(AecmCore* aecm,
void WebRtcAecm_StoreAdaptiveChannelNeon(AecmCore* aecm,
const uint16_t* far_spectrum,
int32_t* echo_est) {
RTC_DCHECK_EQ(0u, (uintptr_t)echo_est % 32);
RTC_DCHECK_EQ(0u, (uintptr_t)aecm->channelStored % 16);
RTC_DCHECK_EQ(0u, (uintptr_t)aecm->channelAdapt16 % 16);
RTC_DCHECK_EQ(0, (uintptr_t)echo_est % 32);
RTC_DCHECK_EQ(0, (uintptr_t)aecm->channelStored % 16);
RTC_DCHECK_EQ(0, (uintptr_t)aecm->channelAdapt16 % 16);
// This is C code of following optimized code.
// During startup we store the channel every block.
@ -161,9 +161,9 @@ void WebRtcAecm_StoreAdaptiveChannelNeon(AecmCore* aecm,
}
void WebRtcAecm_ResetAdaptiveChannelNeon(AecmCore* aecm) {
RTC_DCHECK_EQ(0u, (uintptr_t)aecm->channelStored % 16);
RTC_DCHECK_EQ(0u, (uintptr_t)aecm->channelAdapt16 % 16);
RTC_DCHECK_EQ(0u, (uintptr_t)aecm->channelAdapt32 % 32);
RTC_DCHECK_EQ(0, (uintptr_t)aecm->channelStored % 16);
RTC_DCHECK_EQ(0, (uintptr_t)aecm->channelAdapt16 % 16);
RTC_DCHECK_EQ(0, (uintptr_t)aecm->channelAdapt32 % 32);
// The C code of following optimized code.
// for (i = 0; i < PART_LEN1; i++) {

View File

@ -39,7 +39,7 @@ Agc::Agc()
Agc::~Agc() {}
float Agc::AnalyzePreproc(const int16_t* audio, size_t length) {
RTC_DCHECK_GT(length, 0u);
RTC_DCHECK_GT(length, 0);
size_t num_clipped = 0;
for (size_t i = 0; i < length; ++i) {
if (audio[i] == 32767 || audio[i] == -32768)

View File

@ -62,11 +62,11 @@ AudioBuffer::AudioBuffer(size_t input_num_frames,
activity_(AudioFrame::kVadUnknown),
keyboard_data_(NULL),
data_(new IFChannelBuffer(proc_num_frames_, num_proc_channels_)) {
RTC_DCHECK_GT(input_num_frames_, 0u);
RTC_DCHECK_GT(proc_num_frames_, 0u);
RTC_DCHECK_GT(output_num_frames_, 0u);
RTC_DCHECK_GT(num_input_channels_, 0u);
RTC_DCHECK_GT(num_proc_channels_, 0u);
RTC_DCHECK_GT(input_num_frames_, 0);
RTC_DCHECK_GT(proc_num_frames_, 0);
RTC_DCHECK_GT(output_num_frames_, 0);
RTC_DCHECK_GT(num_input_channels_, 0);
RTC_DCHECK_GT(num_proc_channels_, 0);
RTC_DCHECK_LE(num_proc_channels_, num_input_channels_);
if (input_num_frames_ != proc_num_frames_ ||

View File

@ -813,7 +813,7 @@ void AudioProcessingImpl::QueueRenderAudio(AudioBuffer* audio) {
num_reverse_channels(),
&aec_render_queue_buffer_);
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
// Insert the samples into the queue.
if (!aec_render_signal_queue_->Insert(&aec_render_queue_buffer_)) {

View File

@ -23,7 +23,7 @@ const float kMaxDotProduct = 1e-6f;
} // namespace
float GetMinimumSpacing(const std::vector<Point>& array_geometry) {
RTC_CHECK_GT(array_geometry.size(), 1u);
RTC_CHECK_GT(array_geometry.size(), 1);
float mic_spacing = std::numeric_limits<float>::max();
for (size_t i = 0; i < (array_geometry.size() - 1); ++i) {
for (size_t j = i + 1; j < array_geometry.size(); ++j) {
@ -58,7 +58,7 @@ bool ArePerpendicular(const Point& a, const Point& b) {
rtc::Optional<Point> GetDirectionIfLinear(
const std::vector<Point>& array_geometry) {
RTC_DCHECK_GT(array_geometry.size(), 1u);
RTC_DCHECK_GT(array_geometry.size(), 1);
const Point first_pair_direction =
PairDirection(array_geometry[0], array_geometry[1]);
for (size_t i = 2u; i < array_geometry.size(); ++i) {
@ -73,7 +73,7 @@ rtc::Optional<Point> GetDirectionIfLinear(
rtc::Optional<Point> GetNormalIfPlanar(
const std::vector<Point>& array_geometry) {
RTC_DCHECK_GT(array_geometry.size(), 1u);
RTC_DCHECK_GT(array_geometry.size(), 1);
const Point first_pair_direction =
PairDirection(array_geometry[0], array_geometry[1]);
Point pair_direction(0.f, 0.f, 0.f);

View File

@ -27,7 +27,7 @@ float BesselJ0(float x) {
// Calculates the Euclidean norm for a row vector.
float Norm(const ComplexMatrix<float>& x) {
RTC_CHECK_EQ(1u, x.num_rows());
RTC_CHECK_EQ(1, x.num_rows());
const size_t length = x.num_columns();
const complex<float>* elems = x.elements()[0];
float result = 0.f;
@ -94,7 +94,7 @@ void CovarianceMatrixGenerator::PhaseAlignmentMasks(
const std::vector<Point>& geometry,
float angle,
ComplexMatrix<float>* mat) {
RTC_CHECK_EQ(1u, mat->num_rows());
RTC_CHECK_EQ(1, mat->num_rows());
RTC_CHECK_EQ(geometry.size(), mat->num_columns());
float freq_in_hertz =

View File

@ -79,7 +79,7 @@ const float kCompensationGain = 2.f;
// The returned norm is clamped to be non-negative.
float Norm(const ComplexMatrix<float>& mat,
const ComplexMatrix<float>& norm_mat) {
RTC_CHECK_EQ(1u, norm_mat.num_rows());
RTC_CHECK_EQ(1, norm_mat.num_rows());
RTC_CHECK_EQ(norm_mat.num_columns(), mat.num_rows());
RTC_CHECK_EQ(norm_mat.num_columns(), mat.num_columns());
@ -102,8 +102,8 @@ float Norm(const ComplexMatrix<float>& mat,
// Does conjugate(|lhs|) * |rhs| for row vectors |lhs| and |rhs|.
complex<float> ConjugateDotProduct(const ComplexMatrix<float>& lhs,
const ComplexMatrix<float>& rhs) {
RTC_CHECK_EQ(1u, lhs.num_rows());
RTC_CHECK_EQ(1u, rhs.num_rows());
RTC_CHECK_EQ(1, lhs.num_rows());
RTC_CHECK_EQ(1, rhs.num_rows());
RTC_CHECK_EQ(lhs.num_columns(), rhs.num_columns());
const complex<float>* const* lhs_elements = lhs.elements();
@ -138,7 +138,7 @@ float SumSquares(const ComplexMatrix<float>& mat) {
// Does |out| = |in|.' * conj(|in|) for row vector |in|.
void TransposedConjugatedProduct(const ComplexMatrix<float>& in,
ComplexMatrix<float>* out) {
RTC_CHECK_EQ(1u, in.num_rows());
RTC_CHECK_EQ(1, in.num_rows());
RTC_CHECK_EQ(out->num_rows(), in.num_columns());
RTC_CHECK_EQ(out->num_columns(), in.num_columns());
const complex<float>* in_elements = in.elements()[0];
@ -449,7 +449,7 @@ void NonlinearBeamformer::ProcessAudioBlock(const complex_f* const* input,
complex_f* const* output) {
RTC_CHECK_EQ(kNumFreqBins, num_freq_bins);
RTC_CHECK_EQ(num_input_channels_, num_input_channels);
RTC_CHECK_EQ(0u, num_output_channels);
RTC_CHECK_EQ(0, num_output_channels);
// Calculating the post-filter masks. Note that we need two for each
// frequency bin to account for the positive and negative interferer

View File

@ -151,7 +151,7 @@ int EchoCancellationImpl::ProcessCaptureAudio(AudioBuffer* audio,
}
RTC_DCHECK(stream_properties_);
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(audio->num_channels(), stream_properties_->num_proc_channels);
int err = AudioProcessing::kNoError;
@ -450,7 +450,7 @@ void EchoCancellationImpl::PackRenderAudioBuffer(
size_t num_output_channels,
size_t num_channels,
std::vector<float>* packed_buffer) {
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(num_channels, audio->num_channels());
packed_buffer->clear();

View File

@ -154,7 +154,7 @@ void EchoControlMobileImpl::PackRenderAudioBuffer(
size_t num_output_channels,
size_t num_channels,
std::vector<int16_t>* packed_buffer) {
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(num_channels, audio->num_channels());
// The ordering convention must be followed to pass to the correct AECM.
@ -187,7 +187,7 @@ int EchoControlMobileImpl::ProcessCaptureAudio(AudioBuffer* audio,
}
RTC_DCHECK(stream_properties_);
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(audio->num_channels(), stream_properties_->num_output_channels);
RTC_DCHECK_GE(cancellers_.size(), stream_properties_->num_reverse_channels *
audio->num_channels());

View File

@ -123,7 +123,7 @@ void GainControlImpl::ProcessRenderAudio(
void GainControlImpl::PackRenderAudioBuffer(
AudioBuffer* audio,
std::vector<int16_t>* packed_buffer) {
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
packed_buffer->clear();
packed_buffer->insert(
@ -139,7 +139,7 @@ int GainControlImpl::AnalyzeCaptureAudio(AudioBuffer* audio) {
}
RTC_DCHECK(num_proc_channels_);
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(audio->num_channels(), *num_proc_channels_);
RTC_DCHECK_LE(*num_proc_channels_, gain_controllers_.size());
@ -190,7 +190,7 @@ int GainControlImpl::ProcessCaptureAudio(AudioBuffer* audio,
}
RTC_DCHECK(num_proc_channels_);
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(audio->num_channels(), *num_proc_channels_);
stream_is_saturated_ = false;

View File

@ -58,7 +58,7 @@ void MapToErbBands(const float* pow,
const std::vector<std::vector<float>>& filter_bank,
float* result) {
for (size_t i = 0; i < filter_bank.size(); ++i) {
RTC_DCHECK_GT(filter_bank[i].size(), 0u);
RTC_DCHECK_GT(filter_bank[i].size(), 0);
result[i] = kPowerNormalizationFactor *
DotProduct(filter_bank[i].data(), pow, filter_bank[i].size());
}
@ -380,7 +380,7 @@ bool IntelligibilityEnhancer::IsSpeech(const float* audio) {
}
void IntelligibilityEnhancer::DelayHighBands(AudioBuffer* audio) {
RTC_DCHECK_EQ(audio->num_bands(), high_bands_buffers_.size() + 1u);
RTC_DCHECK_EQ(audio->num_bands(), high_bands_buffers_.size() + 1);
for (size_t i = 0u; i < high_bands_buffers_.size(); ++i) {
Band band = static_cast<Band>(i + 1);
high_bands_buffers_[i]->Delay(audio->split_channels_f(band), chunk_length_);

View File

@ -208,8 +208,8 @@ void LevelController::Initialize(int sample_rate_hz) {
}
void LevelController::Process(AudioBuffer* audio) {
RTC_DCHECK_LT(0u, audio->num_channels());
RTC_DCHECK_GE(2u, audio->num_channels());
RTC_DCHECK_LT(0, audio->num_channels());
RTC_DCHECK_GE(2, audio->num_channels());
RTC_DCHECK_NE(0.f, dc_forgetting_factor_);
RTC_DCHECK(sample_rate_hz_);
data_dumper_->DumpWav("lc_input", audio->num_frames(),

View File

@ -34,7 +34,7 @@ void NoiseSpectrumEstimator::Initialize() {
void NoiseSpectrumEstimator::Update(rtc::ArrayView<const float> spectrum,
bool first_update) {
RTC_DCHECK_EQ(65u, spectrum.size());
RTC_DCHECK_EQ(65, spectrum.size());
if (first_update) {
// Initialize the noise spectral estimate with the signal spectrum.

View File

@ -25,7 +25,7 @@ namespace webrtc {
namespace {
void RemoveDcLevel(rtc::ArrayView<float> x) {
RTC_DCHECK_LT(0u, x.size());
RTC_DCHECK_LT(0, x.size());
float mean = std::accumulate(x.data(), x.data() + x.size(), 0.f);
mean /= x.size();
@ -37,8 +37,8 @@ void RemoveDcLevel(rtc::ArrayView<float> x) {
void PowerSpectrum(const OouraFft* ooura_fft,
rtc::ArrayView<const float> x,
rtc::ArrayView<float> spectrum) {
RTC_DCHECK_EQ(65u, spectrum.size());
RTC_DCHECK_EQ(128u, x.size());
RTC_DCHECK_EQ(65, spectrum.size());
RTC_DCHECK_EQ(128, x.size());
float X[128];
std::copy(x.data(), x.data() + x.size(), X);
ooura_fft->Fft(X);

View File

@ -91,7 +91,7 @@ LowCutFilter::~LowCutFilter() {}
void LowCutFilter::Process(AudioBuffer* audio) {
RTC_DCHECK(audio);
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(filters_.size(), audio->num_channels());
for (size_t i = 0; i < filters_.size(); i++) {
filters_[i]->Process(audio->split_bands(i)[kBand0To8kHz],

View File

@ -76,7 +76,7 @@ void NoiseSuppressionImpl::AnalyzeCaptureAudio(AudioBuffer* audio) {
return;
}
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(suppressors_.size(), audio->num_channels());
for (size_t i = 0; i < suppressors_.size(); i++) {
WebRtcNs_Analyze(suppressors_[i]->state(),
@ -92,7 +92,7 @@ void NoiseSuppressionImpl::ProcessCaptureAudio(AudioBuffer* audio) {
return;
}
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
RTC_DCHECK_EQ(suppressors_.size(), audio->num_channels());
for (size_t i = 0; i < suppressors_.size(); i++) {
#if defined(WEBRTC_NS_FLOAT)

View File

@ -130,7 +130,7 @@ void ResidualEchoDetector::Initialize() {
void ResidualEchoDetector::PackRenderAudioBuffer(
AudioBuffer* audio,
std::vector<float>* packed_buffer) {
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
packed_buffer->clear();
packed_buffer->insert(packed_buffer->end(),

View File

@ -136,7 +136,7 @@ std::vector<Point> ParseArrayGeometry(const std::string& mic_positions) {
const std::vector<float> values = ParseList<float>(mic_positions);
const size_t num_mics =
rtc::CheckedDivExact(values.size(), static_cast<size_t>(3));
RTC_CHECK_GT(num_mics, 0u) << "mic_positions is not large enough.";
RTC_CHECK_GT(num_mics, 0) << "mic_positions is not large enough.";
std::vector<Point> result;
result.reserve(num_mics);

View File

@ -22,7 +22,7 @@ MovingMoments::MovingMoments(size_t length)
queue_(),
sum_(0.0),
sum_of_squares_(0.0) {
RTC_DCHECK_GT(length, 0u);
RTC_DCHECK_GT(length, 0);
for (size_t i = 0; i < length; ++i) {
queue_.push(0.0);
}

View File

@ -29,9 +29,9 @@ WPDNode::WPDNode(size_t length,
filter_(FIRFilter::Create(coefficients,
coefficients_length,
2 * length + 1)) {
RTC_DCHECK_GT(length, 0u);
RTC_DCHECK_GT(length, 0);
RTC_DCHECK(coefficients);
RTC_DCHECK_GT(coefficients_length, 0u);
RTC_DCHECK_GT(coefficients_length, 0);
memset(data_.get(), 0.f, (2 * length + 1) * sizeof(data_[0]));
}

View File

@ -63,7 +63,7 @@ void VoiceDetectionImpl::ProcessCaptureAudio(AudioBuffer* audio) {
return;
}
RTC_DCHECK_GE(160u, audio->num_frames_per_band());
RTC_DCHECK_GE(160, audio->num_frames_per_band());
// TODO(ajm): concatenate data in frame buffer here.
int vad_ret = WebRtcVad_Process(vad_->state(), sample_rate_hz_,
audio->mixed_low_pass_data(),

View File

@ -27,7 +27,7 @@ constexpr int kInactivityThresholdMs = 5000;
constexpr int kMinProbeDeltaMs = 1;
int ComputeDeltaFromBitrate(size_t probe_size, uint32_t bitrate_bps) {
RTC_CHECK_GT(bitrate_bps, 0u);
RTC_CHECK_GT(bitrate_bps, 0);
// Compute the time delta needed to send probe_size bytes at bitrate_bps
// bps. Result is in milliseconds.
return static_cast<int>((1000ll * probe_size * 8) / bitrate_bps);
@ -153,7 +153,7 @@ size_t BitrateProber::RecommendedMinProbeSize() const {
void BitrateProber::ProbeSent(int64_t now_ms, size_t bytes) {
RTC_DCHECK(probing_state_ == ProbingState::kActive);
RTC_DCHECK_GT(bytes, 0u);
RTC_DCHECK_GT(bytes, 0);
probe_size_last_sent_ = bytes;
time_last_probe_sent_ms_ = now_ms;
if (!clusters_.empty()) {

View File

@ -129,7 +129,7 @@ class PacketQueue {
packet_list_.erase(packet.this_it);
RTC_DCHECK_EQ(packet_list_.size(), prio_queue_.size());
if (packet_list_.empty())
RTC_DCHECK_EQ(0u, queue_time_sum_);
RTC_DCHECK_EQ(0, queue_time_sum_);
}
bool Empty() const { return prio_queue_.empty(); }
@ -285,7 +285,7 @@ void PacedSender::Resume() {
}
void PacedSender::SetProbingEnabled(bool enabled) {
RTC_CHECK_EQ(0u, packet_counter_);
RTC_CHECK_EQ(0, packet_counter_);
CriticalSectionScoped cs(critsect_.get());
prober_->SetEnabled(enabled);
}
@ -338,7 +338,7 @@ void PacedSender::InsertPacket(RtpPacketSender::Priority priority,
int64_t PacedSender::ExpectedQueueTimeMs() const {
CriticalSectionScoped cs(critsect_.get());
RTC_DCHECK_GT(pacing_bitrate_kbps_, 0u);
RTC_DCHECK_GT(pacing_bitrate_kbps_, 0);
return static_cast<int64_t>(packets_->SizeInBytes() * 8 /
pacing_bitrate_kbps_);
}

View File

@ -247,7 +247,7 @@ void RemoteBitrateEstimatorTest::IncomingPacket(uint32_t ssrc,
// target bitrate after the call to this function.
bool RemoteBitrateEstimatorTest::GenerateAndProcessFrame(uint32_t ssrc,
uint32_t bitrate_bps) {
RTC_DCHECK_GT(bitrate_bps, 0u);
RTC_DCHECK_GT(bitrate_bps, 0);
stream_generator_->SetBitrateBps(bitrate_bps);
testing::RtpStream::PacketList packets;
int64_t next_time_us = stream_generator_->GenerateFrame(

View File

@ -103,7 +103,7 @@ int ForwardErrorCorrection::EncodeFec(const PacketList& media_packets,
const size_t num_media_packets = media_packets.size();
// Sanity check arguments.
RTC_DCHECK_GT(num_media_packets, 0u);
RTC_DCHECK_GT(num_media_packets, 0);
RTC_DCHECK_GE(num_important_packets, 0);
RTC_DCHECK_LE(static_cast<size_t>(num_important_packets), num_media_packets);
RTC_DCHECK(fec_packets->empty());
@ -239,7 +239,7 @@ void ForwardErrorCorrection::GenerateFecPayloads(
pkt_mask_idx += media_pkt_idx / 8;
media_pkt_idx %= 8;
}
RTC_DCHECK_GT(fec_packet->length, 0u)
RTC_DCHECK_GT(fec_packet->length, 0)
<< "Packet mask is wrong or poorly designed.";
}
}

View File

@ -50,8 +50,8 @@ bool RtcpPacket::OnBufferFull(uint8_t* packet,
size_t RtcpPacket::HeaderLength() const {
size_t length_in_bytes = BlockLength();
RTC_DCHECK_GT(length_in_bytes, 0u);
RTC_DCHECK_EQ(length_in_bytes % 4, 0u) << "Padding not supported";
RTC_DCHECK_GT(length_in_bytes, 0);
RTC_DCHECK_EQ(length_in_bytes % 4, 0) << "Padding not supported";
// Length in 32-bit words without common header.
return (length_in_bytes - kHeaderLength) / 4;
}

View File

@ -58,7 +58,7 @@ void App::SetSubType(uint8_t subtype) {
void App::SetData(const uint8_t* data, size_t data_length) {
RTC_DCHECK(data);
RTC_DCHECK_EQ(data_length % 4, 0u) << "Data must be 32 bits aligned.";
RTC_DCHECK_EQ(data_length % 4, 0) << "Data must be 32 bits aligned.";
RTC_DCHECK_LE(data_length, kMaxDataSize) << "App data size " << data_length
<< " exceed maximum of "
<< kMaxDataSize << " bytes.";

View File

@ -101,7 +101,7 @@ bool Bye::Create(uint8_t* packet,
*index += reason_length;
// Add padding bytes if needed.
size_t bytes_to_pad = index_end - *index;
RTC_DCHECK_LE(bytes_to_pad, 3u);
RTC_DCHECK_LE(bytes_to_pad, 3);
if (bytes_to_pad > 0) {
memset(&packet[*index], 0, bytes_to_pad);
*index += bytes_to_pad;

View File

@ -84,7 +84,7 @@ bool Fir::Create(uint8_t* packet,
size_t index_end = *index + BlockLength();
CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet,
index);
RTC_DCHECK_EQ(Psfb::media_ssrc(), 0u);
RTC_DCHECK_EQ(Psfb::media_ssrc(), 0);
CreateCommonFeedback(packet + *index);
*index += kCommonFeedbackLength;

View File

@ -103,7 +103,7 @@ bool Remb::Create(uint8_t* packet,
size_t index_end = *index + BlockLength();
CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet,
index);
RTC_DCHECK_EQ(0u, Psfb::media_ssrc());
RTC_DCHECK_EQ(0, Psfb::media_ssrc());
CreateCommonFeedback(packet + *index);
*index += kCommonFeedbackLength;

View File

@ -65,7 +65,7 @@ bool ReportBlock::Parse(const uint8_t* buffer, size_t length) {
void ReportBlock::Create(uint8_t* buffer) const {
// Runtime check should be done while setting cumulative_lost.
RTC_DCHECK_LT(cumulative_lost(), (1u << 24)); // Have only 3 bytes for it.
RTC_DCHECK_LT(cumulative_lost(), (1 << 24)); // Have only 3 bytes for it.
ByteWriter<uint32_t>::WriteBigEndian(&buffer[0], source_ssrc());
ByteWriter<uint8_t>::WriteBigEndian(&buffer[4], fraction_lost());

View File

@ -86,7 +86,7 @@ bool Tmmbn::Create(uint8_t* packet,
CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet,
index);
RTC_DCHECK_EQ(0u, Rtpfb::media_ssrc());
RTC_DCHECK_EQ(0, Rtpfb::media_ssrc());
CreateCommonFeedback(packet + *index);
*index += kCommonFeedbackLength;
for (const TmmbItem& item : items_) {

View File

@ -88,7 +88,7 @@ bool Tmmbr::Create(uint8_t* packet,
CreateHeader(kFeedbackMessageType, kPacketType, HeaderLength(), packet,
index);
RTC_DCHECK_EQ(0u, Rtpfb::media_ssrc());
RTC_DCHECK_EQ(0, Rtpfb::media_ssrc());
CreateCommonFeedback(packet + *index);
*index += kCommonFeedbackLength;
for (const TmmbItem& item : items_) {

View File

@ -141,13 +141,13 @@ class OneBitVectorChunk : public TransportFeedback::PacketStatusChunk {
buffer[0] = 0x80u;
for (int i = 0; i < kSymbolsInFirstByte; ++i) {
uint8_t encoded_symbol = EncodeSymbol(symbols_[i]);
RTC_DCHECK_LE(encoded_symbol, 1u);
RTC_DCHECK_LE(encoded_symbol, 1);
buffer[0] |= encoded_symbol << (kSymbolsInFirstByte - (i + 1));
}
buffer[1] = 0x00u;
for (int i = 0; i < kSymbolsInSecondByte; ++i) {
uint8_t encoded_symbol = EncodeSymbol(symbols_[i + kSymbolsInFirstByte]);
RTC_DCHECK_LE(encoded_symbol, 1u);
RTC_DCHECK_LE(encoded_symbol, 1);
buffer[1] |= encoded_symbol << (kSymbolsInSecondByte - (i + 1));
}
}

View File

@ -194,7 +194,7 @@ void RtpPacketizerH264::PacketizeFuA(size_t fragment_index) {
offset += packet_length;
fragment_length -= packet_length;
}
RTC_CHECK_EQ(0u, fragment_length);
RTC_CHECK_EQ(0, fragment_length);
}
size_t RtpPacketizerH264::PacketizeStapA(size_t fragment_index) {
@ -205,7 +205,7 @@ size_t RtpPacketizerH264::PacketizeStapA(size_t fragment_index) {
const Fragment* fragment = &input_fragments_[fragment_index];
RTC_CHECK_GE(payload_size_left, fragment->length);
while (payload_size_left >= fragment->length + fragment_headers_length) {
RTC_CHECK_GT(fragment->length, 0u);
RTC_CHECK_GT(fragment->length, 0);
packets_.push(PacketUnit(*fragment, aggregated_fragments == 0, false, true,
fragment->buffer[0]));
payload_size_left -= fragment->length;

View File

@ -253,9 +253,9 @@ void Packet::SetSsrc(uint32_t ssrc) {
}
void Packet::SetCsrcs(const std::vector<uint32_t>& csrcs) {
RTC_DCHECK_EQ(num_extensions_, 0u);
RTC_DCHECK_EQ(payload_size_, 0u);
RTC_DCHECK_EQ(padding_size_, 0u);
RTC_DCHECK_EQ(num_extensions_, 0);
RTC_DCHECK_EQ(payload_size_, 0);
RTC_DCHECK_EQ(padding_size_, 0);
RTC_DCHECK_LE(csrcs.size(), 0x0fu);
RTC_DCHECK_LE(kFixedHeaderSize + 4 * csrcs.size(), capacity());
payload_offset_ = kFixedHeaderSize + 4 * csrcs.size();
@ -269,7 +269,7 @@ void Packet::SetCsrcs(const std::vector<uint32_t>& csrcs) {
}
uint8_t* Packet::AllocatePayload(size_t size_bytes) {
RTC_DCHECK_EQ(padding_size_, 0u);
RTC_DCHECK_EQ(padding_size_, 0);
if (payload_offset_ + size_bytes > capacity()) {
LOG(LS_WARNING) << "Cannot set payload, not enough space in buffer.";
return nullptr;
@ -283,7 +283,7 @@ uint8_t* Packet::AllocatePayload(size_t size_bytes) {
}
void Packet::SetPayloadSize(size_t size_bytes) {
RTC_DCHECK_EQ(padding_size_, 0u);
RTC_DCHECK_EQ(padding_size_, 0);
RTC_DCHECK_LE(size_bytes, payload_size_);
payload_size_ = size_bytes;
buffer_.SetSize(payload_offset_ + payload_size_);
@ -473,8 +473,8 @@ bool Packet::AllocateExtension(ExtensionType type,
if (extension_id == ExtensionManager::kInvalidId) {
return false;
}
RTC_DCHECK_GT(length, 0u);
RTC_DCHECK_LE(length, 16u);
RTC_DCHECK_GT(length, 0);
RTC_DCHECK_LE(length, 16);
size_t num_csrc = data()[0] & 0x0F;
size_t extensions_offset = kFixedHeaderSize + (num_csrc * 4) + 4;

View File

@ -45,7 +45,7 @@ void RtpPacketHistory::SetStorePacketsStatus(bool enable,
}
void RtpPacketHistory::Allocate(size_t number_to_store) {
RTC_DCHECK_GT(number_to_store, 0u);
RTC_DCHECK_GT(number_to_store, 0);
RTC_DCHECK_LE(number_to_store, kMaxCapacity);
store_ = true;
stored_packets_.resize(number_to_store);

View File

@ -53,7 +53,7 @@ void VerifyFramesAreEqual(const AudioFrame& frame1, const AudioFrame& frame2) {
void InitFrame(AudioFrame* frame, size_t channels, size_t samples_per_channel,
int16_t left_data, int16_t right_data) {
RTC_DCHECK(frame);
RTC_DCHECK_GE(2u, channels);
RTC_DCHECK_GE(2, channels);
RTC_DCHECK_GE(AudioFrame::kMaxDataSizeSamples,
samples_per_channel * channels);
frame->samples_per_channel_ = samples_per_channel;

View File

@ -198,7 +198,7 @@ bool VCMCodecDataBase::SetSendCodec(const VideoCodec* send_codec,
RTC_DCHECK_GE(number_of_cores, 1);
RTC_DCHECK_GE(send_codec->plType, 1);
// Make sure the start bit rate is sane...
RTC_DCHECK_LE(send_codec->startBitrate, 1000000u);
RTC_DCHECK_LE(send_codec->startBitrate, 1000000);
RTC_DCHECK(send_codec->codecType != kVideoCodecUnknown);
bool reset_required = pending_encoder_reset_;
if (number_of_cores_ != number_of_cores) {

View File

@ -53,7 +53,7 @@ bool Vp9FrameBufferPool::InitializeVpxUsePool(
rtc::scoped_refptr<Vp9FrameBufferPool::Vp9FrameBuffer>
Vp9FrameBufferPool::GetFrameBuffer(size_t min_size) {
RTC_DCHECK_GT(min_size, 0u);
RTC_DCHECK_GT(min_size, 0);
rtc::scoped_refptr<Vp9FrameBuffer> available_buffer = nullptr;
{
rtc::CritScope cs(&buffers_lock_);

View File

@ -17,8 +17,8 @@
namespace webrtc {
namespace video_coding {
Histogram::Histogram(size_t num_buckets, size_t max_num_values) {
RTC_DCHECK_GT(num_buckets, 0u);
RTC_DCHECK_GT(max_num_values, 0u);
RTC_DCHECK_GT(num_buckets, 0);
RTC_DCHECK_GT(max_num_values, 0);
buckets_.resize(num_buckets);
values_.reserve(max_num_values);
index_ = 0;

View File

@ -177,8 +177,8 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
}
for (size_t i = 0; i < streams.size(); ++i) {
SimulcastStream* sim_stream = &video_codec.simulcastStream[i];
RTC_DCHECK_GT(streams[i].width, 0u);
RTC_DCHECK_GT(streams[i].height, 0u);
RTC_DCHECK_GT(streams[i].width, 0);
RTC_DCHECK_GT(streams[i].height, 0);
RTC_DCHECK_GT(streams[i].max_framerate, 0);
// Different framerates not supported per stream at the moment.
RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate);

View File

@ -56,7 +56,7 @@ bool H264CMSampleBufferToAnnexBBuffer(
return false;
}
RTC_CHECK_EQ(nalu_header_size, kAvccHeaderByteSize);
RTC_DCHECK_EQ(param_set_count, 2u);
RTC_DCHECK_EQ(param_set_count, 2);
// Truncate any previous data in the buffer without changing its capacity.
annexb_buffer->SetSize(0);
@ -250,7 +250,7 @@ bool H264AnnexBBufferToCMSampleBuffer(const uint8_t* annexb_buffer,
bool H264AnnexBBufferHasVideoFormatDescription(const uint8_t* annexb_buffer,
size_t annexb_buffer_size) {
RTC_DCHECK(annexb_buffer);
RTC_DCHECK_GT(annexb_buffer_size, 4u);
RTC_DCHECK_GT(annexb_buffer_size, 4);
// The buffer we receive via RTP has 00 00 00 01 start code artifically
// embedded by the RTP depacketizer. Extract NALU information.

View File

@ -23,7 +23,7 @@ template<typename T> class AlignedArray {
AlignedArray(size_t rows, size_t cols, size_t alignment)
: rows_(rows),
cols_(cols) {
RTC_CHECK_GT(alignment, 0u);
RTC_CHECK_GT(alignment, 0);
head_row_ = static_cast<T**>(AlignedMalloc(rows_ * sizeof(*head_row_),
alignment));
for (size_t i = 0; i < rows_; ++i) {

View File

@ -203,8 +203,8 @@ void CallTest::CreateSendConfig(size_t num_video_streams,
size_t num_flexfec_streams,
Transport* send_transport) {
RTC_DCHECK(num_video_streams <= kNumSsrcs);
RTC_DCHECK_LE(num_audio_streams, 1u);
RTC_DCHECK_LE(num_flexfec_streams, 1u);
RTC_DCHECK_LE(num_audio_streams, 1);
RTC_DCHECK_LE(num_flexfec_streams, 1);
RTC_DCHECK(num_audio_streams == 0 || voe_send_.channel_id >= 0);
if (num_video_streams > 0) {
video_send_config_ = VideoSendStream::Config(send_transport);
@ -261,7 +261,7 @@ void CallTest::CreateMatchingReceiveConfigs(Transport* rtcp_send_transport) {
}
}
RTC_DCHECK_GE(1u, num_audio_streams_);
RTC_DCHECK_GE(1, num_audio_streams_);
if (num_audio_streams_ == 1) {
RTC_DCHECK_LE(0, voe_send_.channel_id);
AudioReceiveStream::Config audio_config;

View File

@ -161,7 +161,7 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
current_source_frame_(nullptr),
file_generator_(files, source_width, source_height, 1) {
RTC_DCHECK(clock_ != nullptr);
RTC_DCHECK_GT(num_frames_, 0u);
RTC_DCHECK_GT(num_frames_, 0);
RTC_DCHECK_GE(source_height, target_height);
RTC_DCHECK_GE(source_width, target_width);
RTC_DCHECK_GE(scroll_time_ms, 0);

View File

@ -1039,7 +1039,7 @@ void EndToEndTest::DecodesRetransmittedFrame(bool enable_rtx, bool enable_red) {
}
// Configure encoding and decoding with VP8, since generic packetization
// doesn't support FEC with NACK.
RTC_DCHECK_EQ(1u, (*receive_configs)[0].decoders.size());
RTC_DCHECK_EQ(1, (*receive_configs)[0].decoders.size());
send_config->encoder_settings.encoder = encoder_.get();
send_config->encoder_settings.payload_name = "VP8";
(*receive_configs)[0].decoders[0].payload_name = "VP8";
@ -2657,7 +2657,7 @@ TEST_P(EndToEndTest, ReportsSetEncoderRates) {
std::vector<VideoReceiveStream::Config>* receive_configs,
VideoEncoderConfig* encoder_config) override {
send_config->encoder_settings.encoder = this;
RTC_DCHECK_EQ(1u, encoder_config->number_of_streams);
RTC_DCHECK_EQ(1, encoder_config->number_of_streams);
}
int32_t SetRateAllocation(const BitrateAllocation& rate_allocation,
@ -3238,7 +3238,7 @@ void EndToEndTest::TestRtpStatePreservation(bool use_rtx,
if (encoder_config.number_of_streams > 1) {
// Lower bitrates so that all streams send initially.
RTC_DCHECK_EQ(3u, encoder_config.number_of_streams);
RTC_DCHECK_EQ(3, encoder_config.number_of_streams);
for (size_t i = 0; i < encoder_config.number_of_streams; ++i) {
streams[i].min_bitrate_bps = 10000;
streams[i].target_bitrate_bps = 15000;

View File

@ -157,7 +157,7 @@ class VideoAnalyzer : public PacketReceiver,
// spare cores.
uint32_t num_cores = CpuInfo::DetectNumberOfCores();
RTC_DCHECK_GE(num_cores, 1u);
RTC_DCHECK_GE(num_cores, 1);
static const uint32_t kMinCoresLeft = 4;
static const uint32_t kMaxComparisonThreads = 8;
@ -757,7 +757,7 @@ class VideoAnalyzer : public PacketReceiver,
void AddCapturedFrameForComparison(const VideoFrame& video_frame) {
rtc::CritScope lock(&crit_);
RTC_DCHECK_EQ(0u, video_frame.timestamp());
RTC_DCHECK_EQ(0, video_frame.timestamp());
// Frames from the capturer does not have a rtp timestamp. Create one so it
// can be used for comparison.
VideoFrame copy = video_frame;
@ -891,7 +891,7 @@ void VideoQualityTest::CheckParams() {
if (params_.video.codec == "VP8") {
RTC_CHECK_EQ(params_.ss.num_spatial_layers, 1);
} else if (params_.video.codec == "VP9") {
RTC_CHECK_EQ(params_.ss.streams.size(), 1u);
RTC_CHECK_EQ(params_.ss.streams.size(), 1);
}
}

View File

@ -50,7 +50,7 @@ std::vector<RtpRtcp*> CreateRtpRtcpModules(
RtcEventLog* event_log,
RateLimiter* retransmission_rate_limiter,
size_t num_modules) {
RTC_DCHECK_GT(num_modules, 0u);
RTC_DCHECK_GT(num_modules, 0);
RtpRtcp::Configuration configuration;
ReceiveStatistics* null_receive_statistics = configuration.receive_statistics;
configuration.audio = false;

View File

@ -1110,7 +1110,7 @@ TEST_F(VideoSendStreamTest, SuspendBelowMinBitrate) {
VideoSendStream::Config* send_config,
std::vector<VideoReceiveStream::Config>* receive_configs,
VideoEncoderConfig* encoder_config) override {
RTC_DCHECK_EQ(1u, encoder_config->number_of_streams);
RTC_DCHECK_EQ(1, encoder_config->number_of_streams);
transport_adapter_.reset(
new internal::TransportAdapter(send_config->send_transport));
transport_adapter_->Enable();
@ -1554,7 +1554,7 @@ class MaxPaddingSetTest : public test::SendTest {
VideoSendStream::Config* send_config,
std::vector<VideoReceiveStream::Config>* receive_configs,
VideoEncoderConfig* encoder_config) override {
RTC_DCHECK_EQ(1u, encoder_config->number_of_streams);
RTC_DCHECK_EQ(1, encoder_config->number_of_streams);
if (running_without_padding_) {
encoder_config->min_transmit_bitrate_bps = 0;
encoder_config->content_type =

View File

@ -67,7 +67,7 @@ bool LoudestFilter::ForwardThisPacket(const webrtc::RTPHeader& rtp_header) {
}
unsigned int quietest_ssrc = FindQuietestStream();
RTC_CHECK_NE(0u, quietest_ssrc);
RTC_CHECK_NE(0, quietest_ssrc);
// A smaller value if audio level corresponds to a louder sound.
if (audio_level < stream_levels_[quietest_ssrc].audio_level) {
stream_levels_.erase(quietest_ssrc);

View File

@ -82,10 +82,10 @@ void MixWithSat(int16_t target[],
const int16_t source[],
size_t source_channel,
size_t source_len) {
RTC_DCHECK_GE(target_channel, 1u);
RTC_DCHECK_LE(target_channel, 2u);
RTC_DCHECK_GE(source_channel, 1u);
RTC_DCHECK_LE(source_channel, 2u);
RTC_DCHECK_GE(target_channel, 1);
RTC_DCHECK_LE(target_channel, 2);
RTC_DCHECK_GE(source_channel, 1);
RTC_DCHECK_LE(source_channel, 2);
if (target_channel == 2 && source_channel == 1) {
// Convert source from mono to stereo.

View File

@ -535,7 +535,7 @@ int VoEBaseImpl::GetVersion(char version[1024]) {
}
std::string versionString = VoiceEngine::GetVersionString();
RTC_DCHECK_GT(1024u, versionString.size() + 1);
RTC_DCHECK_GT(1024, versionString.size() + 1);
char* end = std::copy(versionString.cbegin(), versionString.cend(), version);
end[0] = '\n';
end[1] = '\0';