Fix -Wtautological-constant-compare in test/fuzzers.

This started to be detected by a new version of clang and it is blocking
the roll:

../../third_party/webrtc/test/fuzzers/agc_fuzzer.cc:85:29: error: converting the result of '?:' with integer constants to a boolean always evaluates to 'true' [-Werror,-Wtautological-constant-compare]
const bool num_channels = fuzz_data->ReadOrDefaultValue(true) ? 2 : 1;

Bug: chromium:1007367
Change-Id: Ib9a6e4e3c8f109d10845a315dd0782b1498cb54e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155166
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29348}
This commit is contained in:
Mirko Bonadei
2019-09-30 15:59:35 +02:00
committed by Commit Bot
parent ef3dbad49a
commit 1e91551885

View File

@ -82,7 +82,7 @@ void FuzzGainController(test::FuzzDataHelper* fuzz_data, GainControlImpl* gci) {
const auto sample_rate_hz =
static_cast<size_t>(fuzz_data->SelectOneOf(rate_kinds));
const size_t samples_per_frame = sample_rate_hz / 100;
const bool num_channels = fuzz_data->ReadOrDefaultValue(true) ? 2 : 1;
const size_t num_channels = fuzz_data->ReadOrDefaultValue(true) ? 2 : 1;
gci->Initialize(num_channels, sample_rate_hz);
FuzzGainControllerConfig(fuzz_data, gci);