Fix some issues found with clang-tidy (#4353)

* directoryiterator: Fix missing inline

Add missing inline to inline function.

This was found with clang-tidy check:  misc-definitions-in-headers

* Convert deprecated throw() to noexcept

throw() has been deprecated in standar in C++17. It has been removed in
C++20. Code still compiles but let's just define these at those should
be.

These where found with clang-tidy check: modernize-use-noexcept

* Fix unnecessary copy initializations

Clang-tidy did find these with check:

  performance-unnecessary-copy-initialization

* Fix some strings not references

Looks like these are just missing reference marks.

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
Kari Argillander
2023-12-17 17:55:30 +02:00
committed by GitHub
parent 111fe90dd9
commit bf3c519183
15 changed files with 29 additions and 30 deletions

View File

@@ -33,13 +33,13 @@ class XML_API XMLStreamParserException: public Poco::XML::XMLException
public:
XMLStreamParserException(const std::string& name, Poco::UInt64 line, Poco::UInt64 column, const std::string& description);
XMLStreamParserException(const XMLStreamParser&, const std::string& description);
virtual ~XMLStreamParserException() throw ();
virtual ~XMLStreamParserException() noexcept;
const char* name() const noexcept;
Poco::UInt64 line() const;
Poco::UInt64 column() const;
const std::string& description() const;
virtual const char* what() const throw ();
virtual const char* what() const noexcept;
private:
void init();

View File

@@ -20,7 +20,7 @@ namespace Poco {
namespace XML {
XMLStreamParserException::~XMLStreamParserException() throw ()
XMLStreamParserException::~XMLStreamParserException() noexcept
{
}
@@ -79,7 +79,7 @@ const std::string& XMLStreamParserException::description() const
}
char const* XMLStreamParserException::what() const throw ()
char const* XMLStreamParserException::what() const noexcept
{
return _what.c_str();
}

View File

@@ -724,8 +724,7 @@ void XMLWriter::declareNamespaces(const XMLString& namespaceURI, const XMLString
for (int i = 0; i < attributes.getLength(); i++)
{
XMLString attributeNamespaceURI = attributes.getURI(i);
XMLString attributeLocalName = attributes.getLocalName(i);
XMLString attributeQName = attributes.getQName(i);
const XMLString& attributeQName = attributes.getQName(i);
XMLString attributePrefix;
XMLString attributeLocal;
@@ -774,9 +773,9 @@ void XMLWriter::declareAttributeNamespaces(const Attributes& attributes)
{
for (int i = 0; i < attributes.getLength(); i++)
{
XMLString namespaceURI = attributes.getURI(i);
XMLString localName = attributes.getLocalName(i);
XMLString qname = attributes.getQName(i);
const XMLString& namespaceURI = attributes.getURI(i);
const XMLString& localName = attributes.getLocalName(i);
const XMLString& qname = attributes.getQName(i);
if (!localName.empty())
{
XMLString prefix;
@@ -841,8 +840,8 @@ void XMLWriter::addAttributes(AttributeMap& attributeMap, const Attributes& attr
{
for (int i = 0; i < attributes.getLength(); i++)
{
XMLString namespaceURI = attributes.getURI(i);
XMLString localName = attributes.getLocalName(i);
const XMLString& namespaceURI = attributes.getURI(i);
const XMLString& localName = attributes.getLocalName(i);
XMLString qname = attributes.getQName(i);
if (!localName.empty())
{
@@ -866,8 +865,8 @@ void XMLWriter::addAttributes(CanonicalAttributeMap& attributeMap, const Attribu
{
for (int i = 0; i < attributes.getLength(); i++)
{
XMLString namespaceURI = attributes.getURI(i);
XMLString localName = attributes.getLocalName(i);
const XMLString& namespaceURI = attributes.getURI(i);
const XMLString& localName = attributes.getLocalName(i);
XMLString qname = attributes.getQName(i);
XMLString fullQName = qname;
if (!localName.empty())