diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-14 01:00:05 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-04-14 01:00:05 +0200 |
| commit | 274dd30f2b11fe8ea563a2ac7436c9d463865b0b (patch) | |
| tree | 199e7447606339d461f6f87d16095376d8f809b3 | |
| parent | 4bd57fbbac67ac04ec47a9765b9f278aa1691851 (diff) | |
Fix/hide some warnings.
63 files changed, 356 insertions, 199 deletions
diff --git a/examples/read_dcp.cc b/examples/read_dcp.cc index 998d0dc4..53607377 100644 --- a/examples/read_dcp.cc +++ b/examples/read_dcp.cc @@ -36,7 +36,12 @@ #include "openjpeg_image.h" #include "colour_conversion.h" #include "rgb_xyz.h" +/* This DISABLE/ENABLE pair is just to ignore some warnings from Magick++.h; they + * can be removed. + */ +LIBDCP_DISABLE_WARNINGS #include <Magick++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/scoped_array.hpp> /** @file examples/read_dcp.cc diff --git a/src/array_data.h b/src/array_data.h index 69962bf2..da7229bb 100644 --- a/src/array_data.h +++ b/src/array_data.h @@ -71,18 +71,18 @@ public: virtual ~ArrayData () {} - uint8_t const * data () const { + uint8_t const * data () const override { return _data.get(); } - uint8_t * data () { + uint8_t * data () override { return _data.get(); } /** @return size of the data in _data, or whatever was last * passed to a set_size() call */ - int size () const { + int size () const override { return _size; } diff --git a/src/asset.cc b/src/asset.cc index e6822903..6e200b0d 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -37,14 +37,17 @@ */ -#include "raw_convert.h" #include "asset.h" -#include "util.h" -#include "exceptions.h" -#include "dcp_assert.h" #include "compose.hpp" +#include "dcp_assert.h" +#include "exceptions.h" #include "pkl.h" +#include "raw_convert.h" +#include "util.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/algorithm/string.hpp> diff --git a/src/asset_factory.h b/src/asset_factory.h index 4bab9bee..2dd04559 100644 --- a/src/asset_factory.h +++ b/src/asset_factory.h @@ -37,9 +37,16 @@ */ +#include <boost/filesystem.hpp> +#include <memory> + + namespace dcp { +class Asset; + + std::shared_ptr<Asset> asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_mxf_type); diff --git a/src/atmos_asset.h b/src/atmos_asset.h index 7ee55d92..a682ae60 100644 --- a/src/atmos_asset.h +++ b/src/atmos_asset.h @@ -65,7 +65,7 @@ public: std::shared_ptr<AtmosAssetReader> start_read () const; static std::string static_pkl_type (Standard); - std::string pkl_type (Standard s) const { + std::string pkl_type (Standard s) const override { return static_pkl_type (s); } diff --git a/src/atmos_asset_writer.h b/src/atmos_asset_writer.h index f70c42f5..eebb0d6c 100644 --- a/src/atmos_asset_writer.h +++ b/src/atmos_asset_writer.h @@ -64,7 +64,7 @@ class AtmosAssetWriter : public AssetWriter public: void write (std::shared_ptr<const AtmosFrame> frame); void write (uint8_t const * data, int size); - bool finalize (); + bool finalize () override; private: friend class AtmosAsset; diff --git a/src/certificate_chain.cc b/src/certificate_chain.cc index 4f86ba0d..5ff9b294 100644 --- a/src/certificate_chain.cc +++ b/src/certificate_chain.cc @@ -38,13 +38,16 @@ #include "certificate_chain.h" +#include "compose.hpp" +#include "dcp_assert.h" #include "exceptions.h" #include "util.h" -#include "dcp_assert.h" -#include "compose.hpp" +#include "warnings.h" #include <asdcp/KM_util.h> #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <xmlsec/xmldsig.h> #include <xmlsec/dl.h> #include <xmlsec/app.h> @@ -37,24 +37,29 @@ */ +#include "certificate_chain.h" +#include "compose.hpp" #include "cpl.h" -#include "util.h" -#include "reel.h" +#include "dcp_assert.h" +#include "local_time.h" #include "metadata.h" -#include "certificate_chain.h" -#include "xml.h" +#include "raw_convert.h" +#include "reel.h" +#include "reel_atmos_asset.h" +#include "reel_closed_caption_asset.h" #include "reel_picture_asset.h" #include "reel_sound_asset.h" #include "reel_subtitle_asset.h" -#include "reel_closed_caption_asset.h" -#include "reel_atmos_asset.h" -#include "local_time.h" -#include "dcp_assert.h" -#include "compose.hpp" -#include "raw_convert.h" +#include "util.h" +#include "warnings.h" +#include "xml.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/Metadata.h> +LIBDCP_ENABLE_WARNINGS #include <libxml/parser.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/algorithm/string.hpp> @@ -81,7 +81,7 @@ public: std::shared_ptr<const Asset> other, EqualityOptions options, NoteHandler note - ) const; + ) const override; /** Add a reel to this CPL * @param reel Reel to add @@ -307,7 +307,7 @@ public: protected: /** @return type string for PKLs for this asset */ - std::string pkl_type (Standard standard) const; + std::string pkl_type (Standard standard) const override; private: friend struct ::verify_invalid_language3; @@ -37,34 +37,39 @@ */ -#include "raw_convert.h" -#include "dcp.h" -#include "sound_asset.h" +#include "asset_factory.h" #include "atmos_asset.h" -#include "picture_asset.h" -#include "interop_subtitle_asset.h" -#include "smpte_subtitle_asset.h" -#include "mono_picture_asset.h" -#include "stereo_picture_asset.h" -#include "reel_subtitle_asset.h" -#include "util.h" -#include "metadata.h" -#include "exceptions.h" -#include "cpl.h" #include "certificate_chain.h" #include "compose.hpp" +#include "cpl.h" +#include "dcp.h" +#include "dcp_assert.h" #include "decrypted_kdm.h" #include "decrypted_kdm_key.h" -#include "dcp_assert.h" -#include "reel_asset.h" +#include "exceptions.h" #include "font_asset.h" +#include "interop_subtitle_asset.h" +#include "metadata.h" +#include "mono_picture_asset.h" +#include "picture_asset.h" #include "pkl.h" -#include "asset_factory.h" +#include "raw_convert.h" +#include "reel_asset.h" +#include "reel_subtitle_asset.h" +#include "smpte_subtitle_asset.h" +#include "sound_asset.h" +#include "stereo_picture_asset.h" +#include "util.h" #include "verify.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/AS_DCP.h> +LIBDCP_ENABLE_WARNINGS #include <xmlsec/xmldsig.h> #include <xmlsec/app.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/filesystem.hpp> #include <boost/algorithm/string.hpp> #include <numeric> diff --git a/src/font_asset.h b/src/font_asset.h index d39a6b24..7d1c5552 100644 --- a/src/font_asset.h +++ b/src/font_asset.h @@ -54,7 +54,7 @@ public: static std::string static_pkl_type (Standard standard); private: - std::string pkl_type (Standard standard) const { + std::string pkl_type (Standard standard) const override { return static_pkl_type (standard); } }; diff --git a/src/gamma_transfer_function.h b/src/gamma_transfer_function.h index a7bdd44d..8402d6af 100644 --- a/src/gamma_transfer_function.h +++ b/src/gamma_transfer_function.h @@ -55,10 +55,10 @@ public: return _gamma; } - bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const; + bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override; protected: - double * make_lut (int bit_depth, bool inverse) const; + double * make_lut (int bit_depth, bool inverse) const override; private: double _gamma; diff --git a/src/identity_transfer_function.h b/src/identity_transfer_function.h index ff6814eb..de7a897a 100644 --- a/src/identity_transfer_function.h +++ b/src/identity_transfer_function.h @@ -46,10 +46,10 @@ namespace dcp { class IdentityTransferFunction : public TransferFunction { public: - bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const; + bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override; protected: - double * make_lut (int bit_depth, bool inverse) const; + double * make_lut (int bit_depth, bool inverse) const override; }; diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index 938c028e..453cad8b 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -37,17 +37,20 @@ */ -#include "interop_subtitle_asset.h" +#include "compose.hpp" +#include "dcp_assert.h" +#include "font_asset.h" #include "interop_load_font_node.h" -#include "subtitle_asset_internal.h" -#include "xml.h" +#include "interop_subtitle_asset.h" #include "raw_convert.h" -#include "util.h" -#include "font_asset.h" -#include "dcp_assert.h" -#include "compose.hpp" +#include "subtitle_asset_internal.h" #include "subtitle_image.h" +#include "util.h" +#include "warnings.h" +#include "xml.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/weak_ptr.hpp> #include <cmath> #include <cstdio> @@ -41,7 +41,10 @@ #define LIBDCP_KEY_H +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/AS_DCP.h> +LIBDCP_ENABLE_WARNINGS #include <stdint.h> #include <string> diff --git a/src/language_tag.h b/src/language_tag.h index d18572e4..6b4bebe6 100644 --- a/src/language_tag.h +++ b/src/language_tag.h @@ -112,7 +112,7 @@ public: LanguageSubtag (char const* subtag) : Subtag(subtag, SubtagType::LANGUAGE) {} - SubtagType type () const { + SubtagType type () const override { return SubtagType::LANGUAGE; } }; @@ -125,7 +125,7 @@ public: ScriptSubtag (char const* subtag) : Subtag(subtag, SubtagType::SCRIPT) {} - SubtagType type () const { + SubtagType type () const override { return SubtagType::SCRIPT; } }; @@ -138,7 +138,7 @@ public: RegionSubtag (char const* subtag) : Subtag(subtag, SubtagType::REGION) {} - SubtagType type () const { + SubtagType type () const override { return SubtagType::REGION; } }; @@ -151,7 +151,7 @@ public: VariantSubtag (char const* subtag) : Subtag(subtag, SubtagType::VARIANT) {} - SubtagType type () const { + SubtagType type () const override { return SubtagType::VARIANT; } @@ -168,7 +168,7 @@ public: ExtlangSubtag (char const* subtag) : Subtag(subtag, SubtagType::EXTLANG) {} - SubtagType type () const { + SubtagType type () const override { return SubtagType::EXTLANG; } diff --git a/src/modified_gamma_transfer_function.h b/src/modified_gamma_transfer_function.h index 70018cbf..34904855 100644 --- a/src/modified_gamma_transfer_function.h +++ b/src/modified_gamma_transfer_function.h @@ -74,10 +74,10 @@ public: return _B; } - bool about_equal (std::shared_ptr<const TransferFunction>, double epsilon) const; + bool about_equal (std::shared_ptr<const TransferFunction>, double epsilon) const override; protected: - double * make_lut (int bit_depth, bool inverse) const; + double * make_lut (int bit_depth, bool inverse) const override; private: double _power; diff --git a/src/mono_picture_asset_writer.cc b/src/mono_picture_asset_writer.cc index dec120cb..1abdcccc 100644 --- a/src/mono_picture_asset_writer.cc +++ b/src/mono_picture_asset_writer.cc @@ -37,13 +37,16 @@ */ -#include "mono_picture_asset_writer.h" +#include "crypto_context.h" +#include "dcp_assert.h" #include "exceptions.h" +#include "mono_picture_asset_writer.h" #include "picture_asset.h" -#include "dcp_assert.h" -#include "crypto_context.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/AS_DCP.h> #include <asdcp/KM_fileio.h> +LIBDCP_ENABLE_WARNINGS #include "picture_asset_writer_common.cc" diff --git a/src/mono_picture_asset_writer.h b/src/mono_picture_asset_writer.h index 9dffaa24..724e4ece 100644 --- a/src/mono_picture_asset_writer.h +++ b/src/mono_picture_asset_writer.h @@ -64,9 +64,9 @@ namespace dcp { class MonoPictureAssetWriter : public PictureAssetWriter { public: - FrameInfo write (uint8_t const *, int); - void fake_write (int size); - bool finalize (); + FrameInfo write (uint8_t const *, int) override; + void fake_write (int size) override; + bool finalize () override; private: friend class MonoPictureAsset; diff --git a/src/mono_picture_frame.h b/src/mono_picture_frame.h index 52cf7965..95b0d111 100644 --- a/src/mono_picture_frame.h +++ b/src/mono_picture_frame.h @@ -87,13 +87,13 @@ public: std::shared_ptr<OpenJPEGImage> xyz_image (int reduce = 0) const; /** @return Pointer to JPEG2000 data */ - uint8_t const * data () const; + uint8_t const * data () const override; /** @return Pointer to JPEG2000 data */ - uint8_t* data (); + uint8_t* data () override; /** @return Size of JPEG2000 data in bytes */ - int size () const; + int size () const override; private: /* XXX: this is a bit of a shame, but I tried friend MonoPictureAssetReader and it's diff --git a/src/picture_asset.h b/src/picture_asset.h index 6ee3bd24..011dea87 100644 --- a/src/picture_asset.h +++ b/src/picture_asset.h @@ -140,7 +140,7 @@ protected: Fraction _screen_aspect_ratio; private: - std::string pkl_type (Standard standard) const; + std::string pkl_type (Standard standard) const override; }; @@ -37,12 +37,15 @@ */ -#include "pkl.h" +#include "dcp_assert.h" #include "exceptions.h" -#include "util.h" +#include "pkl.h" #include "raw_convert.h" -#include "dcp_assert.h" +#include "util.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <iostream> diff --git a/src/reel_asset.cc b/src/reel_asset.cc index 1a6a25be..d233ee64 100644 --- a/src/reel_asset.cc +++ b/src/reel_asset.cc @@ -37,13 +37,16 @@ */ -#include "raw_convert.h" -#include "reel_asset.h" #include "asset.h" #include "compose.hpp" #include "dcp_assert.h" +#include "raw_convert.h" +#include "reel_asset.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::pair; diff --git a/src/reel_atmos_asset.cc b/src/reel_atmos_asset.cc index 1df26ce9..fe30cea2 100644 --- a/src/reel_atmos_asset.cc +++ b/src/reel_atmos_asset.cc @@ -39,8 +39,11 @@ #include "atmos_asset.h" #include "reel_atmos_asset.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::string; diff --git a/src/reel_closed_caption_asset.cc b/src/reel_closed_caption_asset.cc index 3e4627d3..7d22c0b8 100644 --- a/src/reel_closed_caption_asset.cc +++ b/src/reel_closed_caption_asset.cc @@ -37,11 +37,14 @@ */ -#include "subtitle_asset.h" +#include "dcp_assert.h" #include "reel_closed_caption_asset.h" #include "smpte_subtitle_asset.h" -#include "dcp_assert.h" +#include "subtitle_asset.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::string; diff --git a/src/reel_file_asset.cc b/src/reel_file_asset.cc index 1ca77b4d..dc8ea21f 100644 --- a/src/reel_file_asset.cc +++ b/src/reel_file_asset.cc @@ -39,7 +39,10 @@ #include "asset.h" #include "reel_file_asset.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::shared_ptr; diff --git a/src/reel_interop_closed_caption_asset.cc b/src/reel_interop_closed_caption_asset.cc index 3e85b135..be968068 100644 --- a/src/reel_interop_closed_caption_asset.cc +++ b/src/reel_interop_closed_caption_asset.cc @@ -33,7 +33,10 @@ #include "reel_interop_closed_caption_asset.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::make_pair; diff --git a/src/reel_interop_closed_caption_asset.h b/src/reel_interop_closed_caption_asset.h index ec954346..dd60ad71 100644 --- a/src/reel_interop_closed_caption_asset.h +++ b/src/reel_interop_closed_caption_asset.h @@ -65,7 +65,7 @@ public: xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override; private: - std::string cpl_node_name (Standard) const; + std::string cpl_node_name (Standard) const override; std::pair<std::string, std::string> cpl_node_namespace () const override; }; diff --git a/src/reel_interop_subtitle_asset.cc b/src/reel_interop_subtitle_asset.cc index 08ea4bb4..5f295d53 100644 --- a/src/reel_interop_subtitle_asset.cc +++ b/src/reel_interop_subtitle_asset.cc @@ -38,7 +38,10 @@ #include "reel_interop_subtitle_asset.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::shared_ptr; diff --git a/src/reel_markers_asset.cc b/src/reel_markers_asset.cc index 55a50a68..0dd3cf29 100644 --- a/src/reel_markers_asset.cc +++ b/src/reel_markers_asset.cc @@ -37,10 +37,13 @@ */ -#include "reel_markers_asset.h" -#include "raw_convert.h" #include "dcp_assert.h" +#include "raw_convert.h" +#include "reel_markers_asset.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::string; diff --git a/src/reel_markers_asset.h b/src/reel_markers_asset.h index 1eae47ef..e3fbb962 100644 --- a/src/reel_markers_asset.h +++ b/src/reel_markers_asset.h @@ -51,7 +51,7 @@ public: ReelMarkersAsset (Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelMarkersAsset (std::shared_ptr<const cxml::Node>); - xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; + xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override; bool equals (std::shared_ptr<const ReelMarkersAsset>, EqualityOptions, NoteHandler) const; void set (Marker, Time); @@ -62,7 +62,7 @@ public: } protected: - std::string cpl_node_name (Standard) const; + std::string cpl_node_name (Standard) const override; private: std::map<Marker, Time> _markers; diff --git a/src/reel_mono_picture_asset.h b/src/reel_mono_picture_asset.h index 50e904b2..fb2dff70 100644 --- a/src/reel_mono_picture_asset.h +++ b/src/reel_mono_picture_asset.h @@ -71,7 +71,7 @@ public: } private: - std::string cpl_node_name (Standard standard) const; + std::string cpl_node_name (Standard standard) const override; }; diff --git a/src/reel_picture_asset.cc b/src/reel_picture_asset.cc index 4f7f863f..2e51fec5 100644 --- a/src/reel_picture_asset.cc +++ b/src/reel_picture_asset.cc @@ -37,13 +37,16 @@ */ -#include "reel_picture_asset.h" -#include "picture_asset.h" +#include "compose.hpp" #include "dcp_assert.h" +#include "picture_asset.h" #include "raw_convert.h" -#include "compose.hpp" +#include "reel_picture_asset.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <iomanip> #include <cmath> diff --git a/src/reel_smpte_closed_caption_asset.cc b/src/reel_smpte_closed_caption_asset.cc index 34fba18b..a2a68202 100644 --- a/src/reel_smpte_closed_caption_asset.cc +++ b/src/reel_smpte_closed_caption_asset.cc @@ -38,7 +38,10 @@ #include "reel_smpte_closed_caption_asset.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::make_pair; diff --git a/src/reel_smpte_subtitle_asset.cc b/src/reel_smpte_subtitle_asset.cc index 5a7c8c6c..64440547 100644 --- a/src/reel_smpte_subtitle_asset.cc +++ b/src/reel_smpte_subtitle_asset.cc @@ -39,7 +39,10 @@ #include "reel_smpte_subtitle_asset.h" #include "smpte_subtitle_asset.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::shared_ptr; diff --git a/src/reel_sound_asset.cc b/src/reel_sound_asset.cc index e944467f..76495c78 100644 --- a/src/reel_sound_asset.cc +++ b/src/reel_sound_asset.cc @@ -37,10 +37,13 @@ */ -#include "reel_sound_asset.h" #include "dcp_assert.h" +#include "reel_sound_asset.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::string; diff --git a/src/reel_sound_asset.h b/src/reel_sound_asset.h index 5eee23be..181bf1d9 100644 --- a/src/reel_sound_asset.h +++ b/src/reel_sound_asset.h @@ -68,8 +68,8 @@ public: bool equals (std::shared_ptr<const ReelSoundAsset>, EqualityOptions, NoteHandler) const; private: - boost::optional<std::string> key_type () const; - std::string cpl_node_name (Standard standard) const; + boost::optional<std::string> key_type () const override; + std::string cpl_node_name (Standard standard) const override; }; diff --git a/src/reel_stereo_picture_asset.h b/src/reel_stereo_picture_asset.h index beedc4a6..7cac1c8b 100644 --- a/src/reel_stereo_picture_asset.h +++ b/src/reel_stereo_picture_asset.h @@ -71,8 +71,8 @@ public: } private: - std::string cpl_node_name (Standard standard) const; - std::pair<std::string, std::string> cpl_node_attribute (Standard standard) const; + std::string cpl_node_name (Standard standard) const override; + std::pair<std::string, std::string> cpl_node_attribute (Standard standard) const override; }; diff --git a/src/reel_subtitle_asset.cc b/src/reel_subtitle_asset.cc index e3ca2006..04f56788 100644 --- a/src/reel_subtitle_asset.cc +++ b/src/reel_subtitle_asset.cc @@ -38,10 +38,13 @@ #include "language_tag.h" -#include "subtitle_asset.h" #include "reel_subtitle_asset.h" #include "smpte_subtitle_asset.h" +#include "subtitle_asset.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS using std::string; diff --git a/src/s_gamut3_transfer_function.h b/src/s_gamut3_transfer_function.h index 88a6a65a..0d297e8b 100644 --- a/src/s_gamut3_transfer_function.h +++ b/src/s_gamut3_transfer_function.h @@ -46,10 +46,10 @@ namespace dcp { class SGamut3TransferFunction : public TransferFunction { public: - bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const; + bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override; protected: - double * make_lut (int bit_depth, bool inverse) const; + double * make_lut (int bit_depth, bool inverse) const override; }; diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index 6c3277ce..0fa315b9 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -37,20 +37,23 @@ */ -#include "smpte_subtitle_asset.h" -#include "smpte_load_font_node.h" -#include "exceptions.h" -#include "xml.h" -#include "raw_convert.h" -#include "dcp_assert.h" -#include "util.h" #include "compose.hpp" #include "crypto_context.h" +#include "dcp_assert.h" +#include "exceptions.h" +#include "raw_convert.h" +#include "smpte_load_font_node.h" +#include "smpte_subtitle_asset.h" #include "subtitle_image.h" +#include "util.h" +#include "warnings.h" +#include "xml.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/AS_DCP.h> #include <asdcp/KM_util.h> #include <asdcp/KM_log.h> #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/algorithm/string.hpp> diff --git a/src/smpte_subtitle_asset.h b/src/smpte_subtitle_asset.h index 6984b644..1ece2405 100644 --- a/src/smpte_subtitle_asset.h +++ b/src/smpte_subtitle_asset.h @@ -83,18 +83,18 @@ public: std::shared_ptr<const Asset>, EqualityOptions, NoteHandler note - ) const; + ) const override; - std::vector<std::shared_ptr<LoadFontNode>> load_font_nodes () const; + std::vector<std::shared_ptr<LoadFontNode>> load_font_nodes () const override; - std::string xml_as_string () const; + std::string xml_as_string () const override; /** Write this content to a MXF file */ - void write (boost::filesystem::path path) const; + void write (boost::filesystem::path path) const override; - void add (std::shared_ptr<Subtitle>); - void add_font (std::string id, dcp::ArrayData data); - void set_key (Key key); + void add (std::shared_ptr<Subtitle>) override; + void add_font (std::string id, dcp::ArrayData data) override; + void set_key (Key key) override; void set_content_title_text (std::string t) { _content_title_text = t; @@ -168,7 +168,7 @@ public: * e.g. a time_code_rate of 250 means that a subtitle time of 0:0:0:001 * represents 4ms. */ - int time_code_rate () const { + int time_code_rate () const override { return _time_code_rate; } @@ -192,7 +192,7 @@ public: protected: - std::string pkl_type (Standard s) const { + std::string pkl_type (Standard s) const override { return static_pkl_type (s); } diff --git a/src/sound_asset.cc b/src/sound_asset.cc index 4f0166d8..04234c23 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -37,17 +37,20 @@ */ -#include "sound_asset.h" -#include "util.h" -#include "exceptions.h" -#include "sound_frame.h" -#include "sound_asset_writer.h" -#include "sound_asset_reader.h" #include "compose.hpp" #include "dcp_assert.h" +#include "exceptions.h" +#include "sound_asset.h" +#include "sound_asset_reader.h" +#include "sound_asset_writer.h" +#include "sound_frame.h" +#include "util.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/AS_DCP.h> #include <asdcp/KM_fileio.h> #include <asdcp/Metadata.h> +LIBDCP_ENABLE_WARNINGS #include <libxml++/nodes/element.h> #include <boost/filesystem.hpp> #include <stdexcept> diff --git a/src/sound_asset.h b/src/sound_asset.h index 79edea96..799e671c 100644 --- a/src/sound_asset.h +++ b/src/sound_asset.h @@ -82,7 +82,7 @@ public: std::shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note - ) const; + ) const override; /** @return number of channels */ int channels () const { @@ -115,7 +115,7 @@ private: boost::filesystem::path path, std::string suffix, dcp::MXFMetadata mxf_meta, std::string language, int frames, int sample_rate ); - std::string pkl_type (Standard standard) const { + std::string pkl_type (Standard standard) const override { return static_pkl_type (standard); } diff --git a/src/sound_asset_writer.cc b/src/sound_asset_writer.cc index 0d7d2074..5157bc9f 100644 --- a/src/sound_asset_writer.cc +++ b/src/sound_asset_writer.cc @@ -38,14 +38,17 @@ #include "bitstream.h" -#include "sound_asset_writer.h" -#include "sound_asset.h" -#include "exceptions.h" -#include "dcp_assert.h" #include "compose.hpp" #include "crypto_context.h" +#include "dcp_assert.h" +#include "exceptions.h" +#include "sound_asset.h" +#include "sound_asset_writer.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/AS_DCP.h> #include <asdcp/Metadata.h> +LIBDCP_ENABLE_WARNINGS #include <iostream> @@ -136,11 +139,15 @@ SoundAssetWriter::start () if (field == MCASoundField::SEVEN_POINT_ONE) { soundfield->MCATagSymbol = "sg71"; soundfield->MCATagName = "7.1DS"; +LIBDCP_DISABLE_WARNINGS soundfield->MCALabelDictionaryID = asdcp_smpte_dict->ul(ASDCP::MDD_DCAudioSoundfield_71); +LIBDCP_ENABLE_WARNINGS } else { soundfield->MCATagSymbol = "sg51"; soundfield->MCATagName = "5.1"; +LIBDCP_DISABLE_WARNINGS soundfield->MCALabelDictionaryID = asdcp_smpte_dict->ul(ASDCP::MDD_DCAudioSoundfield_51); +LIBDCP_ENABLE_WARNINGS } _state->mxf_writer.OP1aHeader().AddChildObject(soundfield); @@ -167,7 +174,9 @@ SoundAssetWriter::start () if (auto lang = _asset->language()) { channel->RFC5646SpokenLanguage = *lang; } +LIBDCP_DISABLE_WARNINGS channel->MCALabelDictionaryID = channel_to_mca_universal_label(dcp_channel, field, asdcp_smpte_dict); +LIBDCP_ENABLE_WARNINGS _state->mxf_writer.OP1aHeader().AddChildObject(channel); essence_descriptor->SubDescriptors.push_back(channel->InstanceUID); } diff --git a/src/sound_asset_writer.h b/src/sound_asset_writer.h index b024749f..fde56d95 100644 --- a/src/sound_asset_writer.h +++ b/src/sound_asset_writer.h @@ -72,7 +72,7 @@ public: */ void write (float const * const *, int); - bool finalize (); + bool finalize () override; private: friend class SoundAsset; diff --git a/src/stereo_picture_asset_writer.h b/src/stereo_picture_asset_writer.h index cf3e2a4e..0a361e41 100644 --- a/src/stereo_picture_asset_writer.h +++ b/src/stereo_picture_asset_writer.h @@ -64,9 +64,9 @@ public: * @param data JPEG2000 data. * @param size Size of data. */ - FrameInfo write (uint8_t const * data, int size); - void fake_write (int size); - bool finalize (); + FrameInfo write (uint8_t const * data, int size) override; + void fake_write (int size) override; + bool finalize () override; private: friend class StereoPictureAsset; diff --git a/src/stereo_picture_frame.h b/src/stereo_picture_frame.h index c499b8fe..096c821a 100644 --- a/src/stereo_picture_frame.h +++ b/src/stereo_picture_frame.h @@ -83,9 +83,9 @@ public: public: Part (std::shared_ptr<ASDCP::JP2K::SFrameBuffer> buffer, Eye eye); - uint8_t const * data () const; - uint8_t * data (); - int size () const; + uint8_t const * data () const override; + uint8_t * data () override; + int size () const override; private: friend class StereoPictureFrame; diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index 0afce3d0..2c542b6e 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -98,7 +98,7 @@ public: std::shared_ptr<const Asset>, EqualityOptions, NoteHandler note - ) const; + ) const override; std::vector<std::shared_ptr<const Subtitle>> subtitles_during (Time from, Time to, bool starting) const; std::vector<std::shared_ptr<const Subtitle>> subtitles_in_reel(std::shared_ptr<const dcp::ReelAsset> asset) const; diff --git a/src/subtitle_asset_internal.h b/src/subtitle_asset_internal.h index c7037dcf..9b5bb2da 100644 --- a/src/subtitle_asset_internal.h +++ b/src/subtitle_asset_internal.h @@ -42,10 +42,13 @@ #include "array_data.h" +#include "dcp_time.h" #include "raw_convert.h" #include "types.h" -#include "dcp_time.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS struct take_intersection_test; @@ -131,7 +134,7 @@ public: , text (text_) {} - virtual xmlpp::Element* as_xml (xmlpp::Element* parent, Context &) const; + virtual xmlpp::Element* as_xml (xmlpp::Element* parent, Context &) const override; std::string text; }; @@ -149,7 +152,7 @@ public: , _direction (direction) {} - xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const; + xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const override; private: HAlign _h_align; @@ -171,7 +174,7 @@ public: , _fade_down (fade_down) {} - xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const; + xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const override; private: Time _in; @@ -194,7 +197,7 @@ public: , _v_position (v_position) {} - xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const; + xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const override; private: ArrayData _png_data; diff --git a/src/types.cc b/src/types.cc index 743e7260..12be1b8a 100644 --- a/src/types.cc +++ b/src/types.cc @@ -37,12 +37,15 @@ */ -#include "raw_convert.h" -#include "types.h" -#include "exceptions.h" #include "compose.hpp" #include "dcp_assert.h" +#include "exceptions.h" +#include "raw_convert.h" +#include "types.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/algorithm/string.hpp> #include <string> #include <vector> diff --git a/src/types.h b/src/types.h index 9dc3e5f5..e5f4ff7a 100644 --- a/src/types.h +++ b/src/types.h @@ -41,8 +41,11 @@ #define LIBDCP_TYPES_H +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <asdcp/KLV.h> +LIBDCP_ENABLE_WARNINGS #include <memory> #include <boost/function.hpp> #include <string> @@ -42,13 +42,15 @@ #include "array_data.h" -#include "types.h" #include "local_time.h" +#include "types.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/KM_log.h> -#include <memory> -#include <boost/function.hpp> +LIBDCP_ENABLE_WARNINGS #include <boost/filesystem.hpp> +#include <boost/function.hpp> #include <boost/optional.hpp> +#include <memory> #include <string> #include <stdint.h> diff --git a/src/verify.cc b/src/verify.cc index a2298f38..c9d9b24d 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -156,22 +156,22 @@ private: class DCPErrorHandler : public ErrorHandler { public: - void warning(const SAXParseException& e) + void warning(const SAXParseException& e) override { maybe_add (XMLValidationError(e)); } - void error(const SAXParseException& e) + void error(const SAXParseException& e) override { maybe_add (XMLValidationError(e)); } - void fatalError(const SAXParseException& e) + void fatalError(const SAXParseException& e) override { maybe_add (XMLValidationError(e)); } - void resetErrors() { + void resetErrors() override { _errors.clear (); } @@ -246,7 +246,7 @@ public: add("http://www.smpte-ra.org/schemas/429-10/2008/Main-Stereo-Picture-CPL", "SMPTE-429-10-2008.xsd"); } - InputSource* resolveEntity(XMLCh const *, XMLCh const * system_id) + InputSource* resolveEntity(XMLCh const *, XMLCh const * system_id) override { if (!system_id) { return 0; diff --git a/test/asset_test.cc b/test/asset_test.cc index a6fa4b33..d6257ebc 100644 --- a/test/asset_test.cc +++ b/test/asset_test.cc @@ -36,36 +36,36 @@ #include <boost/bind.hpp> #include <boost/test/unit_test.hpp> + using std::string; using std::shared_ptr; +using std::make_shared; + class DummyAsset : public dcp::Asset { protected: - std::string pkl_type (dcp::Standard) const { + std::string pkl_type (dcp::Standard) const override { return "none"; } }; -static void -note_handler (dcp::NoteType, string) -{ - -} /** Test a few dusty corners of Asset */ BOOST_AUTO_TEST_CASE (asset_test) { - shared_ptr<DummyAsset> a (new DummyAsset); + auto a = make_shared<DummyAsset>(); a->_hash = "abc"; - shared_ptr<DummyAsset> b (new DummyAsset); + auto b = make_shared<DummyAsset>(); b->_hash = "def"; - BOOST_CHECK (!a->equals (b, dcp::EqualityOptions (), boost::bind (¬e_handler, _1, _2))); + auto ignore = [](dcp::NoteType, string) {}; + + BOOST_CHECK (!a->equals(b, dcp::EqualityOptions(), ignore)); b->_hash = "abc"; - BOOST_CHECK (a->equals (b, dcp::EqualityOptions (), boost::bind (¬e_handler, _1, _2))); + BOOST_CHECK (a->equals(b, dcp::EqualityOptions(), ignore)); b->_file = "foo/bar/baz"; - BOOST_CHECK (a->equals (b, dcp::EqualityOptions (), boost::bind (¬e_handler, _1, _2))); + BOOST_CHECK (a->equals(b, dcp::EqualityOptions(), ignore)); } diff --git a/test/cpl_sar_test.cc b/test/cpl_sar_test.cc index 65f01900..1bf53686 100644 --- a/test/cpl_sar_test.cc +++ b/test/cpl_sar_test.cc @@ -31,13 +31,18 @@ files in the program, then also delete it here. */ + #include "cpl.h" -#include "reel_mono_picture_asset.h" #include "mono_picture_asset.h" +#include "reel_mono_picture_asset.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/test/unit_test.hpp> + using std::string; using std::shared_ptr; using std::make_shared; @@ -47,13 +52,14 @@ check (shared_ptr<dcp::ReelMonoPictureAsset> pa, dcp::Fraction far, string sar) { pa->set_screen_aspect_ratio (far); xmlpp::Document doc; - xmlpp::Element* el = doc.create_root_node ("Test"); + auto el = doc.create_root_node ("Test"); pa->write_to_cpl (el, dcp::Standard::INTEROP); cxml::Node node (el); BOOST_CHECK_EQUAL (node.node_child("MainPicture")->string_child ("ScreenAspectRatio"), sar); } + /** Test for a reported bug where <ScreenAspectRatio> in Interop files uses * excessive decimal places and (sometimes) the wrong decimal point character. * Also check that we correctly use one of the allowed <ScreenAspectRatio> @@ -66,38 +72,38 @@ BOOST_AUTO_TEST_CASE (cpl_sar) ); /* Easy ones */ - check (pa, dcp::Fraction (1998, 1080), "1.85"); - check (pa, dcp::Fraction (2048, 858), "2.39"); + check (pa, dcp::Fraction(1998, 1080), "1.85"); + check (pa, dcp::Fraction(2048, 858), "2.39"); /* Check the use of the allowed values */ /* Just less then, equal to and just more than 1.33 */ - check (pa, dcp::Fraction (1200, 1000), "1.33"); - check (pa, dcp::Fraction (1330, 1000), "1.33"); - check (pa, dcp::Fraction (1430, 1000), "1.33"); + check (pa, dcp::Fraction(1200, 1000), "1.33"); + check (pa, dcp::Fraction(1330, 1000), "1.33"); + check (pa, dcp::Fraction(1430, 1000), "1.33"); /* Same for 1.66 */ - check (pa, dcp::Fraction (1600, 1000), "1.66"); - check (pa, dcp::Fraction (1660, 1000), "1.66"); - check (pa, dcp::Fraction (1670, 1000), "1.66"); + check (pa, dcp::Fraction(1600, 1000), "1.66"); + check (pa, dcp::Fraction(1660, 1000), "1.66"); + check (pa, dcp::Fraction(1670, 1000), "1.66"); /* 1.77 */ - check (pa, dcp::Fraction (1750, 1000), "1.77"); - check (pa, dcp::Fraction (1770, 1000), "1.77"); - check (pa, dcp::Fraction (1800, 1000), "1.77"); + check (pa, dcp::Fraction(1750, 1000), "1.77"); + check (pa, dcp::Fraction(1770, 1000), "1.77"); + check (pa, dcp::Fraction(1800, 1000), "1.77"); /* 1.85 */ - check (pa, dcp::Fraction (1820, 1000), "1.85"); - check (pa, dcp::Fraction (1850, 1000), "1.85"); - check (pa, dcp::Fraction (1910, 1000), "1.85"); + check (pa, dcp::Fraction(1820, 1000), "1.85"); + check (pa, dcp::Fraction(1850, 1000), "1.85"); + check (pa, dcp::Fraction(1910, 1000), "1.85"); /* 2.00 */ - check (pa, dcp::Fraction (1999, 1000), "2.00"); - check (pa, dcp::Fraction (2000, 1000), "2.00"); - check (pa, dcp::Fraction (2001, 1000), "2.00"); + check (pa, dcp::Fraction(1999, 1000), "2.00"); + check (pa, dcp::Fraction(2000, 1000), "2.00"); + check (pa, dcp::Fraction(2001, 1000), "2.00"); /* 2.39 */ - check (pa, dcp::Fraction (2350, 1000), "2.39"); - check (pa, dcp::Fraction (2390, 1000), "2.39"); - check (pa, dcp::Fraction (2500, 1000), "2.39"); + check (pa, dcp::Fraction(2350, 1000), "2.39"); + check (pa, dcp::Fraction(2390, 1000), "2.39"); + check (pa, dcp::Fraction(2500, 1000), "2.39"); } diff --git a/test/interop_load_font_test.cc b/test/interop_load_font_test.cc index 0a5a0f6c..50e53a07 100644 --- a/test/interop_load_font_test.cc +++ b/test/interop_load_font_test.cc @@ -31,11 +31,19 @@ files in the program, then also delete it here. */ + #include "interop_load_font_node.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/test/unit_test.hpp> + +using std::make_shared; + + /** Test dcp::InteropLoadFont's simple constructor */ BOOST_AUTO_TEST_CASE (interop_load_font_test1) { @@ -52,7 +60,7 @@ BOOST_AUTO_TEST_CASE (interop_load_font_test2) text->set_attribute("Id", "my-great-id"); text->set_attribute("URI", "my-great-uri"); - dcp::InteropLoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text))); + dcp::InteropLoadFontNode lf (make_shared<cxml::Node>(text)); BOOST_CHECK_EQUAL (lf.id, "my-great-id"); } @@ -65,7 +73,7 @@ BOOST_AUTO_TEST_CASE (interop_load_font_test3) text->set_attribute("ID", "my-great-id"); text->set_attribute("URI", "my-great-uri"); - dcp::InteropLoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text))); + dcp::InteropLoadFontNode lf (make_shared<cxml::Node>(text)); BOOST_CHECK_EQUAL (lf.id, "my-great-id"); } diff --git a/test/kdm_test.cc b/test/kdm_test.cc index ce589a8c..5b0ae622 100644 --- a/test/kdm_test.cc +++ b/test/kdm_test.cc @@ -31,21 +31,26 @@ files in the program, then also delete it here. */ -#include "encrypted_kdm.h" -#include "decrypted_kdm.h" + #include "certificate_chain.h" -#include "util.h" -#include "test.h" #include "cpl.h" +#include "decrypted_kdm.h" +#include "encrypted_kdm.h" #include "mono_picture_asset.h" -#include "reel_mono_picture_asset.h" +#include "picture_asset_writer.h" #include "reel.h" +#include "reel_mono_picture_asset.h" +#include "test.h" #include "types.h" -#include "picture_asset_writer.h" +#include "util.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/test/unit_test.hpp> + using std::list; using std::string; using std::vector; @@ -53,6 +58,7 @@ using std::make_shared; using std::shared_ptr; using boost::optional; + /** Check reading and decryption of a KDM */ BOOST_AUTO_TEST_CASE (kdm_test) { @@ -76,6 +82,7 @@ BOOST_AUTO_TEST_CASE (kdm_test) BOOST_CHECK_EQUAL (keys.back().key().hex(), "5327fb7ec2e807bd57059615bf8a169d"); } + /** Check that we can read in a KDM and then write it back out again the same */ BOOST_AUTO_TEST_CASE (kdm_passthrough_test) { @@ -94,6 +101,7 @@ BOOST_AUTO_TEST_CASE (kdm_passthrough_test) ); } + /** Test some of the utility methods of DecryptedKDM */ BOOST_AUTO_TEST_CASE (decrypted_kdm_test) { @@ -124,6 +132,7 @@ BOOST_AUTO_TEST_CASE (decrypted_kdm_test) delete[] data; } + /** Check that <KeyType> tags have the scope attribute. * Wolfgang Woehl believes this is compulsory and I am more-or-less inclined to agree. */ @@ -149,6 +158,7 @@ BOOST_AUTO_TEST_CASE (kdm_key_type_scope) } } + static cxml::ConstNodePtr kdm_forensic_test (cxml::Document& doc, bool picture, optional<int> audio) { @@ -177,6 +187,7 @@ kdm_forensic_test (cxml::Document& doc, bool picture, optional<int> audio) optional_node_child("ForensicMarkFlagList"); } + /** Check ForensicMarkFlagList handling: disable picture and all audio */ BOOST_AUTO_TEST_CASE (kdm_forensic_test1) { @@ -189,6 +200,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test1) BOOST_CHECK_EQUAL (flags.back()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable"); } + /** Check ForensicMarkFlagList handling: disable picture but not audio */ BOOST_AUTO_TEST_CASE (kdm_forensic_test2) { @@ -200,6 +212,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test2) BOOST_CHECK_EQUAL (flags.front()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-picture-disable"); } + /** Check ForensicMarkFlagList handling: disable audio but not picture */ BOOST_AUTO_TEST_CASE (kdm_forensic_test3) { @@ -211,6 +224,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test3) BOOST_CHECK_EQUAL (flags.front()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable"); } + /** Check ForensicMarkFlagList handling: disable picture and audio above channel 3 */ BOOST_AUTO_TEST_CASE (kdm_forensic_test4) { @@ -223,6 +237,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test4) BOOST_CHECK_EQUAL (flags.back()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable-above-channel-3"); } + /** Check ForensicMarkFlagList handling: disable neither */ BOOST_AUTO_TEST_CASE (kdm_forensic_test5) { @@ -231,6 +246,7 @@ BOOST_AUTO_TEST_CASE (kdm_forensic_test5) BOOST_CHECK (!forensic); } + /** Check that KDM validity periods are checked for being within the certificate validity */ BOOST_AUTO_TEST_CASE (validity_period_test1) { diff --git a/test/mca_test.cc b/test/mca_test.cc index decbf581..bcedce78 100644 --- a/test/mca_test.cc +++ b/test/mca_test.cc @@ -39,8 +39,11 @@ #include "sound_asset.h" #include "sound_asset_writer.h" #include "test.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/test/unit_test.hpp> diff --git a/test/smpte_load_font_test.cc b/test/smpte_load_font_test.cc index a9cc327d..adcbb0aa 100644 --- a/test/smpte_load_font_test.cc +++ b/test/smpte_load_font_test.cc @@ -31,20 +31,28 @@ files in the program, then also delete it here. */ + #include "smpte_load_font_node.h" +#include "warnings.h" #include <libcxml/cxml.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/test/unit_test.hpp> + +using std::make_shared; + + /** Test dcp::SMPTELoadFontNode */ BOOST_AUTO_TEST_CASE (smpte_load_font_test1) { xmlpp::Document doc; - xmlpp::Element* text = doc.create_root_node("Font"); + auto text = doc.create_root_node("Font"); text->set_attribute ("ID", "my-great-id"); text->add_child_text ("urn:uuid:my-great-urn"); - dcp::SMPTELoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text))); + dcp::SMPTELoadFontNode lf (make_shared<cxml::Node>(text)); BOOST_CHECK_EQUAL (lf.id, "my-great-id"); BOOST_CHECK_EQUAL (lf.urn, "my-great-urn"); diff --git a/test/test.cc b/test/test.cc index d46c657b..3cb40aaf 100644 --- a/test/test.cc +++ b/test/test.cc @@ -58,10 +58,15 @@ #include "sound_asset_writer.h" #include "test.h" #include "util.h" +#include "warnings.h" +LIBDCP_DISABLE_WARNINGS #include <asdcp/KM_util.h> #include <asdcp/KM_prng.h> +LIBDCP_ENABLE_WARNINGS #include <sndfile.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/test/unit_test.hpp> #include <cstdio> #include <iostream> diff --git a/tools/dcprecover.cc b/tools/dcprecover.cc index f78b246c..840a6711 100644 --- a/tools/dcprecover.cc +++ b/tools/dcprecover.cc @@ -31,23 +31,30 @@ files in the program, then also delete it here. */ -#include "dcp.h" + +#include "asset_factory.h" #include "cpl.h" +#include "dcp.h" #include "exceptions.h" -#include "asset_factory.h" #include "reel_asset.h" +#include "warnings.h" #include <getopt.h> +LIBDCP_DISABLE_WARNINGS #include <libxml++/libxml++.h> +LIBDCP_ENABLE_WARNINGS #include <boost/filesystem.hpp> #include <iostream> + using std::cerr; using std::cout; -using std::string; +using std::make_shared; using std::shared_ptr; +using std::string; using std::vector; using boost::optional; + static void help (string n) { @@ -56,11 +63,13 @@ help (string n) << " -o, --output output DCP directory\n"; } + void progress (float f) { cout << (f * 100) << "% \r"; } + int main (int argc, char* argv[]) { @@ -115,10 +124,10 @@ main (int argc, char* argv[]) /* Look for a CPL */ shared_ptr<dcp::CPL> cpl; - for (boost::filesystem::directory_iterator i(dcp_dir); i != boost::filesystem::directory_iterator(); ++i) { - if (i->path().extension() == ".xml") { + for (auto i: boost::filesystem::directory_iterator(dcp_dir)) { + if (i.path().extension() == ".xml") { try { - cpl.reset(new dcp::CPL(i->path())); + cpl = make_shared<dcp::CPL>(i.path()); } catch (dcp::ReadError& e) { cout << "Error: " << e.what() << "\n"; } catch (xmlpp::parse_error& e) { @@ -137,12 +146,12 @@ main (int argc, char* argv[]) /* Read all MXF assets */ vector<shared_ptr<dcp::Asset>> assets; - for (boost::filesystem::directory_iterator i(dcp_dir); i != boost::filesystem::directory_iterator(); ++i) { - if (i->path().extension() == ".mxf") { + for (auto i: boost::filesystem::directory_iterator(dcp_dir)) { + if (i.path().extension() == ".mxf") { try { - shared_ptr<dcp::Asset> asset = dcp::asset_factory(i->path(), true); - asset->set_file (*output / i->path().filename()); - cout << "Hashing " << i->path().filename() << "\n"; + auto asset = dcp::asset_factory(i.path(), true); + asset->set_file (*output / i.path().filename()); + cout << "Hashing " << i.path().filename() << "\n"; asset->hash (&progress); cout << "100% \n"; assets.push_back (asset); @@ -66,7 +66,7 @@ def options(opt): def configure(conf): conf.load('compiler_cxx') conf.load('clang_compilation_database', tooldir=['waf-tools']) - conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS', '-std=c++11']) + conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-Wsuggest-override', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS', '-std=c++11']) gcc = conf.env['CC_VERSION'] if int(gcc[0]) >= 4 and int(gcc[1]) > 1: conf.env.append_value('CXXFLAGS', ['-Wno-maybe-uninitialized']) |
