From 6d27dbaab3b32ccebb076895fac3cc6aa3240d6c Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Sat, 24 Apr 2021 16:42:52 -0400 Subject: Fix most -Wall warnings (#115) * started on basic type errors * Done. For now * remove libgfxd binary * Most warnings fixed * Fix conflicts and new warnings * Makefile * Sig * Clang format * destructor * Add a bunch of destructors * clear the scalars vector after freeing the elements * PR fixes (Anghelo Alf) * Fix most clang -Wall warnings --- ZAPD/ZArray.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'ZAPD/ZArray.cpp') diff --git a/ZAPD/ZArray.cpp b/ZAPD/ZArray.cpp index dabe526..ac9561b 100644 --- a/ZAPD/ZArray.cpp +++ b/ZAPD/ZArray.cpp @@ -10,6 +10,11 @@ ZArray::ZArray(ZFile* nParent) : ZResource(nParent) canHaveInner = true; } +ZArray::~ZArray() +{ + delete testFile; +} + void ZArray::ParseXML(tinyxml2::XMLElement* reader) { ZResource::ParseXML(reader); @@ -29,7 +34,7 @@ std::string ZArray::GetSourceOutputCode(const std::string& prefix) StringHelper::Sprintf("Error! Array needs at least one sub-element.\n")); ZResource* res = testFile->resources[0]; - int resSize = res->GetRawDataSize(); + size_t resSize = res->GetRawDataSize(); if (!res->DoesSupportArray()) { @@ -38,9 +43,9 @@ std::string ZArray::GetSourceOutputCode(const std::string& prefix) res->GetName().c_str())); } - for (int i = 0; i < arrayCnt; i++) + for (size_t i = 0; i < arrayCnt; i++) { - int childIndex = rawDataIndex + (i * resSize); + size_t childIndex = rawDataIndex + (i * resSize); res->SetRawDataIndex(childIndex); res->ParseRawData(); std::string test = res->GetSourceOutputCode(""); @@ -58,13 +63,13 @@ std::string ZArray::GetSourceOutputCode(const std::string& prefix) return ""; } -int ZArray::GetRawDataSize() +size_t ZArray::GetRawDataSize() { return arrayCnt * testFile->resources[0]->GetRawDataSize(); } void ZArray::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, - const int nRawDataIndex, const std::string& nRelPath) + const uint32_t nRawDataIndex, const std::string& nRelPath) { rawData = nRawData; rawDataIndex = nRawDataIndex; -- cgit v1.2.3