Remove tautological 'unsigned expr < 0' comparisons

This is the result of compiling Chromium with
Wtautological-unsigned-zero-compare. For more details, see:
https://chromium-review.googlesource.com/c/chromium/src/+/2802412

Change-Id: I05cec6ae5738036a56beadeaa1dde5189edf0137
Bug: chromium:1195670
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213783
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33689}
This commit is contained in:
Anton Bikineev 2021-04-04 15:04:27 +02:00 committed by Commit Bot
parent 22379fc8dc
commit a3575cb848
4 changed files with 5 additions and 6 deletions

View File

@ -38,7 +38,7 @@ operator=(const AudioEncoderMultiChannelOpusConfig&) = default;
bool AudioEncoderMultiChannelOpusConfig::IsOk() const { bool AudioEncoderMultiChannelOpusConfig::IsOk() const {
if (frame_size_ms <= 0 || frame_size_ms % 10 != 0) if (frame_size_ms <= 0 || frame_size_ms % 10 != 0)
return false; return false;
if (num_channels < 0 || num_channels >= 255) { if (num_channels >= 255) {
return false; return false;
} }
if (bitrate_bps < kMinBitrateBps || bitrate_bps > kMaxBitrateBps) if (bitrate_bps < kMinBitrateBps || bitrate_bps > kMaxBitrateBps)
@ -47,7 +47,7 @@ bool AudioEncoderMultiChannelOpusConfig::IsOk() const {
return false; return false;
// Check the lengths: // Check the lengths:
if (num_channels < 0 || num_streams < 0 || coupled_streams < 0) { if (num_streams < 0 || coupled_streams < 0) {
return false; return false;
} }
if (num_streams < coupled_streams) { if (num_streams < coupled_streams) {

View File

@ -61,7 +61,7 @@ bool AudioEncoderOpusConfig::IsOk() const {
// well; we can add support for them when needed.) // well; we can add support for them when needed.)
return false; return false;
} }
if (num_channels < 0 || num_channels >= 255) { if (num_channels >= 255) {
return false; return false;
} }
if (!bitrate_bps) if (!bitrate_bps)

View File

@ -134,7 +134,7 @@ void RtpPacketHistory::PutRtpPacket(std::unique_ptr<RtpPacketToSend> packet,
// Store packet. // Store packet.
const uint16_t rtp_seq_no = packet->SequenceNumber(); const uint16_t rtp_seq_no = packet->SequenceNumber();
int packet_index = GetPacketIndex(rtp_seq_no); int packet_index = GetPacketIndex(rtp_seq_no);
if (packet_index >= 0u && if (packet_index >= 0 &&
static_cast<size_t>(packet_index) < packet_history_.size() && static_cast<size_t>(packet_index) < packet_history_.size() &&
packet_history_[packet_index].packet_ != nullptr) { packet_history_[packet_index].packet_ != nullptr) {
RTC_LOG(LS_WARNING) << "Duplicate packet inserted: " << rtp_seq_no; RTC_LOG(LS_WARNING) << "Duplicate packet inserted: " << rtp_seq_no;

View File

@ -110,8 +110,7 @@ bool AllocationIsValid(const VideoLayersAllocation& allocation) {
if (spatial_layer.height <= 0) { if (spatial_layer.height <= 0) {
return false; return false;
} }
if (spatial_layer.frame_rate_fps < 0 || if (spatial_layer.frame_rate_fps > 255) {
spatial_layer.frame_rate_fps > 255) {
return false; return false;
} }
} }