Fix several missing binary specifiers to fopen.
authorCarl Hetherington <cth@carlh.net>
Thu, 18 Jun 2015 18:50:19 +0000 (19:50 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 18 Jun 2015 18:50:19 +0000 (19:50 +0100)
src/file.cc
src/mono_picture_frame.cc
src/subtitle_asset.cc
test/dcp_font_test.cc
test/recovery_test.cc

index f2915947812ec0f5368cb967c0e7d5c96eb9ab98..2009a0362fe0f7d104fd321dd164b440d5080fbf 100644 (file)
@@ -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);
index fe35b6a9aa9ec0921bb41699d32b8e161ce75662..7a8634635769903eb8533da72a8ed16de5e6d24f 100644 (file)
@@ -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));
        }
index d9a8726384abf8db6d11751671ecdc4e205ae997..92da00bf44d08b1e45dc3bc4da099e0223ab5581 100644 (file)
@@ -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);
        }
index a21552de74a363b3677528f56bbc3ce502f248c1..5be8845dc87388e4cd88a01f8730655146213f5b 100644 (file)
@@ -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);
index 754a49e223330073a6c12ff2b76fccf1b5b9379f..566bbf21d66e1841ec413e3eed8a9692988caa40 100644 (file)
@@ -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);