Skip to content

Commit

Permalink
fix-xerces-plugin-locale: suppress unused warning (used in logging), …
Browse files Browse the repository at this point in the history
  • Loading branch information
e1528532 committed Apr 1, 2017
1 parent 71167f8 commit bf68569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/plugins/xerces/serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ());

Expand Down
7 changes: 4 additions & 3 deletions src/plugins/xerces/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#define ELEKTRA_PLUGIN_XERCES_UTIL_H

#include <memory>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/TransService.hpp>
#include <xercesc/util/XMLString.hpp>

namespace xerces
{
Expand Down Expand Up @@ -52,13 +52,14 @@ using XercesPtr = std::unique_ptr<T, XercesDeleter<T>>;
inline XercesPtr<XMLCh> toXMLCh (std::string const & str)
{
// XMLByte required by TranscodeFromStr is an unsigned char * but basically they can be used equivalently
return XercesPtr<XMLCh> (XERCES_CPP_NAMESPACE::TranscodeFromStr (reinterpret_cast<const XMLByte*> (str.c_str ()), str.size(), "UTF-8").adopt());
return XercesPtr<XMLCh> (
XERCES_CPP_NAMESPACE::TranscodeFromStr (reinterpret_cast<const XMLByte *> (str.c_str ()), str.size (), "UTF-8").adopt ());
}

inline XercesPtr<char> toCStr (XMLCh const * xmlCh)
{
// XMLByte returned by TranscodeToStr is an unsigned char * but basically they can be used equivalently
return XercesPtr<char> (reinterpret_cast<char*>(XERCES_CPP_NAMESPACE::TranscodeToStr (xmlCh,"UTF-8").adopt()));
return XercesPtr<char> (reinterpret_cast<char *> (XERCES_CPP_NAMESPACE::TranscodeToStr (xmlCh, "UTF-8").adopt ()));
}

inline std::string toStr (XMLCh const * xmlCh)
Expand Down

0 comments on commit bf68569

Please sign in to comment.