Use a constexpr and a nullptr.
authorCarl Hetherington <cth@carlh.net>
Sun, 19 Sep 2021 21:57:21 +0000 (23:57 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 19 Sep 2021 22:08:17 +0000 (00:08 +0200)
src/lib/film.cc
src/lib/film.h
test/film_metadata_test.cc

index 7dadd8bea9ca29c9c1f67b5c518040dd6a4a0376..486c1dd6a5ab91929bff0567338dd35a13162309 100644 (file)
@@ -111,7 +111,9 @@ using namespace boost::placeholders;
 using dcp::raw_convert;
 using namespace dcpomatic;
 
-string const Film::metadata_file = "metadata.xml";
+
+static constexpr char metadata_file[] = "metadata.xml";
+
 
 /* 5 -> 6
  * AudioMapping XML changed.
index 85d06f64dcccbf980362dc9d528dd8c11797662c..5255e8355a7e1e6c9a59a6652bf509b37ce5389a 100644 (file)
@@ -495,8 +495,6 @@ private:
        void check_settings_consistency ();
        void maybe_set_container_and_resolution ();
 
-       static std::string const metadata_file;
-
        /** Log to write to */
        std::shared_ptr<Log> _log;
        std::shared_ptr<Playlist> _playlist;
index 6d4c606e29936c964e1bf374c393da84117efdc5..f1313497adae172d82fbe3396a9c29d1a169ee97 100644 (file)
@@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE (film_metadata_test)
 
        film->_isdcf_date = boost::gregorian::from_undelimited_string ("20130211");
        BOOST_CHECK (film->container() == Ratio::from_id ("185"));
-       BOOST_CHECK (film->dcp_content_type() == 0);
+       BOOST_CHECK (film->dcp_content_type() == nullptr);
 
        film->set_name ("fred");
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("SHR"));