LSC: Apply clang-tidy's modernize-use-bool-literals

The check finds implicit conversions of integer literals to bools:
  bool b1 = 1;
  bool b2 = static_cast<bool>(1);
and transforms them to:
  bool b1 = true;
  bool b2 = true;

Bug: chromium:1290142
Change-Id: I6819a0bd2ca84ecadae08ed9389c17d2652589f4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248166
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#35778}
This commit is contained in:
Anton Bikineev 2022-01-23 22:22:59 +01:00 committed by WebRTC LUCI CQ
parent 9d230d54c7
commit 7abf45fe2c
6 changed files with 8 additions and 7 deletions

View File

@ -13,7 +13,7 @@
namespace webrtc {
bool EncodedFrame::delayed_by_retransmission() const {
return 0;
return false;
}
} // namespace webrtc

View File

@ -159,7 +159,7 @@ int Normal::Process(const int16_t* input,
if (cng_decoder) {
// Generate long enough for 48kHz.
if (!cng_decoder->Generate(cng_output, 0)) {
if (!cng_decoder->Generate(cng_output, false)) {
// Error returned; set return vector to all zeros.
memset(cng_output, 0, sizeof(cng_output));
}

View File

@ -193,7 +193,7 @@ void NetEqDecodingTest::PopulateRtpInfo(int frame_index,
rtp_info->timestamp = timestamp;
rtp_info->ssrc = 0x1234; // Just an arbitrary SSRC.
rtp_info->payloadType = 94; // PCM16b WB codec.
rtp_info->markerBit = 0;
rtp_info->markerBit = false;
}
void NetEqDecodingTest::PopulateCng(int frame_index,
@ -205,7 +205,7 @@ void NetEqDecodingTest::PopulateCng(int frame_index,
rtp_info->timestamp = timestamp;
rtp_info->ssrc = 0x1234; // Just an arbitrary SSRC.
rtp_info->payloadType = 98; // WB CNG.
rtp_info->markerBit = 0;
rtp_info->markerBit = false;
payload[0] = 64; // Noise level -64 dBov, quite arbitrarily chosen.
*payload_len = 1; // Only noise level, no spectral parameters.
}

View File

@ -508,7 +508,7 @@ void TestStereo::Run(TestPackStereo* channel,
in_file_stereo_->FastForward(100);
in_file_mono_->FastForward(100);
while (1) {
while (true) {
// Simulate packet loss by setting `packet_loss_` to "true" in
// `percent_loss` percent of the loops.
if (percent_loss > 0) {

View File

@ -158,7 +158,8 @@ void Vp9ReadQp(BitstreamReader& br, Vp9UncompressedHeader* frame_info) {
void Vp9ReadSegmentationParams(BitstreamReader& br,
Vp9UncompressedHeader* frame_info) {
constexpr int kSegmentationFeatureBits[kVp9SegLvlMax] = {8, 6, 2, 0};
constexpr bool kSegmentationFeatureSigned[kVp9SegLvlMax] = {1, 1, 0, 0};
constexpr bool kSegmentationFeatureSigned[kVp9SegLvlMax] = {true, true, false,
false};
frame_info->segmentation_enabled = br.Read<bool>();
if (!frame_info->segmentation_enabled) {

View File

@ -694,7 +694,7 @@ absl::optional<Syncable::Info> VideoReceiveStream2::GetInfo() const {
bool VideoReceiveStream2::GetPlayoutRtpTimestamp(uint32_t* rtp_timestamp,
int64_t* time_ms) const {
RTC_DCHECK_NOTREACHED();
return 0;
return false;
}
void VideoReceiveStream2::SetEstimatedPlayoutNtpTimestampMs(