Fixing/disabling Windows x64 warnings
Disabled MSVC #4267 warnings in common.gypi to enable x64 builds
for Windows.
Fixed MSVC #4267 warnings in test/testsupport.
Added third_party/directxsdk to .gitignore.
With http://review.webrtc.org/1070008 landed, this should make it possible
to build for x64 on Windows.
BUG=1348
TEST=Compiling with http://review.webrtc.org/1070008 applied:
set GYP_DEFINES="target_arch=x64"
set GYP_GENERATORS=ninja
gclient sync
ninja -C out\Debug_x64
Review URL: https://webrtc-codereview.appspot.com/1060008
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3464 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/.gitignore b/.gitignore
index 42bf048..d5d64cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,6 +42,7 @@
/testing
/third_party/asan
/third_party/cygwin
+/third_party/directxsdk
/third_party/expat
/third_party/gaeunit
/third_party/gold
diff --git a/webrtc/build/common.gypi b/webrtc/build/common.gypi
index a460a1d..3bcf782 100644
--- a/webrtc/build/common.gypi
+++ b/webrtc/build/common.gypi
@@ -221,12 +221,12 @@
'WEBRTC_WIN',
],
# TODO(andrew): enable all warnings when possible.
- # 4389: Signed/unsigned mismatch.
- # 4373: MSVC legacy warning for ignoring const / volatile in
- # signatures. TODO(phoglund): get rid of 4373 supression when
+ # 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],
-
+ 'msvs_disabled_warnings': [
+ 4373, # legacy warning for ignoring const / volatile in signatures.
+ 4389, # Signed/unsigned mismatch.
+ ],
# Re-enable some warnings that Chromium disables.
'msvs_disabled_warnings!': [4189,],
}],
diff --git a/webrtc/common_video/common_video.gyp b/webrtc/common_video/common_video.gyp
index 36e2ee5..05ddd9d 100644
--- a/webrtc/common_video/common_video.gyp
+++ b/webrtc/common_video/common_video.gyp
@@ -89,6 +89,10 @@
'libyuv/scaler_unittest.cc',
'plane_unittest.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
], # targets
}], # include_tests
diff --git a/webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi b/webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi
index ce2f46c..4bac161 100644
--- a/webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi
+++ b/webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi
@@ -23,6 +23,10 @@
'sources': [
'./fix/test/kenny.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
],
}
diff --git a/webrtc/modules/audio_coding/main/source/audio_coding_module.gypi b/webrtc/modules/audio_coding/main/source/audio_coding_module.gypi
index 3de7805..aba15ef 100644
--- a/webrtc/modules/audio_coding/main/source/audio_coding_module.gypi
+++ b/webrtc/modules/audio_coding/main/source/audio_coding_module.gypi
@@ -211,6 +211,10 @@
'../../neteq4/mock/mock_packet_buffer.h',
'../../neteq4/mock/mock_payload_splitter.h',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
}, # audio_coding_unittests
],
}],
diff --git a/webrtc/modules/audio_coding/neteq/neteq.gypi b/webrtc/modules/audio_coding/neteq/neteq.gypi
index 371a6da..fcdb1b5 100644
--- a/webrtc/modules/audio_coding/neteq/neteq.gypi
+++ b/webrtc/modules/audio_coding/neteq/neteq.gypi
@@ -99,6 +99,10 @@
'sources': [
'webrtc_neteq_unittest.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
}, # neteq_unittests
{
'target_name': 'NetEqRTPplay',
@@ -137,6 +141,10 @@
'sources': [
'test/NetEqRTPplay.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
{
@@ -193,6 +201,10 @@
'test/NETEQTEST_RTPpacket.cc',
'test/NETEQTEST_RTPpacket.h',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
], # targets
}], # include_tests
diff --git a/webrtc/modules/audio_coding/neteq4/neteq.gypi b/webrtc/modules/audio_coding/neteq4/neteq.gypi
index d6d4fee..5f8ad0a 100644
--- a/webrtc/modules/audio_coding/neteq4/neteq.gypi
+++ b/webrtc/modules/audio_coding/neteq4/neteq.gypi
@@ -113,6 +113,10 @@
'time_stretch.cc',
'time_stretch.h',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
], # targets
'conditions': [
@@ -144,7 +148,11 @@
'audio_decoder.cc',
'interface/audio_decoder.h',
],
- }, # audio_decoder_unittest
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
+ }, # audio_decoder_unittests
{
'target_name': 'neteq_unittest_tools',
@@ -168,6 +176,10 @@
'tools/rtp_generator.cc',
'tools/rtp_generator.h',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
}, # neteq_unittest_tools
], # targets
}], # include_tests
diff --git a/webrtc/modules/audio_coding/neteq4/neteq_tests.gypi b/webrtc/modules/audio_coding/neteq4/neteq_tests.gypi
index aa85f74..4a9d643 100644
--- a/webrtc/modules/audio_coding/neteq4/neteq_tests.gypi
+++ b/webrtc/modules/audio_coding/neteq4/neteq_tests.gypi
@@ -60,6 +60,10 @@
'sources': [
'test/RTPencode.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
{
@@ -168,6 +172,10 @@
'test/NETEQTEST_RTPpacket.cc',
'test/NETEQTEST_RTPpacket.h',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
], # targets
}
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi
index 4ca6819..5bfb77a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_tests.gypi
@@ -45,6 +45,10 @@
'rtcp_receiver_unittest.cc',
'vp8_partition_aggregator_unittest.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
],
}
diff --git a/webrtc/modules/udp_transport/source/udp_transport.gypi b/webrtc/modules/udp_transport/source/udp_transport.gypi
index 92ade75..a73a587 100644
--- a/webrtc/modules/udp_transport/source/udp_transport.gypi
+++ b/webrtc/modules/udp_transport/source/udp_transport.gypi
@@ -97,6 +97,10 @@
'udp_socket_manager_unittest.cc',
'udp_socket_wrapper_unittest.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
}, # udp_transport_unittests
], # targets
}], # include_tests
diff --git a/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi b/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi
index 02ac465..6fe76f7 100644
--- a/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi
+++ b/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi
@@ -19,10 +19,14 @@
'<(DEPTH)/third_party/google-gflags/google-gflags.gyp:google-gflags',
'<(webrtc_root)/test/metrics.gyp:metrics',
'<(webrtc_vp8_dir)/vp8.gyp:webrtc_vp8',
- ],
- 'sources': [
- 'video_quality_measurement.cc',
- ],
+ ],
+ 'sources': [
+ 'video_quality_measurement.cc',
+ ],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
], # targets
}], # include_tests
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8.gyp b/webrtc/modules/video_coding/codecs/vp8/vp8.gyp
index 196de43..a53ea29 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8.gyp
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8.gyp
@@ -73,6 +73,10 @@
'include/vp8_common_types.h',
'vp8_impl.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
], # targets
'conditions': [
diff --git a/webrtc/modules/video_coding/main/source/video_coding_test.gypi b/webrtc/modules/video_coding/main/source/video_coding_test.gypi
index 25f82c6..b453c57 100644
--- a/webrtc/modules/video_coding/main/source/video_coding_test.gypi
+++ b/webrtc/modules/video_coding/main/source/video_coding_test.gypi
@@ -93,6 +93,10 @@
'../../codecs/test/stats_unittest.cc',
'../../codecs/test/videoprocessor_unittest.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
],
}
diff --git a/webrtc/system_wrappers/source/system_wrappers.gyp b/webrtc/system_wrappers/source/system_wrappers.gyp
index b0903b2..71da723 100644
--- a/webrtc/system_wrappers/source/system_wrappers.gyp
+++ b/webrtc/system_wrappers/source/system_wrappers.gyp
@@ -187,8 +187,11 @@
],
}],
],
- # Ignore warning on shift operator promotion.
- 'msvs_disabled_warnings': [ 4334, ],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ 4334, # Ignore warning on shift operator promotion.
+ ],
},
], # targets
'conditions': [
@@ -270,6 +273,10 @@
'sources!': [ 'thread_posix_unittest.cc', ],
}],
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
], # targets
}], # include_tests
diff --git a/webrtc/test/testsupport/frame_reader.cc b/webrtc/test/testsupport/frame_reader.cc
index b05ea58..8fea9f3 100644
--- a/webrtc/test/testsupport/frame_reader.cc
+++ b/webrtc/test/testsupport/frame_reader.cc
@@ -30,7 +30,7 @@
bool FrameReaderImpl::Init() {
if (frame_length_in_bytes_ <= 0) {
- fprintf(stderr, "Frame length must be >0, was %d\n",
+ fprintf(stderr, "Frame length must be >0, was %zu\n",
frame_length_in_bytes_);
return false;
}
@@ -46,7 +46,8 @@
fprintf(stderr, "Found empty file: %s\n", input_filename_.c_str());
return false;
}
- number_of_frames_ = source_file_size / frame_length_in_bytes_;
+ number_of_frames_ = static_cast<int>(source_file_size /
+ frame_length_in_bytes_);
return true;
}
diff --git a/webrtc/test/testsupport/frame_reader.h b/webrtc/test/testsupport/frame_reader.h
index 56d8fc4..831f58f 100644
--- a/webrtc/test/testsupport/frame_reader.h
+++ b/webrtc/test/testsupport/frame_reader.h
@@ -40,7 +40,7 @@
virtual void Close() = 0;
// Frame length in bytes of a single frame image.
- virtual int FrameLength() = 0;
+ virtual size_t FrameLength() = 0;
// Total number of frames in the input video source.
virtual int NumberOfFrames() = 0;
};
@@ -57,12 +57,12 @@
bool Init();
bool ReadFrame(WebRtc_UWord8* source_buffer);
void Close();
- int FrameLength() { return frame_length_in_bytes_; }
+ size_t FrameLength() { return frame_length_in_bytes_; }
int NumberOfFrames() { return number_of_frames_; }
private:
std::string input_filename_;
- int frame_length_in_bytes_;
+ size_t frame_length_in_bytes_;
int number_of_frames_;
FILE* input_file_;
};
diff --git a/webrtc/test/testsupport/frame_reader_unittest.cc b/webrtc/test/testsupport/frame_reader_unittest.cc
index f1da5ce..dadeaff 100644
--- a/webrtc/test/testsupport/frame_reader_unittest.cc
+++ b/webrtc/test/testsupport/frame_reader_unittest.cc
@@ -20,7 +20,7 @@
const std::string kInputFileContents = "baz";
// Setting the kFrameLength value to a value much larger than the
// file to test causes the ReadFrame test to fail on Windows.
-const int kFrameLength = 1000;
+const size_t kFrameLength = 1000;
class FrameReaderTest: public testing::Test {
protected:
diff --git a/webrtc/test/testsupport/frame_writer.cc b/webrtc/test/testsupport/frame_writer.cc
index 5f32539..3d5a109 100644
--- a/webrtc/test/testsupport/frame_writer.cc
+++ b/webrtc/test/testsupport/frame_writer.cc
@@ -28,7 +28,7 @@
bool FrameWriterImpl::Init() {
if (frame_length_in_bytes_ <= 0) {
- fprintf(stderr, "Frame length must be >0, was %d\n",
+ fprintf(stderr, "Frame length must be >0, was %zu\n",
frame_length_in_bytes_);
return false;
}
@@ -54,10 +54,10 @@
fprintf(stderr, "FrameWriter is not initialized (output file is NULL)\n");
return false;
}
- int bytes_written = fwrite(frame_buffer, 1, frame_length_in_bytes_,
- output_file_);
+ size_t bytes_written = fwrite(frame_buffer, 1, frame_length_in_bytes_,
+ output_file_);
if (bytes_written != frame_length_in_bytes_) {
- fprintf(stderr, "Failed to write %d bytes to file %s\n",
+ fprintf(stderr, "Failed to write %zu bytes to file %s\n",
frame_length_in_bytes_, output_filename_.c_str());
return false;
}
diff --git a/webrtc/test/testsupport/frame_writer.h b/webrtc/test/testsupport/frame_writer.h
index e91a299..4df4ffe 100644
--- a/webrtc/test/testsupport/frame_writer.h
+++ b/webrtc/test/testsupport/frame_writer.h
@@ -38,7 +38,7 @@
virtual void Close() = 0;
// Frame length in bytes of a single frame image.
- virtual int FrameLength() = 0;
+ virtual size_t FrameLength() = 0;
};
class FrameWriterImpl : public FrameWriter {
@@ -55,11 +55,11 @@
bool Init();
bool WriteFrame(WebRtc_UWord8* frame_buffer);
void Close();
- int FrameLength() { return frame_length_in_bytes_; }
+ size_t FrameLength() { return frame_length_in_bytes_; }
private:
std::string output_filename_;
- int frame_length_in_bytes_;
+ size_t frame_length_in_bytes_;
FILE* output_file_;
};
diff --git a/webrtc/test/testsupport/frame_writer_unittest.cc b/webrtc/test/testsupport/frame_writer_unittest.cc
index d25d1d2..52185dd 100644
--- a/webrtc/test/testsupport/frame_writer_unittest.cc
+++ b/webrtc/test/testsupport/frame_writer_unittest.cc
@@ -17,7 +17,7 @@
namespace test {
const std::string kOutputFilename = "temp_outputfile.tmp";
-const int kFrameLength = 1000;
+const size_t kFrameLength = 1000;
class FrameWriterTest: public testing::Test {
protected:
@@ -50,8 +50,7 @@
ASSERT_TRUE(result); // success
// Close the file and verify the size.
frame_writer_->Close();
- ASSERT_EQ(kFrameLength,
- static_cast<int>(GetFileSize(kOutputFilename)));
+ ASSERT_EQ(kFrameLength, GetFileSize(kOutputFilename));
}
TEST_F(FrameWriterTest, WriteFrameUninitialized) {
diff --git a/webrtc/test/testsupport/mock/mock_frame_reader.h b/webrtc/test/testsupport/mock/mock_frame_reader.h
index ecfc13c..f22dcd1 100644
--- a/webrtc/test/testsupport/mock/mock_frame_reader.h
+++ b/webrtc/test/testsupport/mock/mock_frame_reader.h
@@ -23,7 +23,7 @@
MOCK_METHOD0(Init, bool());
MOCK_METHOD1(ReadFrame, bool(WebRtc_UWord8* source_buffer));
MOCK_METHOD0(Close, void());
- MOCK_METHOD0(FrameLength, int());
+ MOCK_METHOD0(FrameLength, size_t());
MOCK_METHOD0(NumberOfFrames, int());
};
diff --git a/webrtc/test/testsupport/mock/mock_frame_writer.h b/webrtc/test/testsupport/mock/mock_frame_writer.h
index ba79184..89650c9 100644
--- a/webrtc/test/testsupport/mock/mock_frame_writer.h
+++ b/webrtc/test/testsupport/mock/mock_frame_writer.h
@@ -23,7 +23,7 @@
MOCK_METHOD0(Init, bool());
MOCK_METHOD1(WriteFrame, bool(WebRtc_UWord8* frame_buffer));
MOCK_METHOD0(Close, void());
- MOCK_METHOD0(FrameLength, int());
+ MOCK_METHOD0(FrameLength, size_t());
};
} // namespace test
diff --git a/webrtc/tools/tools.gyp b/webrtc/tools/tools.gyp
index 48949ed..3a6787e 100644
--- a/webrtc/tools/tools.gyp
+++ b/webrtc/tools/tools.gyp
@@ -86,6 +86,10 @@
'frame_editing/frame_editing_lib.cc',
'frame_editing/frame_editing_lib.h',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
}, # frame_editing_lib
{
'target_name': 'frame_editor',
@@ -115,6 +119,10 @@
'simple_command_line_parser_unittest.cc',
'frame_editing/frame_editing_unittest.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
}, # tools_unittests
], # targets
}], # include_tests
diff --git a/webrtc/video_engine/test/auto_test/vie_auto_test.gypi b/webrtc/video_engine/test/auto_test/vie_auto_test.gypi
index df6ad1b..984cc75 100644
--- a/webrtc/video_engine/test/auto_test/vie_auto_test.gypi
+++ b/webrtc/video_engine/test/auto_test/vie_auto_test.gypi
@@ -130,6 +130,10 @@
},
}],
], # conditions
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
],
}
diff --git a/webrtc/video_engine/test/libvietest/libvietest.gypi b/webrtc/video_engine/test/libvietest/libvietest.gypi
index e8f3ac7..ab14de6 100644
--- a/webrtc/video_engine/test/libvietest/libvietest.gypi
+++ b/webrtc/video_engine/test/libvietest/libvietest.gypi
@@ -51,6 +51,10 @@
'testbed/tb_interfaces.cc',
'testbed/tb_video_channel.cc',
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
],
'conditions': [
diff --git a/webrtc/voice_engine/test/voice_engine_tests.gypi b/webrtc/voice_engine/test/voice_engine_tests.gypi
index efa272d..d02ef08 100644
--- a/webrtc/voice_engine/test/voice_engine_tests.gypi
+++ b/webrtc/voice_engine/test/voice_engine_tests.gypi
@@ -88,6 +88,10 @@
],
}],
],
+ # Disable warnings to enable Win64 build, issue 1323.
+ 'msvs_disabled_warnings': [
+ 4267, # size_t to int truncation.
+ ],
},
{
# command line test that should work on linux/mac/win