C++11 tidying.
authorCarl Hetherington <cth@carlh.net>
Wed, 14 Jul 2021 00:02:17 +0000 (02:02 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 14 Jul 2021 00:02:17 +0000 (02:02 +0200)
src/reel_picture_asset.h
src/subtitle.h
test/atmos_test.cc
test/local_time_test.cc
test/make_digest_test.cc
test/mca_test.cc
tools/common.cc
tools/dcpkdm.cc

index e79c44551ea2202b9adbe31d51379400b5141533..64fa54f4e92a709d1f89442195534626605883f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
index e0132dbe8a99152792a4d5fd739b14cd6dc45559..c6a628b8780a28eb8cbb2557f7dd9f5120c0093e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
index 1ac0e1f178cd56762884290f30d1889a75d7cdd8..a56de7af05c08abfcf1d02335fd43531aea86675 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
     files in the program, then also delete it here.
 */
 
+
 #include "atmos_asset.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 #include <iostream>
 
+
 /** Check basic read of an Atmos asset */
 BOOST_AUTO_TEST_CASE (atmos_read_test)
 {
index 4ac922408fd1a7d7e2003e531695d30baa1d464b..e80a863d91fdc59b7be4a75e9464dfa18206b36e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
     files in the program, then also delete it here.
 */
 
-#include <boost/test/unit_test.hpp>
-#include "local_time.h"
+
 #include "exceptions.h"
+#include "local_time.h"
+#include <boost/test/unit_test.hpp>
+
 
 /** Check that dcp::LocalTime works */
 BOOST_AUTO_TEST_CASE (local_time_basic_test)
@@ -139,6 +141,7 @@ BOOST_AUTO_TEST_CASE (local_time_basic_test)
        }
 }
 
+
 BOOST_AUTO_TEST_CASE (local_time_add_minutes_test)
 {
        {
index 7fefd80968ecb17874b0e12a851b29b7df2eb518..9d37f837cd34e360e2be02da717245c3d40d4b59 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
 #include <boost/test/unit_test.hpp>
 #include <sys/time.h>
 
+
 void progress (float)
 {
 
 }
 
+
 /** Check SHA1 digests */
 BOOST_AUTO_TEST_CASE (make_digest_test)
 {
@@ -50,12 +52,12 @@ BOOST_AUTO_TEST_CASE (make_digest_test)
        srand (1);
        int const N = 256 * 1024 * 1024;
        dcp::ArrayData data (N);
-       uint8_t* p = data.data();
+       auto p = data.data();
        for (int i = 0; i < N; ++i) {
                *p++ = rand() & 0xff;
        }
        data.write ("build/test/random");
 
        /* Hash it */
-       BOOST_CHECK_EQUAL (dcp::make_digest ("build/test/random", boost::bind (&progress, _1)), "GKbk/V3fcRtP5MaPdSmAGNbKkaU=");
+       BOOST_CHECK_EQUAL (dcp::make_digest("build/test/random", boost::bind(&progress, _1)), "GKbk/V3fcRtP5MaPdSmAGNbKkaU=");
 }
index bcedce78fd64fffc482cada54f567000127a8343..12b4f2c6f21c0a15db47adb980b872078ba0f78c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
@@ -114,8 +114,8 @@ BOOST_AUTO_TEST_CASE (write_mca_descriptors_to_mxf_test)
 
        /* Make a CPL as a roundabout way to read the metadata we just wrote to the MXF */
 
-       shared_ptr<dcp::ReelSoundAsset> reel_sound_asset(new dcp::ReelSoundAsset(sound_asset, 0));
-       shared_ptr<dcp::Reel> reel(new dcp::Reel());
+       auto reel_sound_asset = make_shared<dcp::ReelSoundAsset>(sound_asset, 0);
+       auto reel = make_shared<dcp::Reel>();
        reel->add (black_picture_asset("build/test/write_mca_descriptors_to_mxf_test", 24));
        reel->add (reel_sound_asset);
 
index 54bee6b5c9a1f217983c9c8ac8b665680f2ec15a..13ce9cb0f9092eaff20720095509c2fa0ebe2bd1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
     files in the program, then also delete it here.
 */
 
+
 #include "common.h"
 #include "dcp.h"
 
-using std::dynamic_pointer_cast;
+
 using std::shared_ptr;
 using std::vector;
 
+
 void
 dcp::filter_notes (vector<dcp::VerificationNote>& notes, bool ignore_missing_assets)
 {
@@ -52,3 +54,4 @@ dcp::filter_notes (vector<dcp::VerificationNote>& notes, bool ignore_missing_ass
 
        notes = filtered;
 }
+
index a3e099ba254ebfa69ed7ac9642564a7cfaec2da6..20b07ebca513b1476fe2872fccd87b514c91cb0e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2017-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2017-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
     files in the program, then also delete it here.
 */
 
-#include "encrypted_kdm.h"
+
+#include "certificate_chain.h"
 #include "decrypted_kdm.h"
-#include "util.h"
+#include "encrypted_kdm.h"
 #include "exceptions.h"
-#include "certificate_chain.h"
+#include "util.h"
 #include <getopt.h>
 
-using std::string;
-using std::cout;
+
 using std::cerr;
+using std::cout;
+using std::string;
 using boost::optional;
 
+
 static void
 help (string n)
 {
@@ -51,6 +54,7 @@ help (string n)
             << "  -p, --private-key  private key file\n";
 }
 
+
 static string
 tm_to_string (struct tm t)
 {
@@ -59,6 +63,7 @@ tm_to_string (struct tm t)
        return buffer;
 }
 
+
 int
 main (int argc, char* argv[])
 try