summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-07-14 02:02:17 +0200
committerCarl Hetherington <cth@carlh.net>2021-07-14 02:02:17 +0200
commit96d6f783b7dfac04af8a7d77033a3d05e31cfc10 (patch)
tree38c78bc2ab560401f20cd9cde7571f3edd5d6f44
parente97157fd7fe6767fdc2b1fa32df5b821296907a9 (diff)
C++11 tidying.
-rw-r--r--src/reel_picture_asset.h2
-rw-r--r--src/subtitle.h2
-rw-r--r--test/atmos_test.cc4
-rw-r--r--test/local_time_test.cc9
-rw-r--r--test/make_digest_test.cc8
-rw-r--r--test/mca_test.cc6
-rw-r--r--tools/common.cc7
-rw-r--r--tools/dcpkdm.cc17
8 files changed, 35 insertions, 20 deletions
diff --git a/src/reel_picture_asset.h b/src/reel_picture_asset.h
index e79c4455..64fa54f4 100644
--- a/src/reel_picture_asset.h
+++ b/src/reel_picture_asset.h
@@ -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.
diff --git a/src/subtitle.h b/src/subtitle.h
index e0132dbe..c6a628b8 100644
--- a/src/subtitle.h
+++ b/src/subtitle.h
@@ -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.
diff --git a/test/atmos_test.cc b/test/atmos_test.cc
index 1ac0e1f1..a56de7af 100644
--- a/test/atmos_test.cc
+++ b/test/atmos_test.cc
@@ -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.
@@ -31,11 +31,13 @@
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)
{
diff --git a/test/local_time_test.cc b/test/local_time_test.cc
index 4ac92240..e80a863d 100644
--- a/test/local_time_test.cc
+++ b/test/local_time_test.cc
@@ -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.
@@ -31,9 +31,11 @@
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)
{
{
diff --git a/test/make_digest_test.cc b/test/make_digest_test.cc
index 7fefd809..9d37f837 100644
--- a/test/make_digest_test.cc
+++ b/test/make_digest_test.cc
@@ -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.
@@ -38,11 +38,13 @@
#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=");
}
diff --git a/test/mca_test.cc b/test/mca_test.cc
index bcedce78..12b4f2c6 100644
--- a/test/mca_test.cc
+++ b/test/mca_test.cc
@@ -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);
diff --git a/tools/common.cc b/tools/common.cc
index 54bee6b5..13ce9cb0 100644
--- a/tools/common.cc
+++ b/tools/common.cc
@@ -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.
@@ -31,13 +31,15 @@
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;
}
+
diff --git a/tools/dcpkdm.cc b/tools/dcpkdm.cc
index a3e099ba..20b07ebc 100644
--- a/tools/dcpkdm.cc
+++ b/tools/dcpkdm.cc
@@ -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.
@@ -31,18 +31,21 @@
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