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
diff --git a/src/build/common.gypi b/src/build/common.gypi
index 297ab26..bd2f512 100644
--- a/src/build/common.gypi
+++ b/src/build/common.gypi
@@ -147,12 +147,11 @@
'WEBRTC_TARGET_PC',
],
# TODO(andrew): remove this block when possible.
- 'msvs_disabled_warnings': [4389], # Signed/unsigned mismatch.
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'WarnAsError': 'false',
- },
- },
+ # 4389: Signed/unsigned mismatch.
+ # 4373: MSVC legacy warning for ignoring const / volatile in
+ # signatures. TODO(phoglund): get rid of 4373 supression when
+ # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
+ 'msvs_disabled_warnings': [4389, 4373],
}],
], # conditions
}, # target_defaults
diff --git a/src/common_audio/signal_processing/signal_processing_unittest.cc b/src/common_audio/signal_processing/signal_processing_unittest.cc
index 606b269..f6d1123 100644
--- a/src/common_audio/signal_processing/signal_processing_unittest.cc
+++ b/src/common_audio/signal_processing/signal_processing_unittest.cc
@@ -41,12 +41,12 @@
EXPECT_EQ(-63, 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;
EXPECT_EQ(65535u, WEBRTC_SPL_UMUL_RSFT16(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(-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(-49149, WEBRTC_SPL_MUL_16_U16(a, b));
diff --git a/src/modules/audio_device/main/source/win/audio_device_utility_win.cc b/src/modules/audio_device/main/source/win/audio_device_utility_win.cc
index cd9c7ad1..3ef85ea 100644
--- a/src/modules/audio_device/main/source/win/audio_device_utility_win.cc
+++ b/src/modules/audio_device/main/source/win/audio_device_utility_win.cc
@@ -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
* that can be found in the LICENSE file in the root of the source
@@ -79,7 +79,7 @@
if (WideCharToMultiByte(CP_UTF8, 0, szOS, -1, os, STRING_MAX_SIZE, NULL, NULL) == 0)
{
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);
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, " OS info: %s", os);
diff --git a/src/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc b/src/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc
index aa1f7a4..7f3eb2e 100644
--- a/src/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc
+++ b/src/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc
@@ -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
* that can be found in the LICENSE file in the root of the source
@@ -39,7 +39,7 @@
(WebRtc_Word32)packetLength,
true); // Allow non-compound RTCP
- EXPECT_EQ(true, rtcpParser.IsValid());
+ EXPECT_TRUE(rtcpParser.IsValid());
RTCPHelp::RTCPPacketInformation rtcpPacketInformation;
EXPECT_EQ(0, rtcp_receiver_->IncomingRTCPPacket(rtcpPacketInformation,
&rtcpParser));
diff --git a/src/modules/rtp_rtcp/source/rtcp_sender_test.cc b/src/modules/rtp_rtcp/source/rtcp_sender_test.cc
index 96478a4..81e8665 100644
--- a/src/modules/rtp_rtcp/source/rtcp_sender_test.cc
+++ b/src/modules/rtp_rtcp/source/rtcp_sender_test.cc
@@ -72,7 +72,7 @@
(WebRtc_Word32)packet_len,
true); // Allow non-compound RTCP
- EXPECT_EQ(true, rtcpParser.IsValid());
+ EXPECT_TRUE(rtcpParser.IsValid());
RTCPHelp::RTCPPacketInformation rtcpPacketInformation;
EXPECT_EQ(0, rtcp_receiver_->IncomingRTCPPacket(rtcpPacketInformation,
&rtcpParser));
diff --git a/src/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.cc b/src/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.cc
index 35d9109..59e76ee 100644
--- a/src/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.cc
+++ b/src/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.cc
@@ -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
* that can be found in the LICENSE file in the root of the source
@@ -139,8 +139,8 @@
EXPECT_BIT_X_EQ(buffer_[0], 0);
}
- EXPECT_BIT_N_EQ(buffer_[0], hdr_info_->nonReference);
- EXPECT_BIT_S_EQ(buffer_[0], frag_start);
+ EXPECT_BIT_N_EQ(buffer_[0], hdr_info_->nonReference ? 1 : 0);
+ EXPECT_BIT_S_EQ(buffer_[0], frag_start ? 1 : 0);
// Check partition index.
if (!sloppy_partitioning_) {
@@ -201,11 +201,11 @@
if (hdr_info_->temporalIdx != kNoTemporalIdx) {
EXPECT_BIT_T_EQ(buffer_[1], 1);
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 {
EXPECT_BIT_T_EQ(buffer_[1], 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) {
EXPECT_BIT_K_EQ(buffer_[1], 1);
diff --git a/src/modules/rtp_rtcp/source/rtp_sender_test.cc b/src/modules/rtp_rtcp/source/rtp_sender_test.cc
index 90cfb72..4e8c78c 100644
--- a/src/modules/rtp_rtcp/source/rtp_sender_test.cc
+++ b/src/modules/rtp_rtcp/source/rtp_sender_test.cc
@@ -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
* that can be found in the LICENSE file in the root of the source
diff --git a/src/modules/rtp_rtcp/source/transmission_bucket.cc b/src/modules/rtp_rtcp/source/transmission_bucket.cc
index 4ba280b..e79d227 100644
--- a/src/modules/rtp_rtcp/source/transmission_bucket.cc
+++ b/src/modules/rtp_rtcp/source/transmission_bucket.cc
@@ -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
* that can be found in the LICENSE file in the root of the source
@@ -57,7 +57,7 @@
const uint16_t target_bitrate_kbps) {
webrtc::CriticalSectionScoped cs(*critsect_);
- const float kMargin = 1.05;
+ const float kMargin = 1.05f;
uint32_t bytes_per_interval =
kMargin * (target_bitrate_kbps * delta_time_ms / 8);
@@ -93,7 +93,7 @@
return seq_num;
}
- const float kFrameComplete = 0.80;
+ const float kFrameComplete = 0.80f;
if (num_bytes * kFrameComplete > bytes_rem_total_) {
// Packet does not fit.
return -1;
diff --git a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc
index 0f29843..599d3a53 100644
--- a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc
+++ b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc
@@ -402,7 +402,7 @@
vp8Info->pictureId = picture_id_;
vp8Info->simulcastIdx = 0;
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 (temporal_layers_) {
temporal_layers_->PopulateCodecSpecific(
diff --git a/src/video_engine/main/test/WindowsTest/ChannelDlg.cc b/src/video_engine/main/test/WindowsTest/ChannelDlg.cc
index 0f5c5c5..cccfa8e 100644
--- a/src/video_engine/main/test/WindowsTest/ChannelDlg.cc
+++ b/src/video_engine/main/test/WindowsTest/ChannelDlg.cc
@@ -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
* that can be found in the LICENSE file in the root of the source
@@ -205,7 +205,7 @@
m_ctrlMinFrameRate.SetCurSel(25);
// 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];
int width=0;
diff --git a/src/voice_engine/main/test/auto_test/standard/volume_test.cc b/src/voice_engine/main/test/auto_test/standard/volume_test.cc
index 71fafc6..460be5f 100644
--- a/src/voice_engine/main/test/auto_test/standard/volume_test.cc
+++ b/src/voice_engine/main/test/auto_test/standard/volume_test.cc
@@ -69,22 +69,22 @@
}
TEST_F(VolumeTest, ChannelScalingIsOneByDefault) {
- float scaling = -1.0;
+ float scaling = -1.0f;
EXPECT_EQ(0, voe_volume_control_->GetChannelOutputVolumeScaling(
channel_, scaling));
- EXPECT_FLOAT_EQ(1.0, scaling);
+ EXPECT_FLOAT_EQ(1.0f, scaling);
}
TEST_F(VolumeTest, ManualCanSetChannelScaling) {
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(
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");
Sleep(2000);
@@ -211,24 +211,24 @@
TEST_F(VolumeTest, ManualTestChannelPanning) {
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);
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);
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);
// To finish, verify that the getter works.
- float left = 0.0;
- float right = 0.0;
+ float left = 0.0f;
+ float right = 0.0f;
EXPECT_EQ(0, voe_volume_control_->GetOutputVolumePan(channel_, left, right));
- EXPECT_FLOAT_EQ(0.1, left);
- EXPECT_FLOAT_EQ(0.8, right);
+ EXPECT_FLOAT_EQ(0.1f, left);
+ EXPECT_FLOAT_EQ(0.8f, right);
}
#endif // !WEBRTC_ANDROID && !MAC_IPHONE