diff --git a/common_audio/BUILD.gn b/common_audio/BUILD.gn index 06c9cd37cd..57cf69952d 100644 --- a/common_audio/BUILD.gn +++ b/common_audio/BUILD.gn @@ -82,11 +82,6 @@ rtc_static_library("common_audio") { public_configs = [ ":common_audio_config" ] - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - if (current_cpu == "x86" || current_cpu == "x64") { deps += [ ":common_audio_sse2" ] } @@ -296,10 +291,6 @@ if (current_cpu == "x86" || current_cpu == "x64") { cflags = [ "-msse2" ] } - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } deps = [ ":fir_filter", ":sinc_resampler", @@ -335,11 +326,6 @@ if (rtc_build_with_neon) { ] } - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - deps = [ ":common_audio_neon_c", ":fir_filter", @@ -375,10 +361,6 @@ if (rtc_build_with_neon) { ] } - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } deps = [ ":common_audio_c", "../rtc_base:checks", @@ -427,11 +409,6 @@ if (rtc_include_tests) { sources += [ "resampler/sinc_resampler_unittest.cc" ] } - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - deps = [ ":common_audio", ":common_audio_c", diff --git a/common_audio/audio_ring_buffer.cc b/common_audio/audio_ring_buffer.cc index ed4a5dd562..b3bdc252f6 100644 --- a/common_audio/audio_ring_buffer.cc +++ b/common_audio/audio_ring_buffer.cc @@ -24,7 +24,7 @@ AudioRingBuffer::AudioRingBuffer(size_t channels, size_t max_frames) { } AudioRingBuffer::~AudioRingBuffer() { - for (auto buf : buffers_) + for (auto* buf : buffers_) WebRtc_FreeBuffer(buf); } @@ -58,7 +58,7 @@ size_t AudioRingBuffer::WriteFramesAvailable() const { } void AudioRingBuffer::MoveReadPositionForward(size_t frames) { - for (auto buf : buffers_) { + for (auto* buf : buffers_) { const size_t moved = static_cast(WebRtc_MoveReadPtr(buf, static_cast(frames))); RTC_CHECK_EQ(moved, frames); @@ -66,7 +66,7 @@ void AudioRingBuffer::MoveReadPositionForward(size_t frames) { } void AudioRingBuffer::MoveReadPositionBackward(size_t frames) { - for (auto buf : buffers_) { + for (auto* buf : buffers_) { const size_t moved = static_cast( -WebRtc_MoveReadPtr(buf, -static_cast(frames))); RTC_CHECK_EQ(moved, frames); diff --git a/common_audio/lapped_transform_unittest.cc b/common_audio/lapped_transform_unittest.cc index 7f3d19f806..687df8986a 100644 --- a/common_audio/lapped_transform_unittest.cc +++ b/common_audio/lapped_transform_unittest.cc @@ -24,11 +24,11 @@ class NoopCallback : public webrtc::LappedTransform::Callback { public: NoopCallback() : block_num_(0) {} - virtual void ProcessAudioBlock(const complex* const* in_block, - size_t in_channels, - size_t frames, - size_t out_channels, - complex* const* out_block) { + void ProcessAudioBlock(const complex* const* in_block, + size_t in_channels, + size_t frames, + size_t out_channels, + complex* const* out_block) override { RTC_CHECK_EQ(in_channels, out_channels); for (size_t i = 0; i < out_channels; ++i) { memcpy(out_block[i], in_block[i], sizeof(**in_block) * frames); @@ -46,11 +46,11 @@ class FftCheckerCallback : public webrtc::LappedTransform::Callback { public: FftCheckerCallback() : block_num_(0) {} - virtual void ProcessAudioBlock(const complex* const* in_block, - size_t in_channels, - size_t frames, - size_t out_channels, - complex* const* out_block) { + void ProcessAudioBlock(const complex* const* in_block, + size_t in_channels, + size_t frames, + size_t out_channels, + complex* const* out_block) override { RTC_CHECK_EQ(in_channels, out_channels); size_t full_length = (frames - 1) * 2; diff --git a/common_audio/real_fourier_ooura.cc b/common_audio/real_fourier_ooura.cc index a3dfbd6811..db65d269fc 100644 --- a/common_audio/real_fourier_ooura.cc +++ b/common_audio/real_fourier_ooura.cc @@ -51,7 +51,7 @@ void RealFourierOoura::Forward(const float* src, complex* dest) const { { // This cast is well-defined since C++11. See "Non-static data members" at: // http://en.cppreference.com/w/cpp/numeric/complex - auto dest_float = reinterpret_cast(dest); + auto* dest_float = reinterpret_cast(dest); std::copy(src, src + length_, dest_float); WebRtc_rdft(length_, 1, dest_float, work_ip_.get(), work_w_.get()); } @@ -65,7 +65,7 @@ void RealFourierOoura::Forward(const float* src, complex* dest) const { void RealFourierOoura::Inverse(const complex* src, float* dest) const { { - auto dest_complex = reinterpret_cast*>(dest); + auto* dest_complex = reinterpret_cast*>(dest); // The real output array is shorter than the input complex array by one // complex element. const size_t dest_complex_length = complex_length_ - 1; diff --git a/common_audio/resampler/push_sinc_resampler_unittest.cc b/common_audio/resampler/push_sinc_resampler_unittest.cc index 042b5f3959..487a09fc8a 100644 --- a/common_audio/resampler/push_sinc_resampler_unittest.cc +++ b/common_audio/resampler/push_sinc_resampler_unittest.cc @@ -58,7 +58,7 @@ class PushSincResamplerTest : public ::testing::TestWithParam< class ZeroSource : public SincResamplerCallback { public: - void Run(size_t frames, float* destination) { + void Run(size_t frames, float* destination) override { std::memset(destination, 0, sizeof(float) * frames); } }; diff --git a/common_audio/resampler/resampler_unittest.cc b/common_audio/resampler/resampler_unittest.cc index d992d5064b..fd636e2998 100644 --- a/common_audio/resampler/resampler_unittest.cc +++ b/common_audio/resampler/resampler_unittest.cc @@ -42,8 +42,8 @@ bool ValidRates(int in_rate, int out_rate) { class ResamplerTest : public testing::Test { protected: ResamplerTest(); - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; void ResetIfNeededAndPush(int in_rate, int out_rate, int num_channels); diff --git a/common_audio/resampler/sinusoidal_linear_chirp_source.h b/common_audio/resampler/sinusoidal_linear_chirp_source.h index e9f3ca34e8..71dcff5eb9 100644 --- a/common_audio/resampler/sinusoidal_linear_chirp_source.h +++ b/common_audio/resampler/sinusoidal_linear_chirp_source.h @@ -31,7 +31,7 @@ class SinusoidalLinearChirpSource : public SincResamplerCallback { double max_frequency, double delay_samples); - virtual ~SinusoidalLinearChirpSource() {} + ~SinusoidalLinearChirpSource() override {} void Run(size_t frames, float* destination) override; diff --git a/common_audio/signal_processing/signal_processing_unittest.cc b/common_audio/signal_processing/signal_processing_unittest.cc index 4ef0c906a0..8e65ebd2bc 100644 --- a/common_audio/signal_processing/signal_processing_unittest.cc +++ b/common_audio/signal_processing/signal_processing_unittest.cc @@ -28,7 +28,7 @@ static const int16_t vector16[kVector16Size] = {1, class SplTest : public testing::Test { protected: SplTest() { WebRtcSpl_Init(); } - virtual ~SplTest() {} + ~SplTest() override {} }; TEST_F(SplTest, MacroTest) { diff --git a/common_audio/vad/vad_unittest.h b/common_audio/vad/vad_unittest.h index ec4e8766cc..5521983fe7 100644 --- a/common_audio/vad/vad_unittest.h +++ b/common_audio/vad/vad_unittest.h @@ -39,8 +39,8 @@ const size_t kFrameLengthsSize = sizeof(kFrameLengths) / sizeof(*kFrameLengths); class VadTest : public ::testing::Test { protected: VadTest(); - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; // Returns true if the rate and frame length combination is valid. bool ValidRatesAndFrameLengths(int rate, size_t frame_length); diff --git a/common_audio/wav_file.cc b/common_audio/wav_file.cc index e96b39df1b..21b64a8d30 100644 --- a/common_audio/wav_file.cc +++ b/common_audio/wav_file.cc @@ -30,7 +30,7 @@ static const size_t kBytesPerSample = 2; class ReadableWavFile : public ReadableWav { public: explicit ReadableWavFile(FILE* file) : file_(file) {} - virtual size_t Read(void* buf, size_t num_bytes) { + size_t Read(void* buf, size_t num_bytes) override { return fread(buf, 1, num_bytes, file_); } diff --git a/common_audio/wav_header_unittest.cc b/common_audio/wav_header_unittest.cc index 101f3ff389..b7169b53c8 100644 --- a/common_audio/wav_header_unittest.cc +++ b/common_audio/wav_header_unittest.cc @@ -32,13 +32,13 @@ class ReadableWavBuffer : public ReadableWav { buf_exhausted_(false), check_read_size_(check_read_size) {} - virtual ~ReadableWavBuffer() { + ~ReadableWavBuffer() override { // Verify the entire buffer has been read. if (check_read_size_) EXPECT_EQ(size_, pos_); } - virtual size_t Read(void* buf, size_t num_bytes) { + size_t Read(void* buf, size_t num_bytes) override { // Verify we don't try to read outside of a properly sized header. if (size_ >= kWavHeaderSize) EXPECT_GE(size_, pos_ + num_bytes);