Tidy up the source code

* Replaced push_back calls with emplace_back where applicable.
* Replaced size() == 0 and size() != 0 with empty() and !empty().
* Replaced C style loops for range for loops where applicable.
* Fixed mismatching arg names between function declarations and definitions.
* Replaced NULL and 0 (in the context of pointers) with nullptr.
* Remove unnecessary calls to string::c_str() where applicable.
* Replaced deprecated C headers with proper C++ headers.
* Removed unnecessary null pointer checks when deleting pointers
(deleting a null pointer has no effect).
* Fixed a potential memory leak in apngloader.cpp file.
* Replaced unsafe strcpy with strncpy in the demangle_name function.
This commit is contained in:
Kamil Chojnowski
2019-10-10 00:21:26 +02:00
parent caae18dbce
commit 869de6886f
59 changed files with 202 additions and 199 deletions

View File

@@ -133,7 +133,7 @@ public:
const std::vector<CreatureTypePtr>& getCreatures() { return m_creatures; }
protected:
void internalLoadCreatureBuffer(TiXmlElement* elem, const CreatureTypePtr& m);
void internalLoadCreatureBuffer(TiXmlElement* attrib, const CreatureTypePtr& m);
private:
std::vector<CreatureTypePtr> m_creatures;