summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-09 15:43:27 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-09 18:44:03 +0300
commite5726a11424ebd48f12d76149ec7e5e2b6278bdd (patch)
treebdcb9987f4109513a99f3a46e01687babc94a243 /src/utils
parentb4bdf86b6dd57045bd2d80cfcd5e0a428a5054b3 (diff)
downloadmanaplus-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.gz
manaplus-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.bz2
manaplus-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.xz
manaplus-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.zip
Fix code style.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/xml.cpp14
-rw-r--r--src/utils/xml.h2
2 files changed, 9 insertions, 7 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index eae3567ef..099457af3 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -79,7 +79,8 @@ static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg, ...)
namespace XML
{
Document::Document(const std::string &filename, const bool useResman) :
- mDoc(nullptr)
+ mDoc(nullptr),
+ mIsValid(false)
{
#ifdef USE_FUZZER
if (Fuzzer::conditionTerminate(filename.c_str()))
@@ -134,7 +135,8 @@ namespace XML
}
Document::Document(const char *const data, const int size) :
- mDoc(data ? xmlParseMemory(data, size) : nullptr)
+ mDoc(data ? xmlParseMemory(data, size) : nullptr),
+ mIsValid(true)
{
}
@@ -241,7 +243,7 @@ namespace XML
return def;
}
- XmlNodePtr findFirstChildByName(const XmlNodePtr parent,
+ XmlNodePtr findFirstChildByName(const XmlNodePtrConst parent,
const char *const name)
{
for_each_xml_child_node(child, parent)
@@ -272,11 +274,11 @@ namespace XML
bool Document::validateXml(const std::string &fileName)
{
- xmlDocPtr doc = xmlReadFile(fileName.c_str(),
+ const xmlDocPtr doc = xmlReadFile(fileName.c_str(),
nullptr, XML_PARSE_PEDANTIC);
- const bool valid(doc);
+ const bool valid1(doc);
xmlFreeDoc(doc);
- if (!valid)
+ if (!valid1)
return false;
std::ifstream file;
diff --git a/src/utils/xml.h b/src/utils/xml.h
index 9ed433ad5..85fa82270 100644
--- a/src/utils/xml.h
+++ b/src/utils/xml.h
@@ -150,7 +150,7 @@ namespace XML
/**
* Finds the first child node with the given name
*/
- XmlNodePtr findFirstChildByName(const XmlNodePtr parent,
+ XmlNodePtr findFirstChildByName(const XmlNodePtrConst parent,
const char *const name) A_WARN_UNUSED;
void initXML();