diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2021-03-19 14:52:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-19 14:52:04 -0400 |
| commit | 1675f20955dca5f94fdf4b6b1f28532da9c83665 (patch) | |
| tree | ed80703d09b11b416c0f81cc09708ebcb10d0479 /ZAPD/ZRoom | |
| parent | 50122b91242734ebf893af9f64b674127b73d831 (diff) | |
Fix all warnings output by Clang++ (#94)
* started on basic type errors
* Done. For now
* remove libgfxd binary
* Fix Clang Warnings
* Fix2
* Fix rollback of #92 and missed warning in ZCutscene.cpp
* ?
* add stdexcept to ZResource
* Fix make clean
* PR fixes
* Fix make file stuff
* Remove many more errors and remove -Wall
* Turns out Globals was used
Co-authored-by: Fig02 <fig02srl@gmail.com>
Diffstat (limited to 'ZAPD/ZRoom')
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetCutscenes.cpp | 3 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetPathways.cpp | 2 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetStartPositionList.cpp | 3 | ||||
| -rw-r--r-- | ZAPD/ZRoom/ZRoom.cpp | 24 |
4 files changed, 13 insertions, 19 deletions
diff --git a/ZAPD/ZRoom/Commands/SetCutscenes.cpp b/ZAPD/ZRoom/Commands/SetCutscenes.cpp index 3a8cb3f..da88017 100644 --- a/ZAPD/ZRoom/Commands/SetCutscenes.cpp +++ b/ZAPD/ZRoom/Commands/SetCutscenes.cpp @@ -9,8 +9,7 @@ using namespace std; SetCutscenes::SetCutscenes(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawDataIndex) : ZRoomCommand(nZRoom, rawData, rawDataIndex) { segmentOffset = BitConverter::ToInt32BE(rawData, rawDataIndex + 4) & 0x00FFFFFF; - - uint32_t curPtr = segmentOffset; + string output = ""; cutscene = new ZCutscene(rawData, segmentOffset, 9999); diff --git a/ZAPD/ZRoom/Commands/SetPathways.cpp b/ZAPD/ZRoom/Commands/SetPathways.cpp index 6795d99..a4f5e8d 100644 --- a/ZAPD/ZRoom/Commands/SetPathways.cpp +++ b/ZAPD/ZRoom/Commands/SetPathways.cpp @@ -16,8 +16,6 @@ SetPathways::SetPathways(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawDat InitList(GETSEGOFFSET(BitConverter::ToInt32BE(rawData, rawDataIndex + 4))); - uint32_t currentPtr = listSegmentOffset; - if (segmentOffset != 0) zRoom->parent->AddDeclarationPlaceholder(segmentOffset); } diff --git a/ZAPD/ZRoom/Commands/SetStartPositionList.cpp b/ZAPD/ZRoom/Commands/SetStartPositionList.cpp index e16373f..a17dc5e 100644 --- a/ZAPD/ZRoom/Commands/SetStartPositionList.cpp +++ b/ZAPD/ZRoom/Commands/SetStartPositionList.cpp @@ -9,7 +9,7 @@ using namespace std; SetStartPositionList::SetStartPositionList(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawDataIndex) : ZRoomCommand(nZRoom, rawData, rawDataIndex) { - int numActors = rawData[rawDataIndex + 1]; + uint8_t numActors = rawData[rawDataIndex + 1]; segmentOffset = GETSEGOFFSET(BitConverter::ToInt32BE(rawData, rawDataIndex + 4)); if (segmentOffset != 0) @@ -35,7 +35,6 @@ SetStartPositionList::~SetStartPositionList() string SetStartPositionList::GenerateSourceCodePass1(string roomName, int baseAddress) { string sourceOutput = ""; - char line[2048]; sourceOutput += StringHelper::Sprintf("%s 0x%02X, (u32)&%sStartPositionList0x%06X", ZRoomCommand::GenerateSourceCodePass1(roomName, baseAddress).c_str(), actors.size(), zRoom->GetName().c_str(), segmentOffset); diff --git a/ZAPD/ZRoom/ZRoom.cpp b/ZAPD/ZRoom/ZRoom.cpp index b0e9756..43bf1a4 100644 --- a/ZAPD/ZRoom/ZRoom.cpp +++ b/ZAPD/ZRoom/ZRoom.cpp @@ -312,8 +312,7 @@ void ZRoom::ProcessCommandSets() cmd->commandSet = commandSet & 0x00FFFFFF; string pass1 = cmd->GenerateSourceCodePass1(name, cmd->commandSet); - Declaration* decl = parent->AddDeclaration(cmd->cmdAddress, - i == 0 ? DeclarationAlignment::Align16 : DeclarationAlignment::None, 8, + Declaration* decl = parent->AddDeclaration(cmd->cmdAddress, i == 0 ? DeclarationAlignment::Align16 : DeclarationAlignment::None, 8, StringHelper::Sprintf("static %s", cmd->GetCommandCName().c_str()), StringHelper::Sprintf("%sSet%04XCmd%02X", name.c_str(), commandSet & 0x00FFFFFF, cmd->cmdIndex, cmd->cmdID), StringHelper::Sprintf("%s", pass1.c_str())); @@ -330,12 +329,11 @@ void ZRoom::ProcessCommandSets() for (ZRoomCommand* cmd : commands) { string pass2 = cmd->GenerateSourceCodePass2(name, cmd->commandSet); - if (pass2 != "") { - parent->AddDeclaration(cmd->cmdAddress, DeclarationAlignment::None, 8, - StringHelper::Sprintf("static %s", cmd->GetCommandCName().c_str()), - StringHelper::Sprintf("%sSet%04XCmd%02X", name.c_str(), cmd->commandSet & 0x00FFFFFF, cmd->cmdIndex), - StringHelper::Sprintf("%s // 0x%04X", pass2.c_str(), cmd->cmdAddress)); - } + + if (pass2 != "") + parent->AddDeclaration(cmd->cmdAddress, DeclarationAlignment::None, 8, StringHelper::Sprintf("static %s", cmd->GetCommandCName().c_str()), + StringHelper::Sprintf("%sSet%04XCmd%02X", name.c_str(), cmd->commandSet & 0x00FFFFFF, cmd->cmdIndex, cmd->cmdID), + StringHelper::Sprintf("%s // 0x%04X", pass2.c_str(), cmd->cmdAddress)); } } @@ -350,12 +348,12 @@ void ZRoom::SyotesRoomHack() 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08 }; - for (int i = 0; i < sizeof(headerData); i++) + for (uint32_t i = 0; i < sizeof(headerData); i++) rawData.insert(rawData.begin() + i, headerData[i]); SetMesh* cmdSetMesh = new SetMesh(this, rawData, 0, -8); - for (int i = 0; i < sizeof(headerData); i++) + for (uint32_t i = 0; i < sizeof(headerData); i++) rawData.erase(rawData.begin()); cmdSetMesh->cmdIndex = 0; @@ -366,7 +364,7 @@ void ZRoom::SyotesRoomHack() ZRoomCommand* ZRoom::FindCommandOfType(RoomCommand cmdType) { - for (int i = 0; i < commands.size(); i++) + for (uint32_t i = 0; i < commands.size(); i++) { if (commands[i]->cmdID == cmdType) return commands[i]; @@ -409,7 +407,7 @@ size_t ZRoom::GetCommandSizeFromNeighbor(ZRoomCommand* cmd) { int cmdIndex = -1; - for (int i = 0; i < commands.size(); i++) + for (uint32_t i = 0; i < commands.size(); i++) { if (commands[i] == cmd) { @@ -479,7 +477,7 @@ string ZRoom::GetSourceOutputCode(const std::string& prefix) if ((texturesSorted[i].first + texSize) > texturesSorted[i + 1].first) { - int intersectAmt = (texturesSorted[i].first + texSize) - texturesSorted[i + 1].first; + //int intersectAmt = (texturesSorted[i].first + texSize) - texturesSorted[i + 1].first; defines += StringHelper::Sprintf("#define %sTex_%06X ((u32)%sTex_%06X + 0x%06X)\n", prefix.c_str(), texturesSorted[i + 1].first, prefix.c_str(), texturesSorted[i].first, texturesSorted[i + 1].first - texturesSorted[i].first); |
