Enable clang::find_bad_constructs for sdk/ (part 1).

This CL removes //build/config/clang:find_bad_constructs from the
suppressed_configs list, which means that clang:find_bad_constructs
is now enabled on these translation units.

Bug: webrtc:9251, webrtc:163
Change-Id: I6f03c46e772ccf4d15951a4b9d4e12015d539e58
Reviewed-on: https://webrtc-review.googlesource.com/90408
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24113}
This commit is contained in:
Mirko Bonadei
2018-07-26 12:20:40 +02:00
committed by Commit Bot
parent a15fd0dee6
commit 17aff35e1d
21 changed files with 97 additions and 164 deletions

View File

@ -31,7 +31,7 @@ class ObjCCallbackVideoSink : public rtc::VideoSinkInterface<webrtc::VideoFrame>
public:
ObjCCallbackVideoSink(VideoSinkCallback callback) : callback_(callback) {}
virtual void OnFrame(const webrtc::VideoFrame &frame) {
void OnFrame(const webrtc::VideoFrame &frame) override {
callback_(NativeToObjCVideoFrame(frame));
}

View File

@ -43,7 +43,7 @@ typedef int32_t(^RecordedDataIsAvailableBlock)(const void* audioSamples,
class MockAudioTransport : public webrtc::AudioTransport {
public:
MockAudioTransport() {}
~MockAudioTransport() {}
~MockAudioTransport() override {}
void expectNeedMorePlayData(NeedMorePlayDataBlock block) {
needMorePlayDataBlock = block;
@ -60,7 +60,7 @@ public:
void* audioSamples,
size_t& nSamplesOut,
int64_t* elapsed_time_ms,
int64_t* ntp_time_ms) {
int64_t* ntp_time_ms) override {
return needMorePlayDataBlock(nSamples,
nBytesPerSample,
nChannels,
@ -80,7 +80,7 @@ public:
const int32_t clockDrift,
const uint32_t currentMicLevel,
const bool keyPressed,
uint32_t& newMicLevel) {
uint32_t& newMicLevel) override {
return recordedDataIsAvailableBlock(audioSamples,
nSamples,
nBytesPerSample,
@ -99,11 +99,9 @@ public:
size_t number_of_frames,
void* audio_data,
int64_t* elapsed_time_ms,
int64_t* ntp_time_ms) {
int64_t* ntp_time_ms) override {}
}
private:
private:
NeedMorePlayDataBlock needMorePlayDataBlock;
RecordedDataIsAvailableBlock recordedDataIsAvailableBlock;
};

View File

@ -299,7 +299,7 @@ namespace webrtc {
class AudioSessionTest : public ::testing::Test {
protected:
void TearDown() {
void TearDown() override {
RTCAudioSession *session = [RTCAudioSession sharedInstance];
for (id<RTCAudioSessionDelegate> delegate : session.delegates) {
[session removeDelegate:delegate];

View File

@ -56,14 +56,14 @@ std::unique_ptr<webrtc::VideoDecoder> GetObjCDecoder(id<RTCVideoDecoderFactory>
TEST(ObjCVideoDecoderFactoryTest, InitDecodeReturnsOKOnSuccess) {
std::unique_ptr<webrtc::VideoDecoder> decoder = GetObjCDecoder(CreateOKDecoderFactory());
auto settings = new webrtc::VideoCodec();
auto* settings = new webrtc::VideoCodec();
EXPECT_EQ(decoder->InitDecode(settings, 1), WEBRTC_VIDEO_CODEC_OK);
}
TEST(ObjCVideoDecoderFactoryTest, InitDecodeReturnsErrorOnFail) {
std::unique_ptr<webrtc::VideoDecoder> decoder = GetObjCDecoder(CreateErrorDecoderFactory());
auto settings = new webrtc::VideoCodec();
auto* settings = new webrtc::VideoCodec();
EXPECT_EQ(decoder->InitDecode(settings, 1), WEBRTC_VIDEO_CODEC_ERROR);
}

View File

@ -58,14 +58,14 @@ std::unique_ptr<webrtc::VideoEncoder> GetObjCEncoder(id<RTCVideoEncoderFactory>
TEST(ObjCVideoEncoderFactoryTest, InitEncodeReturnsOKOnSuccess) {
std::unique_ptr<webrtc::VideoEncoder> encoder = GetObjCEncoder(CreateOKEncoderFactory());
auto settings = new webrtc::VideoCodec();
auto* settings = new webrtc::VideoCodec();
EXPECT_EQ(encoder->InitEncode(settings, 1, 0), WEBRTC_VIDEO_CODEC_OK);
}
TEST(ObjCVideoEncoderFactoryTest, InitEncodeReturnsErrorOnFail) {
std::unique_ptr<webrtc::VideoEncoder> encoder = GetObjCEncoder(CreateErrorEncoderFactory());
auto settings = new webrtc::VideoCodec();
auto* settings = new webrtc::VideoCodec();
EXPECT_EQ(encoder->InitEncode(settings, 1, 0), WEBRTC_VIDEO_CODEC_ERROR);
}