diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-18 19:50:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-18 19:50:19 +0100 |
| commit | 13db82c73af330ffbc7a813cd38c5bef36d5b54c (patch) | |
| tree | 0dcd6aac7e706d4fba79835d36b55412066e1f2e | |
| parent | 08f1afc562c2f5efeca88371cc4e7ced3b2f36a2 (diff) | |
Fix several missing binary specifiers to fopen.
| -rw-r--r-- | src/file.cc | 2 | ||||
| -rw-r--r-- | src/mono_picture_frame.cc | 2 | ||||
| -rw-r--r-- | src/subtitle_asset.cc | 2 | ||||
| -rw-r--r-- | test/dcp_font_test.cc | 4 | ||||
| -rw-r--r-- | test/recovery_test.cc | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/src/file.cc b/src/file.cc index f2915947..2009a036 100644 --- a/src/file.cc +++ b/src/file.cc @@ -35,7 +35,7 @@ File::File (boost::filesystem::path file) { _size = boost::filesystem::file_size (file); _data = new uint8_t[_size]; - FILE* f = dcp::fopen_boost (file, "r"); + FILE* f = dcp::fopen_boost (file, "rb"); DCP_ASSERT (f); fread (_data, 1, _size, f); fclose (f); diff --git a/src/mono_picture_frame.cc b/src/mono_picture_frame.cc index fe35b6a9..7a863463 100644 --- a/src/mono_picture_frame.cc +++ b/src/mono_picture_frame.cc @@ -44,7 +44,7 @@ MonoPictureFrame::MonoPictureFrame (boost::filesystem::path path) { boost::uintmax_t const size = boost::filesystem::file_size (path); _buffer = new ASDCP::JP2K::FrameBuffer (size); - FILE* f = fopen_boost (path, "r"); + FILE* f = fopen_boost (path, "rb"); if (!f) { boost::throw_exception (FileError ("could not open JPEG2000 file", path, errno)); } diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index d9a87263..92da00bf 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -312,7 +312,7 @@ void SubtitleAsset::add_font_data (string id, boost::filesystem::path file) { boost::uintmax_t size = boost::filesystem::file_size (file); - FILE* f = fopen_boost (file, "r"); + FILE* f = fopen_boost (file, "rb"); if (!f) { throw FileError ("could not open font file for reading", file, errno); } diff --git a/test/dcp_font_test.cc b/test/dcp_font_test.cc index a21552de..5be8845d 100644 --- a/test/dcp_font_test.cc +++ b/test/dcp_font_test.cc @@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE (interop_dcp_font_test) BOOST_REQUIRE_EQUAL (subs2->_fonts.size(), 1); boost::uintmax_t const size = boost::filesystem::file_size ("test/data/dummy.ttf"); - FILE* f = dcp::fopen_boost ("test/data/dummy.ttf", "r"); + FILE* f = dcp::fopen_boost ("test/data/dummy.ttf", "rb"); BOOST_REQUIRE (f); shared_array<uint8_t> ref (new uint8_t[size]); fread (ref.get(), 1, size, f); @@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE (smpte_dcp_font_test) BOOST_REQUIRE_EQUAL (subs2->_fonts.size(), 1); boost::uintmax_t const size = boost::filesystem::file_size ("test/data/dummy.ttf"); - FILE* f = dcp::fopen_boost ("test/data/dummy.ttf", "r"); + FILE* f = dcp::fopen_boost ("test/data/dummy.ttf", "rb"); BOOST_REQUIRE (f); shared_array<uint8_t> ref (new uint8_t[size]); fread (ref.get(), 1, size, f); diff --git a/test/recovery_test.cc b/test/recovery_test.cc index 754a49e2..566bbf21 100644 --- a/test/recovery_test.cc +++ b/test/recovery_test.cc @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE (recovery) boost::filesystem::resize_file ("build/test/baz/video2.mxf", 16384 + 353 * 11); { - FILE* f = fopen ("build/test/baz/video2.mxf", "r+"); + FILE* f = fopen ("build/test/baz/video2.mxf", "rb+"); rewind (f); char zeros[256]; memset (zeros, 0, 256); |
