summaryrefslogtreecommitdiff
path: root/src/utils/xml.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
commit5afe88df2538274859a162ffd63ed52118e80c19 (patch)
treeb610dfd58dc748fd63f49565b2a43eea2316714f /src/utils/xml.cpp
parent73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff)
downloadmana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2
mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz
mana-5afe88df2538274859a162ffd63ed52118e80c19.zip
Apply C++11 fixits
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
Diffstat (limited to 'src/utils/xml.cpp')
-rw-r--r--src/utils/xml.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index 839479d7..d0f51230 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -46,7 +46,7 @@ namespace XML
};
Document::Document(const std::string &filename, bool useResman):
- mDoc(0)
+ mDoc(nullptr)
{
XMLContext ctx;
ctx.file = filename;
@@ -54,7 +54,7 @@ namespace XML
xmlSetStructuredErrorFunc(&ctx, xmlLogger);
int size;
- char *data = NULL;
+ char *data = nullptr;
if (useResman)
{
ResourceManager *resman = ResourceManager::getInstance();
@@ -78,7 +78,7 @@ namespace XML
logger->log("Error loading %s", filename.c_str());
}
- xmlSetStructuredErrorFunc(NULL, xmlLogger);
+ xmlSetStructuredErrorFunc(nullptr, xmlLogger);
}
Document::~Document()
@@ -89,7 +89,7 @@ namespace XML
xmlNodePtr Document::rootNode()
{
- return mDoc ? xmlDocGetRootElement(mDoc) : 0;
+ return mDoc ? xmlDocGetRootElement(mDoc) : nullptr;
}
int getProperty(xmlNodePtr node, const char* name, int def)
@@ -152,12 +152,12 @@ namespace XML
if (xmlStrEqual(child->name, BAD_CAST name))
return child;
- return NULL;
+ return nullptr;
}
static void xmlLogger(void *ctx, xmlErrorPtr error)
{
- XMLContext *context = static_cast<XMLContext*>(ctx);
+ auto *context = static_cast<XMLContext*>(ctx);
if (context)
logger->log("Error in XML file '%s' on line %d",
@@ -180,7 +180,7 @@ namespace XML
LIBXML_TEST_VERSION;
// Handle libxml2 error messages
- xmlSetStructuredErrorFunc(NULL, xmlLogger);
+ xmlSetStructuredErrorFunc(nullptr, xmlLogger);
}
} // namespace XML