diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-16 01:47:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-16 01:47:17 +0300 |
commit | b293d99a34d21d137374e46386b8669907cb3c1d (patch) | |
tree | 7e5e20e2b81e239878c13229c4d02139e8b85c2b /src/resources/db | |
parent | 34f943198afd1f7f342d63bd70d30cdeacd3dbad (diff) | |
download | mv-b293d99a34d21d137374e46386b8669907cb3c1d.tar.gz mv-b293d99a34d21d137374e46386b8669907cb3c1d.tar.bz2 mv-b293d99a34d21d137374e46386b8669907cb3c1d.tar.xz mv-b293d99a34d21d137374e46386b8669907cb3c1d.zip |
add missing const in xmlnode pointers.
Diffstat (limited to 'src/resources/db')
-rw-r--r-- | src/resources/db/avatardb.cpp | 2 | ||||
-rw-r--r-- | src/resources/db/chardb.cpp | 2 | ||||
-rw-r--r-- | src/resources/db/colordb.cpp | 4 | ||||
-rw-r--r-- | src/resources/db/deaddb.cpp | 2 | ||||
-rw-r--r-- | src/resources/db/emotedb.cpp | 4 | ||||
-rw-r--r-- | src/resources/db/itemdb.cpp | 20 | ||||
-rw-r--r-- | src/resources/db/mapdb.cpp | 12 | ||||
-rw-r--r-- | src/resources/db/moddb.cpp | 2 | ||||
-rw-r--r-- | src/resources/db/npcdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/db/petdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/db/sounddb.cpp | 2 |
11 files changed, 30 insertions, 24 deletions
diff --git a/src/resources/db/avatardb.cpp b/src/resources/db/avatardb.cpp index b522c6b76..e51a8d468 100644 --- a/src/resources/db/avatardb.cpp +++ b/src/resources/db/avatardb.cpp @@ -52,7 +52,7 @@ void AvatarDB::load() void AvatarDB::loadXmlFile(const std::string &fileName) { XML::Document doc(fileName); - const XmlNodePtr rootNode = doc.rootNode(); + const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "avatars")) { diff --git a/src/resources/db/chardb.cpp b/src/resources/db/chardb.cpp index 80ddedc37..2d4e2fee2 100644 --- a/src/resources/db/chardb.cpp +++ b/src/resources/db/chardb.cpp @@ -48,7 +48,7 @@ void CharDB::load() XML::Document *doc = new XML::Document( paths.getStringValue("charCreationFile")); - const XmlNodePtr root = doc->rootNode(); + const XmlNodePtrConst root = doc->rootNode(); if (!root || !xmlNameEqual(root, "chars")) { diff --git a/src/resources/db/colordb.cpp b/src/resources/db/colordb.cpp index 34e0614c0..1236a35f1 100644 --- a/src/resources/db/colordb.cpp +++ b/src/resources/db/colordb.cpp @@ -78,7 +78,7 @@ void ColorDB::loadHair(const std::string &fileName, std::map<int, ItemColor> &colors) { XML::Document *doc = new XML::Document(fileName); - XmlNodePtr root = doc->rootNode(); + XmlNodePtrConst root = doc->rootNode(); if (!root || !xmlNameEqual(root, "colors")) { @@ -116,7 +116,7 @@ void ColorDB::loadHair(const std::string &fileName, void ColorDB::loadColorLists(const std::string &fileName) { XML::Document *doc = new XML::Document(fileName); - const XmlNodePtr root = doc->rootNode(); + const XmlNodePtrConst root = doc->rootNode(); if (!root) { delete doc; diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp index 870b77394..e66e87e6a 100644 --- a/src/resources/db/deaddb.cpp +++ b/src/resources/db/deaddb.cpp @@ -49,7 +49,7 @@ void DeadDB::load() void DeadDB::loadXmlFile(const std::string &fileName) { XML::Document *doc = new XML::Document(fileName); - const XmlNodePtr root = doc->rootNode(); + const XmlNodePtrConst root = doc->rootNode(); if (!root || !xmlNameEqual(root, "messages")) { diff --git a/src/resources/db/emotedb.cpp b/src/resources/db/emotedb.cpp index 7c710795f..594bcce5d 100644 --- a/src/resources/db/emotedb.cpp +++ b/src/resources/db/emotedb.cpp @@ -65,7 +65,7 @@ void EmoteDB::load() void EmoteDB::loadXmlFile(const std::string &fileName) { XML::Document doc(fileName); - XmlNodePtr rootNode = doc.rootNode(); + XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "emotes")) { @@ -139,7 +139,7 @@ void EmoteDB::loadXmlFile(const std::string &fileName) void EmoteDB::loadSpecialXmlFile(const std::string &fileName) { XML::Document doc(fileName); - XmlNodePtr rootNode = doc.rootNode(); + XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "emotes")) { diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index 4c47658e6..9865cc3ef 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -48,13 +48,16 @@ namespace extern int serverVersion; // Forward declarations -static void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node); -static void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node); +static void loadSpriteRef(ItemInfo *const itemInfo, + const XmlNodePtr node); +static void loadSoundRef(ItemInfo *const itemInfo, + const XmlNodePtr node); static void loadFloorSprite(SpriteDisplay *const display, - const XmlNodePtr node); + const XmlNodePtrConst node); static void loadReplaceSprite(ItemInfo *const itemInfo, const XmlNodePtr replaceNode); -static void loadOrderSprite(ItemInfo *const itemInfo, const XmlNodePtr node, +static void loadOrderSprite(ItemInfo *const itemInfo, + const XmlNodePtr node, const bool drawAfter); static int parseSpriteName(const std::string &name); static int parseDirectionName(const std::string &name); @@ -757,7 +760,8 @@ void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node) } } -void loadFloorSprite(SpriteDisplay *const display, const XmlNodePtr floorNode) +void loadFloorSprite(SpriteDisplay *const display, + const XmlNodePtrConst floorNode) { for_each_xml_child_node(spriteNode, floorNode) { @@ -778,7 +782,8 @@ void loadFloorSprite(SpriteDisplay *const display, const XmlNodePtr floorNode) } } -void loadReplaceSprite(ItemInfo *const itemInfo, const XmlNodePtr replaceNode) +void loadReplaceSprite(ItemInfo *const itemInfo, + const XmlNodePtr replaceNode) { const std::string removeSprite = XML::getProperty( replaceNode, "sprite", ""); @@ -909,7 +914,8 @@ void loadReplaceSprite(ItemInfo *const itemInfo, const XmlNodePtr replaceNode) } } -void loadOrderSprite(ItemInfo *const itemInfo, const XmlNodePtr node, +void loadOrderSprite(ItemInfo *const itemInfo, + const XmlNodePtr node, const bool drawAfter) { const int sprite = parseSpriteName(XML::getProperty(node, "name", "")); diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp index 4b5fb0f42..20d108f13 100644 --- a/src/resources/db/mapdb.cpp +++ b/src/resources/db/mapdb.cpp @@ -38,8 +38,8 @@ namespace namespace MapDB { - void readMap(XmlNodePtr node); - void readAtlas(XmlNodePtr node); + void readMap(XmlNodePtrConst node); + void readAtlas(XmlNodePtrConst node); } void MapDB::load() @@ -59,7 +59,7 @@ void MapDB::loadRemap() XML::Document *const doc = new XML::Document( paths.getStringValue("mapsRemapFile")); - const XmlNodePtr root = doc->rootNode(); + const XmlNodePtrConst root = doc->rootNode(); if (!root) { delete doc; @@ -85,7 +85,7 @@ void MapDB::loadRemap() delete doc; } -void MapDB::readMap(XmlNodePtr node) +void MapDB::readMap(XmlNodePtrConst node) { const std::string map = XML::getProperty(node, "name", ""); if (map.empty()) @@ -103,7 +103,7 @@ void MapDB::readMap(XmlNodePtr node) } } -void MapDB::readAtlas(XmlNodePtr node) +void MapDB::readAtlas(XmlNodePtrConst node) { const std::string atlas = XML::getProperty(node, "name", ""); if (atlas.empty()) @@ -132,7 +132,7 @@ void MapDB::readAtlas(XmlNodePtr node) void MapDB::loadInfo(const std::string &fileName) { XML::Document *doc = new XML::Document(fileName); - const XmlNodePtr root = doc->rootNode(); + const XmlNodePtrConst root = doc->rootNode(); if (!root) { delete doc; diff --git a/src/resources/db/moddb.cpp b/src/resources/db/moddb.cpp index 32846696b..4cdc96b3d 100644 --- a/src/resources/db/moddb.cpp +++ b/src/resources/db/moddb.cpp @@ -51,7 +51,7 @@ void ModDB::load() void ModDB::loadXmlFile(const std::string &fileName) { XML::Document doc(fileName); - const XmlNodePtr rootNode = doc.rootNode(); + const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "mods")) { diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp index 412de1a1b..359c86c4a 100644 --- a/src/resources/db/npcdb.cpp +++ b/src/resources/db/npcdb.cpp @@ -57,7 +57,7 @@ void NPCDB::load() void NPCDB::loadXmlFile(const std::string &fileName) { XML::Document doc(fileName); - const XmlNodePtr rootNode = doc.rootNode(); + const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "npcs")) { diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp index 0529ee874..c9f3bdbeb 100644 --- a/src/resources/db/petdb.cpp +++ b/src/resources/db/petdb.cpp @@ -56,7 +56,7 @@ void PETDB::load() void PETDB::loadXmlFile(const std::string &fileName) { XML::Document doc(fileName); - const XmlNodePtr rootNode = doc.rootNode(); + const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "pets")) { diff --git a/src/resources/db/sounddb.cpp b/src/resources/db/sounddb.cpp index ad98b2705..17ff4bc71 100644 --- a/src/resources/db/sounddb.cpp +++ b/src/resources/db/sounddb.cpp @@ -47,7 +47,7 @@ void SoundDB::load() void SoundDB::loadXmlFile(const std::string &fileName) { XML::Document *doc = new XML::Document(fileName); - const XmlNodePtr root = doc->rootNode(); + const XmlNodePtrConst root = doc->rootNode(); if (!root || !xmlNameEqual(root, "sounds")) { |