Fix Chromium clang plugin warnings
NOTRY=true
BUG=webrtc:163
Review-Url: https://codereview.webrtc.org/2291503002
Cr-Commit-Position: refs/heads/master@{#13959}
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index 530c5d4..0c36221 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -331,6 +331,8 @@
source_set("webrtc_common") {
sources = [
"audio_sink.h",
+ "common.cc",
+ "common.h",
"common_types.cc",
"common_types.h",
"config.cc",
diff --git a/webrtc/common.cc b/webrtc/common.cc
new file mode 100644
index 0000000..bc24818
--- /dev/null
+++ b/webrtc/common.cc
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/common.h"
+
+namespace webrtc {
+
+Config::Config() {}
+
+Config::~Config() {
+ for (OptionMap::iterator it = options_.begin(); it != options_.end(); ++it) {
+ delete it->second;
+ }
+}
+
+} // namespace webrtc
diff --git a/webrtc/common.gyp b/webrtc/common.gyp
index 2970877..c9ac71c 100644
--- a/webrtc/common.gyp
+++ b/webrtc/common.gyp
@@ -13,6 +13,8 @@
'type': 'static_library',
'sources': [
'audio_sink.h',
+ 'common.cc',
+ 'common.h',
'common_types.cc',
'common_types.h',
'config.h',
diff --git a/webrtc/common.h b/webrtc/common.h
index 8795064..79db50c 100644
--- a/webrtc/common.h
+++ b/webrtc/common.h
@@ -71,15 +71,8 @@
// This instance gets ownership of the newly set value.
template<typename T> void Set(T* value);
- Config() {}
- ~Config() {
- // Note: this method is inline so webrtc public API depends only
- // on the headers.
- for (OptionMap::iterator it = options_.begin();
- it != options_.end(); ++it) {
- delete it->second;
- }
- }
+ Config();
+ ~Config();
private:
struct BaseOption {
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 2925e08..72a471d 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -917,11 +917,6 @@
configs += [ "../..:common_config" ]
public_configs = [ "../..:common_inherited_config" ]
- if (is_clang) {
- # Suppress warnings from the Chromium Clang plugins (bugs.webrtc.org/163).
- configs -= [ "//build/config/clang:find_bad_constructs" ]
- }
-
defines = audio_coding_defines
deps = audio_coding_deps + [
@@ -943,12 +938,6 @@
configs += [ "../..:common_config" ]
public_configs = [ "../..:common_inherited_config" ]
- if (is_clang) {
- # Suppress warnings from Chrome's Clang plugins.
- # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
- configs -= [ "//build/config/clang:find_bad_constructs" ]
- }
-
deps = [
":audio_coding",
"../../:webrtc_common",
diff --git a/webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.cc b/webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.cc
index 84db491..e16e55b 100644
--- a/webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.cc
+++ b/webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.cc
@@ -47,6 +47,8 @@
acm_->RegisterTransportCallback(this);
}
+AcmSendTestOldApi::~AcmSendTestOldApi() = default;
+
bool AcmSendTestOldApi::RegisterCodec(const char* payload_name,
int sampling_freq_hz,
int channels,
diff --git a/webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.h b/webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.h
index c752878..50b51a5 100644
--- a/webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.h
+++ b/webrtc/modules/audio_coding/acm2/acm_send_test_oldapi.h
@@ -32,7 +32,7 @@
AcmSendTestOldApi(InputAudioFile* audio_source,
int source_rate_hz,
int test_duration_ms);
- virtual ~AcmSendTestOldApi() {}
+ ~AcmSendTestOldApi() override;
// Registers the send codec. Returns true on success, false otherwise.
bool RegisterCodec(const char* payload_name,
diff --git a/webrtc/modules/audio_coding/test/Channel.h b/webrtc/modules/audio_coding/test/Channel.h
index 5910fad..c45864a 100644
--- a/webrtc/modules/audio_coding/test/Channel.h
+++ b/webrtc/modules/audio_coding/test/Channel.h
@@ -47,7 +47,7 @@
public:
Channel(int16_t chID = -1);
- ~Channel();
+ ~Channel() override;
int32_t SendData(FrameType frameType,
uint8_t payloadType,
diff --git a/webrtc/modules/audio_coding/test/PCMFile.cc b/webrtc/modules/audio_coding/test/PCMFile.cc
index 9289d73..b4acf35 100644
--- a/webrtc/modules/audio_coding/test/PCMFile.cc
+++ b/webrtc/modules/audio_coding/test/PCMFile.cc
@@ -46,6 +46,12 @@
timestamp_ = timestamp;
}
+PCMFile::~PCMFile() {
+ if (pcm_file_) {
+ fclose(pcm_file_);
+ }
+}
+
int16_t PCMFile::ChooseFile(std::string* file_name, int16_t max_len,
uint16_t* frequency_hz) {
char tmp_name[MAX_FILE_NAME_LENGTH_BYTE];
diff --git a/webrtc/modules/audio_coding/test/PCMFile.h b/webrtc/modules/audio_coding/test/PCMFile.h
index 840933a..b5ced0b 100644
--- a/webrtc/modules/audio_coding/test/PCMFile.h
+++ b/webrtc/modules/audio_coding/test/PCMFile.h
@@ -26,11 +26,7 @@
public:
PCMFile();
PCMFile(uint32_t timestamp);
- ~PCMFile() {
- if (pcm_file_ != NULL) {
- fclose(pcm_file_);
- }
- }
+ ~PCMFile();
void Open(const std::string& filename, uint16_t frequency, const char* mode,
bool auto_rewind = false);
diff --git a/webrtc/modules/audio_coding/test/utility.h b/webrtc/modules/audio_coding/test/utility.h
index 23869be..dbd398e 100644
--- a/webrtc/modules/audio_coding/test/utility.h
+++ b/webrtc/modules/audio_coding/test/utility.h
@@ -118,10 +118,8 @@
class VADCallback : public ACMVADCallback {
public:
VADCallback();
- ~VADCallback() {
- }
- int32_t InFrameType(FrameType frame_type);
+ int32_t InFrameType(FrameType frame_type) override;
void PrintFrameTypes();
void Reset();