diff --git a/3rdparty/libpng/libpng b/3rdparty/libpng/libpng index f5e92d7697..51f5bd68b9 160000 --- a/3rdparty/libpng/libpng +++ b/3rdparty/libpng/libpng @@ -1 +1 @@ -Subproject commit f5e92d76973a7a53f517579bc95d61483bf108c0 +Subproject commit 51f5bd68b9b806d2c92b4318164d28b49357da31 diff --git a/3rdparty/pugixml b/3rdparty/pugixml index db78afc2b7..ee86beb30e 160000 --- a/3rdparty/pugixml +++ b/3rdparty/pugixml @@ -1 +1 @@ -Subproject commit db78afc2b7d8f043b4bc6b185635d949ea2ed2a8 +Subproject commit ee86beb30e4973f5feffe3ce63bfa4fbadf72f38 diff --git a/Utilities/File.cpp b/Utilities/File.cpp index 3c4a8c769d..e2dd842ae6 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -21,7 +21,7 @@ using namespace std::literals::string_literals; #include #include -static std::unique_ptr to_wchar(const std::string& source) +static std::unique_ptr to_wchar(std::string_view source) { // String size + null terminator const usz buf_size = source.size() + 1; @@ -44,7 +44,7 @@ static std::unique_ptr to_wchar(const std::string& source) std::memcpy(buffer.get() + 32768 + 4, L"UNC\\", 4 * sizeof(wchar_t)); } - ensure(MultiByteToWideChar(CP_UTF8, 0, source.c_str(), size, buffer.get() + 32768 + (unc ? 8 : 4), size)); // "to_wchar" + ensure(MultiByteToWideChar(CP_UTF8, 0, source.data(), size, buffer.get() + 32768 + (unc ? 8 : 4), size)); // "to_wchar" // Canonicalize wide path (replace '/', ".", "..", \\ repetitions, etc) ensure(GetFullPathNameW(buffer.get() + 32768, 32768, buffer.get(), nullptr) - 1 < 32768 - 1); // "to_wchar" diff --git a/Utilities/rXml.cpp b/Utilities/rXml.cpp index db52fb38e3..14ac0659f6 100644 --- a/Utilities/rXml.cpp +++ b/Utilities/rXml.cpp @@ -49,12 +49,11 @@ std::string rXmlNode::GetName() return {}; } -std::string rXmlNode::GetAttribute(const std::string& name) +std::string rXmlNode::GetAttribute(std::string_view name) { if (handle) { - const auto pred = [&name](const pugi::xml_attribute& attr) { return (name == attr.name()); }; - if (const pugi::xml_attribute attr = handle.find_attribute(pred)) + if (const pugi::xml_attribute attr = handle.attribute(name)) { if (const pugi::char_t* value = attr.value()) { @@ -86,7 +85,7 @@ rXmlDocument::rXmlDocument() { } -pugi::xml_parse_result rXmlDocument::Read(const std::string& data) +pugi::xml_parse_result rXmlDocument::Read(std::string_view data) { if (handle) { diff --git a/Utilities/rXml.h b/Utilities/rXml.h index 71ca257902..8b70d06ee4 100644 --- a/Utilities/rXml.h +++ b/Utilities/rXml.h @@ -23,7 +23,7 @@ struct rXmlNode std::shared_ptr GetChildren(); std::shared_ptr GetNext(); std::string GetName(); - std::string GetAttribute(const std::string& name); + std::string GetAttribute(std::string_view name); std::string GetNodeContent(); pugi::xml_node handle{}; @@ -34,7 +34,7 @@ struct rXmlDocument rXmlDocument(); rXmlDocument(const rXmlDocument& other) = delete; rXmlDocument &operator=(const rXmlDocument& other) = delete; - pugi::xml_parse_result Read(const std::string& data); + pugi::xml_parse_result Read(std::string_view data); virtual std::shared_ptr GetRoot(); pugi::xml_document handle{};