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}
diff --git a/api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.cc b/api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.cc
index f01caf1..0052c42 100644
--- a/api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.cc
+++ b/api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.cc
@@ -38,7 +38,7 @@
bool AudioEncoderMultiChannelOpusConfig::IsOk() const {
if (frame_size_ms <= 0 || frame_size_ms % 10 != 0)
return false;
- if (num_channels < 0 || num_channels >= 255) {
+ if (num_channels >= 255) {
return false;
}
if (bitrate_bps < kMinBitrateBps || bitrate_bps > kMaxBitrateBps)
@@ -47,7 +47,7 @@
return false;
// Check the lengths:
- if (num_channels < 0 || num_streams < 0 || coupled_streams < 0) {
+ if (num_streams < 0 || coupled_streams < 0) {
return false;
}
if (num_streams < coupled_streams) {
diff --git a/api/audio_codecs/opus/audio_encoder_opus_config.cc b/api/audio_codecs/opus/audio_encoder_opus_config.cc
index 2f36d02..0e6f55e 100644
--- a/api/audio_codecs/opus/audio_encoder_opus_config.cc
+++ b/api/audio_codecs/opus/audio_encoder_opus_config.cc
@@ -61,7 +61,7 @@
// well; we can add support for them when needed.)
return false;
}
- if (num_channels < 0 || num_channels >= 255) {
+ if (num_channels >= 255) {
return false;
}
if (!bitrate_bps)
diff --git a/modules/rtp_rtcp/source/rtp_packet_history.cc b/modules/rtp_rtcp/source/rtp_packet_history.cc
index 1fbfb76..5089933 100644
--- a/modules/rtp_rtcp/source/rtp_packet_history.cc
+++ b/modules/rtp_rtcp/source/rtp_packet_history.cc
@@ -134,7 +134,7 @@
// Store packet.
const uint16_t rtp_seq_no = packet->SequenceNumber();
int packet_index = GetPacketIndex(rtp_seq_no);
- if (packet_index >= 0u &&
+ if (packet_index >= 0 &&
static_cast<size_t>(packet_index) < packet_history_.size() &&
packet_history_[packet_index].packet_ != nullptr) {
RTC_LOG(LS_WARNING) << "Duplicate packet inserted: " << rtp_seq_no;
diff --git a/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc b/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc
index be6aadb..93fb235 100644
--- a/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc
+++ b/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc
@@ -110,8 +110,7 @@
if (spatial_layer.height <= 0) {
return false;
}
- if (spatial_layer.frame_rate_fps < 0 ||
- spatial_layer.frame_rate_fps > 255) {
+ if (spatial_layer.frame_rate_fps > 255) {
return false;
}
}