summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-01-30 01:32:04 +0100
committerCarl Hetherington <cth@carlh.net>2025-01-31 01:41:36 +0100
commitc85d5ae643df5f2fa399398796feaa6f42b114a7 (patch)
tree3976bf014b74f167fd696cc1a73ca115be49c7bf
parent744eae9a14f834088289d10d7158ad89857565ad (diff)
Fix up for const fix in libcxml.v1.10.9
-rw-r--r--cscript2
-rw-r--r--src/certificate_chain.cc10
-rw-r--r--src/verify.cc2
-rw-r--r--test/mca_test.cc8
-rw-r--r--test/test.cc18
-rw-r--r--test/test.h2
6 files changed, 22 insertions, 20 deletions
diff --git a/cscript b/cscript
index b3d27523..0d9fb622 100644
--- a/cscript
+++ b/cscript
@@ -36,7 +36,7 @@ import shutil
def dependencies(target, options):
deps = [
- ('libcxml', 'v0.17.11', { 'c++17': target.platform.startswith('osx') }),
+ ('libcxml', 'v0.17.13', { 'c++17': target.platform.startswith('osx') }),
('openjpeg', 'ad8edaacd54a862940d0a77c41ecda5858b54d6e'),
('asdcplib', 'v1.0.5')
]
diff --git a/src/certificate_chain.cc b/src/certificate_chain.cc
index 9ddcbce3..3bfd63f2 100644
--- a/src/certificate_chain.cc
+++ b/src/certificate_chain.cc
@@ -654,13 +654,15 @@ CertificateChain::sign (xmlpp::Element* parent, Standard standard) const
void
CertificateChain::add_signature_value (xmlpp::Element* parent, string ns, bool add_indentation) const
{
- cxml::Node cp (parent);
- auto key_info = dynamic_cast<xmlpp::Element*>(cp.node_child("KeyInfo")->node());
- DCP_ASSERT(key_info);
+ auto children = parent->get_children();
+ auto key_info = std::find_if(children.begin(), children.end(), [](xmlpp::Node* node) {
+ return node->get_name() == "KeyInfo";
+ });
+ DCP_ASSERT(key_info != children.end());
/* Add the certificate chain to the KeyInfo child node of parent */
for (auto const& i: leaf_to_root()) {
- auto data = cxml::add_child(key_info, "X509Data", ns);
+ auto data = cxml::add_child(dynamic_cast<xmlpp::Element*>(*key_info), "X509Data", ns);
{
auto serial = cxml::add_child(data, "X509IssuerSerial", ns);
diff --git a/src/verify.cc b/src/verify.cc
index 8d33bc0b..7186a0c5 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -801,7 +801,7 @@ verify_subtitle_asset(Context& context, shared_ptr<const TextAsset> asset, optio
auto namespace_count = [](shared_ptr<const TextAsset> asset, string root_node) {
cxml::Document doc(root_node);
doc.read_string(asset->raw_xml().get());
- auto root = dynamic_cast<xmlpp::Element*>(doc.node())->cobj();
+ auto root = dynamic_cast<xmlpp::Element const*>(doc.node())->cobj();
int count = 0;
for (auto ns = root->nsDef; ns != nullptr; ns = ns->next) {
++count;
diff --git a/test/mca_test.cc b/test/mca_test.cc
index 1cd95732..e6b0dfab 100644
--- a/test/mca_test.cc
+++ b/test/mca_test.cc
@@ -80,10 +80,10 @@ BOOST_AUTO_TEST_CASE (parse_mca_descriptors_from_mxf_test)
vector<string> ignore;
check_xml (
- dynamic_cast<xmlpp::Element*>(
+ dynamic_cast<xmlpp::Element const*>(
ref.node_child("ReelList")->node_children("Reel").front()->node_child("AssetList")->node_child("CompositionMetadataAsset")->node_child("MCASubDescriptors")->node()
),
- dynamic_cast<xmlpp::Element*>(
+ dynamic_cast<xmlpp::Element const*>(
check.node_child("ReelList")->node_children("Reel").front()->node_child("AssetList")->node_child("CompositionMetadataAsset")->node_child("MCASubDescriptors")->node()
),
ignore,
@@ -132,10 +132,10 @@ BOOST_AUTO_TEST_CASE (write_mca_descriptors_to_mxf_test)
cxml::Document check("CompositionPlaylist", "build/test/write_mca_descriptors_to_mxf_test/cpl.xml");
check_xml (
- dynamic_cast<xmlpp::Element*>(
+ dynamic_cast<xmlpp::Element const*>(
ref.node_child("ReelList")->node_children("Reel")[0]->node_child("AssetList")->node_child("CompositionMetadataAsset")->node_child("MCASubDescriptors")->node()
),
- dynamic_cast<xmlpp::Element*>(
+ dynamic_cast<xmlpp::Element const*>(
check.node_child("ReelList")->node_children("Reel")[0]->node_child("AssetList")->node_child("CompositionMetadataAsset")->node_child("MCASubDescriptors")->node()
),
{ "InstanceID", "MCALinkID", "SoundfieldGroupLinkID" },
diff --git a/test/test.cc b/test/test.cc
index 65649efd..0de9c73c 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -116,7 +116,7 @@ struct TestConfig
void
-check_xml (xmlpp::Element* ref, xmlpp::Element* test, vector<string> ignore_tags, bool ignore_whitespace)
+check_xml(xmlpp::Element const* ref, xmlpp::Element const* test, vector<string> ignore_tags, bool ignore_whitespace)
{
BOOST_CHECK_EQUAL (ref->get_name (), test->get_name ());
BOOST_CHECK_EQUAL (ref->get_namespace_prefix (), test->get_namespace_prefix ());
@@ -125,8 +125,8 @@ check_xml (xmlpp::Element* ref, xmlpp::Element* test, vector<string> ignore_tags
return;
}
- auto whitespace_content = [](xmlpp::Node* node) {
- auto content = dynamic_cast<xmlpp::ContentNode*>(node);
+ auto whitespace_content = [](xmlpp::Node const* node) {
+ auto content = dynamic_cast<xmlpp::ContentNode const*>(node);
return content && content->get_content().find_first_not_of(" \t\r\n") == string::npos;
};
@@ -137,12 +137,12 @@ check_xml (xmlpp::Element* ref, xmlpp::Element* test, vector<string> ignore_tags
auto l = test_children.begin ();
while (k != ref_children.end() && l != test_children.end()) {
- if (dynamic_cast<xmlpp::CommentNode*>(*k)) {
+ if (dynamic_cast<xmlpp::CommentNode const*>(*k)) {
++k;
continue;
}
- if (dynamic_cast<xmlpp::CommentNode*>(*l)) {
+ if (dynamic_cast<xmlpp::CommentNode const*>(*l)) {
++l;
continue;
}
@@ -159,15 +159,15 @@ check_xml (xmlpp::Element* ref, xmlpp::Element* test, vector<string> ignore_tags
/* XXX: should be doing xmlpp::EntityReference, xmlpp::XIncludeEnd, xmlpp::XIncludeStart */
- auto ref_el = dynamic_cast<xmlpp::Element*> (*k);
- auto test_el = dynamic_cast<xmlpp::Element*> (*l);
+ auto ref_el = dynamic_cast<xmlpp::Element const*>(*k);
+ auto test_el = dynamic_cast<xmlpp::Element const*>(*l);
BOOST_CHECK ((ref_el && test_el) || (!ref_el && !test_el));
if (ref_el && test_el) {
check_xml (ref_el, test_el, ignore_tags, ignore_whitespace);
}
- auto ref_cn = dynamic_cast<xmlpp::ContentNode*> (*k);
- auto test_cn = dynamic_cast<xmlpp::ContentNode*> (*l);
+ auto ref_cn = dynamic_cast<xmlpp::ContentNode const*>(*k);
+ auto test_cn = dynamic_cast<xmlpp::ContentNode const*>(*l);
BOOST_CHECK ((ref_cn && test_cn) || (!ref_cn && !test_cn));
if (ref_cn && test_cn) {
BOOST_CHECK_EQUAL (ref_cn->get_content(), test_cn->get_content());
diff --git a/test/test.h b/test/test.h
index d796a4a4..28c3b70a 100644
--- a/test/test.h
+++ b/test/test.h
@@ -40,7 +40,7 @@ namespace dcp {
extern boost::filesystem::path private_test;
extern boost::filesystem::path xsd_test;
-extern void check_xml (xmlpp::Element* ref, xmlpp::Element* test, std::vector<std::string> ignore_tags, bool ignore_whitespace = false);
+extern void check_xml(xmlpp::Element const* ref, xmlpp::Element const* test, std::vector<std::string> ignore_tags, bool ignore_whitespace = false);
extern void check_xml (std::string ref, std::string test, std::vector<std::string> ignore, bool ignore_whitespace = false);
extern void check_file (boost::filesystem::path ref, boost::filesystem::path check);
extern std::shared_ptr<dcp::MonoJ2KPictureAsset> simple_picture (