Removed warnings on Windows and enabled warnings-as-errors on Windows.

BUG=
TEST=

Review URL: https://webrtc-codereview.appspot.com/377004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1624 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2012-02-07 14:56:45 +00:00
parent 87885e8409
commit 78088c2f36
11 changed files with 36 additions and 37 deletions

View File

@ -147,12 +147,11 @@
'WEBRTC_TARGET_PC', 'WEBRTC_TARGET_PC',
], ],
# TODO(andrew): remove this block when possible. # TODO(andrew): remove this block when possible.
'msvs_disabled_warnings': [4389], # Signed/unsigned mismatch. # 4389: Signed/unsigned mismatch.
'msvs_settings': { # 4373: MSVC legacy warning for ignoring const / volatile in
'VCCLCompilerTool': { # signatures. TODO(phoglund): get rid of 4373 supression when
'WarnAsError': 'false', # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
}, 'msvs_disabled_warnings': [4389, 4373],
},
}], }],
], # conditions ], # conditions
}, # target_defaults }, # target_defaults

View File

@ -41,12 +41,12 @@ TEST_F(SplTest, MacroTest) {
EXPECT_EQ(-63, WEBRTC_SPL_MUL(a, B)); EXPECT_EQ(-63, WEBRTC_SPL_MUL(a, B));
EXPECT_EQ(-2147483645, WEBRTC_SPL_MUL(a, b)); EXPECT_EQ(-2147483645, WEBRTC_SPL_MUL(a, b));
EXPECT_EQ(-2147483645u, WEBRTC_SPL_UMUL(a, b)); EXPECT_EQ(2147483651u, WEBRTC_SPL_UMUL(a, b));
b = WEBRTC_SPL_WORD16_MAX >> 1; b = WEBRTC_SPL_WORD16_MAX >> 1;
EXPECT_EQ(65535u, WEBRTC_SPL_UMUL_RSFT16(a, b)); EXPECT_EQ(65535u, WEBRTC_SPL_UMUL_RSFT16(a, b));
EXPECT_EQ(1073627139u, WEBRTC_SPL_UMUL_16_16(a, b)); EXPECT_EQ(1073627139u, WEBRTC_SPL_UMUL_16_16(a, b));
EXPECT_EQ(16382u, WEBRTC_SPL_UMUL_16_16_RSFT16(a, b)); EXPECT_EQ(16382u, WEBRTC_SPL_UMUL_16_16_RSFT16(a, b));
EXPECT_EQ(-49149u, WEBRTC_SPL_UMUL_32_16(a, b)); EXPECT_EQ(4294918147u, WEBRTC_SPL_UMUL_32_16(a, b));
EXPECT_EQ(65535u, WEBRTC_SPL_UMUL_32_16_RSFT16(a, b)); EXPECT_EQ(65535u, WEBRTC_SPL_UMUL_32_16_RSFT16(a, b));
EXPECT_EQ(-49149, WEBRTC_SPL_MUL_16_U16(a, b)); EXPECT_EQ(-49149, WEBRTC_SPL_MUL_16_U16(a, b));

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * 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 * that can be found in the LICENSE file in the root of the source
@ -79,7 +79,7 @@ WebRtc_Word32 AudioDeviceUtilityWindows::Init()
if (WideCharToMultiByte(CP_UTF8, 0, szOS, -1, os, STRING_MAX_SIZE, NULL, NULL) == 0) if (WideCharToMultiByte(CP_UTF8, 0, szOS, -1, os, STRING_MAX_SIZE, NULL, NULL) == 0)
{ {
DWORD err = GetLastError(); DWORD err = GetLastError();
sprintf(os, "Could not get OS info"); strncpy(os, "Could not get OS info", STRING_MAX_SIZE);
} }
// DEBUG_PRINTP("OS info: %s\n", os); // DEBUG_PRINTP("OS info: %s\n", os);
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, " OS info: %s", os); WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, " OS info: %s", os);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * 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 * that can be found in the LICENSE file in the root of the source
@ -39,7 +39,7 @@ class TestTransport : public Transport {
(WebRtc_Word32)packetLength, (WebRtc_Word32)packetLength,
true); // Allow non-compound RTCP true); // Allow non-compound RTCP
EXPECT_EQ(true, rtcpParser.IsValid()); EXPECT_TRUE(rtcpParser.IsValid());
RTCPHelp::RTCPPacketInformation rtcpPacketInformation; RTCPHelp::RTCPPacketInformation rtcpPacketInformation;
EXPECT_EQ(0, rtcp_receiver_->IncomingRTCPPacket(rtcpPacketInformation, EXPECT_EQ(0, rtcp_receiver_->IncomingRTCPPacket(rtcpPacketInformation,
&rtcpParser)); &rtcpParser));

View File

@ -72,7 +72,7 @@ class TestTransport : public Transport,
(WebRtc_Word32)packet_len, (WebRtc_Word32)packet_len,
true); // Allow non-compound RTCP true); // Allow non-compound RTCP
EXPECT_EQ(true, rtcpParser.IsValid()); EXPECT_TRUE(rtcpParser.IsValid());
RTCPHelp::RTCPPacketInformation rtcpPacketInformation; RTCPHelp::RTCPPacketInformation rtcpPacketInformation;
EXPECT_EQ(0, rtcp_receiver_->IncomingRTCPPacket(rtcpPacketInformation, EXPECT_EQ(0, rtcp_receiver_->IncomingRTCPPacket(rtcpPacketInformation,
&rtcpParser)); &rtcpParser));

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * 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 * that can be found in the LICENSE file in the root of the source
@ -139,8 +139,8 @@ void RtpFormatVp8TestHelper::CheckHeader(bool frag_start) {
EXPECT_BIT_X_EQ(buffer_[0], 0); EXPECT_BIT_X_EQ(buffer_[0], 0);
} }
EXPECT_BIT_N_EQ(buffer_[0], hdr_info_->nonReference); EXPECT_BIT_N_EQ(buffer_[0], hdr_info_->nonReference ? 1 : 0);
EXPECT_BIT_S_EQ(buffer_[0], frag_start); EXPECT_BIT_S_EQ(buffer_[0], frag_start ? 1 : 0);
// Check partition index. // Check partition index.
if (!sloppy_partitioning_) { if (!sloppy_partitioning_) {
@ -201,11 +201,11 @@ void RtpFormatVp8TestHelper::CheckTIDAndKeyIdx() {
if (hdr_info_->temporalIdx != kNoTemporalIdx) { if (hdr_info_->temporalIdx != kNoTemporalIdx) {
EXPECT_BIT_T_EQ(buffer_[1], 1); EXPECT_BIT_T_EQ(buffer_[1], 1);
EXPECT_TID_EQ(buffer_[payload_start_], hdr_info_->temporalIdx); EXPECT_TID_EQ(buffer_[payload_start_], hdr_info_->temporalIdx);
EXPECT_BIT_Y_EQ(buffer_[payload_start_], hdr_info_->layerSync); EXPECT_BIT_Y_EQ(buffer_[payload_start_], hdr_info_->layerSync ? 1 : 0);
} else { } else {
EXPECT_BIT_T_EQ(buffer_[1], 0); EXPECT_BIT_T_EQ(buffer_[1], 0);
EXPECT_TID_EQ(buffer_[payload_start_], 0); EXPECT_TID_EQ(buffer_[payload_start_], 0);
EXPECT_BIT_Y_EQ(buffer_[payload_start_], false); EXPECT_BIT_Y_EQ(buffer_[payload_start_], 0);
} }
if (hdr_info_->keyIdx != kNoKeyIdx) { if (hdr_info_->keyIdx != kNoKeyIdx) {
EXPECT_BIT_K_EQ(buffer_[1], 1); EXPECT_BIT_K_EQ(buffer_[1], 1);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * 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 * that can be found in the LICENSE file in the root of the source

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * 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 * that can be found in the LICENSE file in the root of the source
@ -57,7 +57,7 @@ void TransmissionBucket::UpdateBytesPerInterval(
const uint16_t target_bitrate_kbps) { const uint16_t target_bitrate_kbps) {
webrtc::CriticalSectionScoped cs(*critsect_); webrtc::CriticalSectionScoped cs(*critsect_);
const float kMargin = 1.05; const float kMargin = 1.05f;
uint32_t bytes_per_interval = uint32_t bytes_per_interval =
kMargin * (target_bitrate_kbps * delta_time_ms / 8); kMargin * (target_bitrate_kbps * delta_time_ms / 8);
@ -93,7 +93,7 @@ int32_t TransmissionBucket::GetNextPacket() {
return seq_num; return seq_num;
} }
const float kFrameComplete = 0.80; const float kFrameComplete = 0.80f;
if (num_bytes * kFrameComplete > bytes_rem_total_) { if (num_bytes * kFrameComplete > bytes_rem_total_) {
// Packet does not fit. // Packet does not fit.
return -1; return -1;

View File

@ -402,7 +402,7 @@ void VP8Encoder::PopulateCodecSpecific(CodecSpecificInfo* codec_specific,
vp8Info->pictureId = picture_id_; vp8Info->pictureId = picture_id_;
vp8Info->simulcastIdx = 0; vp8Info->simulcastIdx = 0;
vp8Info->keyIdx = kNoKeyIdx; // TODO(hlundin) populate this vp8Info->keyIdx = kNoKeyIdx; // TODO(hlundin) populate this
vp8Info->nonReference = (pkt.data.frame.flags & VPX_FRAME_IS_DROPPABLE); vp8Info->nonReference = (pkt.data.frame.flags & VPX_FRAME_IS_DROPPABLE) != 0;
#if WEBRTC_LIBVPX_VERSION >= 971 #if WEBRTC_LIBVPX_VERSION >= 971
if (temporal_layers_) { if (temporal_layers_) {
temporal_layers_->PopulateCodecSpecific( temporal_layers_->PopulateCodecSpecific(

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * 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 * that can be found in the LICENSE file in the root of the source
@ -205,7 +205,7 @@ BOOL CDXChannelDlg::OnInitDialog()
m_ctrlMinFrameRate.SetCurSel(25); m_ctrlMinFrameRate.SetCurSel(25);
// Codec sizes // Codec sizes
for(VideoSize i=VideoSize::UNDEFINED;i<VideoSize::NUMBER_OF_VIDEO_SIZE;i=VideoSize(i+1)) for(VideoSize i=UNDEFINED;i<NUMBER_OF_VIDEO_SIZE;i=VideoSize(i+1))
{ {
char sizeStr[64]; char sizeStr[64];
int width=0; int width=0;

View File

@ -69,22 +69,22 @@ TEST_F(VolumeTest, ManualRequiresMicrophoneCanSetMicrophoneVolumeWithAcgOff) {
} }
TEST_F(VolumeTest, ChannelScalingIsOneByDefault) { TEST_F(VolumeTest, ChannelScalingIsOneByDefault) {
float scaling = -1.0; float scaling = -1.0f;
EXPECT_EQ(0, voe_volume_control_->GetChannelOutputVolumeScaling( EXPECT_EQ(0, voe_volume_control_->GetChannelOutputVolumeScaling(
channel_, scaling)); channel_, scaling));
EXPECT_FLOAT_EQ(1.0, scaling); EXPECT_FLOAT_EQ(1.0f, scaling);
} }
TEST_F(VolumeTest, ManualCanSetChannelScaling) { TEST_F(VolumeTest, ManualCanSetChannelScaling) {
EXPECT_EQ(0, voe_volume_control_->SetChannelOutputVolumeScaling( EXPECT_EQ(0, voe_volume_control_->SetChannelOutputVolumeScaling(
channel_, 0.1)); channel_, 0.1f));
float scaling = 1.0; float scaling = 1.0f;
EXPECT_EQ(0, voe_volume_control_->GetChannelOutputVolumeScaling( EXPECT_EQ(0, voe_volume_control_->GetChannelOutputVolumeScaling(
channel_, scaling)); channel_, scaling));
EXPECT_FLOAT_EQ(0.1, scaling); EXPECT_FLOAT_EQ(0.1f, scaling);
TEST_LOG("Channel scaling set to 0.1: audio should be barely audible.\n"); TEST_LOG("Channel scaling set to 0.1: audio should be barely audible.\n");
Sleep(2000); Sleep(2000);
@ -211,24 +211,24 @@ TEST_F(VolumeTest, ChannelsAreNotPannedByDefault) {
TEST_F(VolumeTest, ManualTestChannelPanning) { TEST_F(VolumeTest, ManualTestChannelPanning) {
TEST_LOG("Panning left.\n"); TEST_LOG("Panning left.\n");
EXPECT_EQ(0, voe_volume_control_->SetOutputVolumePan(channel_, 0.8, 0.1)); EXPECT_EQ(0, voe_volume_control_->SetOutputVolumePan(channel_, 0.8f, 0.1f));
Sleep(1000); Sleep(1000);
TEST_LOG("Back to center.\n"); TEST_LOG("Back to center.\n");
EXPECT_EQ(0, voe_volume_control_->SetOutputVolumePan(channel_, 1.0, 1.0)); EXPECT_EQ(0, voe_volume_control_->SetOutputVolumePan(channel_, 1.0f, 1.0f));
Sleep(1000); Sleep(1000);
TEST_LOG("Panning right.\n"); TEST_LOG("Panning right.\n");
EXPECT_EQ(0, voe_volume_control_->SetOutputVolumePan(channel_, 0.1, 0.8)); EXPECT_EQ(0, voe_volume_control_->SetOutputVolumePan(channel_, 0.1f, 0.8f));
Sleep(1000); Sleep(1000);
// To finish, verify that the getter works. // To finish, verify that the getter works.
float left = 0.0; float left = 0.0f;
float right = 0.0; float right = 0.0f;
EXPECT_EQ(0, voe_volume_control_->GetOutputVolumePan(channel_, left, right)); EXPECT_EQ(0, voe_volume_control_->GetOutputVolumePan(channel_, left, right));
EXPECT_FLOAT_EQ(0.1, left); EXPECT_FLOAT_EQ(0.1f, left);
EXPECT_FLOAT_EQ(0.8, right); EXPECT_FLOAT_EQ(0.8f, right);
} }
#endif // !WEBRTC_ANDROID && !MAC_IPHONE #endif // !WEBRTC_ANDROID && !MAC_IPHONE