From bf685695299b37cae488d02ad13ba62a6d3869b2 Mon Sep 17 00:00:00 2001 From: e1528532 Date: Sat, 1 Apr 2017 22:56:16 +0200 Subject: [PATCH] fix-xerces-plugin-locale: suppress unused warning (used in logging), reformat #1280 --- src/plugins/xerces/serializer.cpp | 3 ++- src/plugins/xerces/util.hpp | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/xerces/serializer.cpp b/src/plugins/xerces/serializer.cpp index 68083e9a649..54738763e42 100644 --- a/src/plugins/xerces/serializer.cpp +++ b/src/plugins/xerces/serializer.cpp @@ -36,7 +36,8 @@ DOMElement * findChildWithName (DOMNode const & elem, string const & name) return nullptr; } -void key2xml (DOMDocument & doc, DOMElement & elem, string name, Key const & key) +// the name parameter is only used in debug mode for logging, not in production, so we suppress the warning +void key2xml (DOMDocument & doc, DOMElement & elem, string name ELEKTRA_UNUSED, Key const & key) { ELEKTRA_LOG_DEBUG ("updating element %s", name.c_str ()); diff --git a/src/plugins/xerces/util.hpp b/src/plugins/xerces/util.hpp index 06024c2e760..b5bae23ecc3 100644 --- a/src/plugins/xerces/util.hpp +++ b/src/plugins/xerces/util.hpp @@ -13,8 +13,8 @@ #define ELEKTRA_PLUGIN_XERCES_UTIL_H #include -#include #include +#include namespace xerces { @@ -52,13 +52,14 @@ using XercesPtr = std::unique_ptr>; inline XercesPtr toXMLCh (std::string const & str) { // XMLByte required by TranscodeFromStr is an unsigned char * but basically they can be used equivalently - return XercesPtr (XERCES_CPP_NAMESPACE::TranscodeFromStr (reinterpret_cast (str.c_str ()), str.size(), "UTF-8").adopt()); + return XercesPtr ( + XERCES_CPP_NAMESPACE::TranscodeFromStr (reinterpret_cast (str.c_str ()), str.size (), "UTF-8").adopt ()); } inline XercesPtr toCStr (XMLCh const * xmlCh) { // XMLByte returned by TranscodeToStr is an unsigned char * but basically they can be used equivalently - return XercesPtr (reinterpret_cast(XERCES_CPP_NAMESPACE::TranscodeToStr (xmlCh,"UTF-8").adopt())); + return XercesPtr (reinterpret_cast (XERCES_CPP_NAMESPACE::TranscodeToStr (xmlCh, "UTF-8").adopt ())); } inline std::string toStr (XMLCh const * xmlCh)