diff options
| author | Random <28494085+Random06457@users.noreply.github.com> | 2021-09-12 22:25:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-12 16:25:37 -0400 |
| commit | 90662f3cbade844c8edc3943ab8252e334b6166a (patch) | |
| tree | cc794d60659a4640d36af52b580228891515e0dc /ZAPD/ZRoom/Commands | |
| parent | 5da00201f261f8ac4927064f1390e886672cda58 (diff) | |
Fix compilation with -Wextra (#164)
* add -Wextra -Werror
* remove void arg in GfxdCallback_FormatSingleEntry
* mark CRC32 functions as maybe_unused
* remove useless comment
* fix clang warnings
* replace (void) with [[maybe_unused]]
* run make format
Diffstat (limited to 'ZAPD/ZRoom/Commands')
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp | 2 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp | 8 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetAnimatedMaterialList.h | 11 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetEntranceList.cpp | 4 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetExitList.cpp | 4 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetMesh.cpp | 13 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetMesh.h | 1 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetObjectList.h | 2 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetPathways.cpp | 2 | ||||
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetRoomList.h | 2 |
10 files changed, 28 insertions, 21 deletions
diff --git a/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp b/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp index 3aefe42..35bd20c 100644 --- a/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp +++ b/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp @@ -8,7 +8,7 @@ SetAlternateHeaders::SetAlternateHeaders(ZFile* nParent) : ZRoomCommand(nParent) { } -void SetAlternateHeaders::DeclareReferences(const std::string& prefix) +void SetAlternateHeaders::DeclareReferences([[maybe_unused]] const std::string& prefix) { if (segmentOffset != 0) parent->AddDeclarationPlaceholder(segmentOffset); diff --git a/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp b/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp index a0a313d..59e11f3 100644 --- a/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp +++ b/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp @@ -176,7 +176,8 @@ ScrollingTexture::ScrollingTexture(const std::vector<uint8_t>& rawData, uint32_t { } -std::string ScrollingTexture::GenerateSourceCode(ZRoom* zRoom, uint32_t baseAddress) +std::string ScrollingTexture::GenerateSourceCode([[maybe_unused]] ZRoom* zRoom, + [[maybe_unused]] uint32_t baseAddress) { return StringHelper::Sprintf(" { %i, %i, 0x%02X, 0x%02X },", xStep, yStep, width, height); } @@ -237,7 +238,7 @@ FlashingTexture::FlashingTexture(const std::vector<uint8_t>& rawData, uint32_t r } } -std::string FlashingTexture::GenerateSourceCode(ZRoom* zRoom, uint32_t baseAddress) +std::string FlashingTexture::GenerateSourceCode(ZRoom* zRoom, [[maybe_unused]] uint32_t baseAddress) { if (primColorSegmentOffset != 0) { @@ -352,7 +353,8 @@ AnimatedMatTexCycleParams::AnimatedMatTexCycleParams(const std::vector<uint8_t>& } } -std::string AnimatedMatTexCycleParams::GenerateSourceCode(ZRoom* zRoom, uint32_t baseAddress) +std::string AnimatedMatTexCycleParams::GenerateSourceCode(ZRoom* zRoom, + [[maybe_unused]] uint32_t baseAddress) { if (textureSegmentOffsetsSegmentOffset != 0) { diff --git a/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.h b/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.h index 3284d81..96a979f 100644 --- a/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.h +++ b/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.h @@ -4,14 +4,15 @@ #include "ZRoom/ZRoomCommand.h" // TODO move into header and add all types -class AnitmatedTextureParams +class AnimatedTextureParams { public: + virtual ~AnimatedTextureParams() = default; virtual std::string GenerateSourceCode(ZRoom* zRoom, uint32_t baseAddress) = 0; virtual size_t GetParamsSize() = 0; }; -class ScrollingTexture : public AnitmatedTextureParams +class ScrollingTexture : public AnimatedTextureParams { public: ScrollingTexture(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex); @@ -47,7 +48,7 @@ public: uint8_t a; }; -class FlashingTexture : public AnitmatedTextureParams +class FlashingTexture : public AnimatedTextureParams { public: FlashingTexture(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex, int32_t type); @@ -70,7 +71,7 @@ public: std::vector<uint16_t> keyFrames; }; -class AnimatedMatTexCycleParams : public AnitmatedTextureParams +class AnimatedMatTexCycleParams : public AnimatedTextureParams { public: AnimatedMatTexCycleParams(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex); @@ -97,7 +98,7 @@ public: int16_t type; segptr_t segmentAddress; uint32_t segmentOffset; - std::vector<std::shared_ptr<AnitmatedTextureParams>> params; + std::vector<std::shared_ptr<AnimatedTextureParams>> params; }; class SetAnimatedMaterialList : public ZRoomCommand diff --git a/ZAPD/ZRoom/Commands/SetEntranceList.cpp b/ZAPD/ZRoom/Commands/SetEntranceList.cpp index b344e52..df0ba69 100644 --- a/ZAPD/ZRoom/Commands/SetEntranceList.cpp +++ b/ZAPD/ZRoom/Commands/SetEntranceList.cpp @@ -9,7 +9,7 @@ SetEntranceList::SetEntranceList(ZFile* nParent) : ZRoomCommand(nParent) { } -void SetEntranceList::DeclareReferences(const std::string& prefix) +void SetEntranceList::DeclareReferences([[maybe_unused]] const std::string& prefix) { if (segmentOffset != 0) parent->AddDeclarationPlaceholder(segmentOffset); @@ -30,7 +30,7 @@ void SetEntranceList::ParseRawDataLate() } } -void SetEntranceList::DeclareReferencesLate(const std::string& prefix) +void SetEntranceList::DeclareReferencesLate([[maybe_unused]] const std::string& prefix) { if (!entrances.empty()) { diff --git a/ZAPD/ZRoom/Commands/SetExitList.cpp b/ZAPD/ZRoom/Commands/SetExitList.cpp index 2203c85..ec1ac10 100644 --- a/ZAPD/ZRoom/Commands/SetExitList.cpp +++ b/ZAPD/ZRoom/Commands/SetExitList.cpp @@ -9,7 +9,7 @@ SetExitList::SetExitList(ZFile* nParent) : ZRoomCommand(nParent) { } -void SetExitList::DeclareReferences(const std::string& prefix) +void SetExitList::DeclareReferences([[maybe_unused]] const std::string& prefix) { if (segmentOffset != 0) parent->AddDeclarationPlaceholder(segmentOffset); @@ -30,7 +30,7 @@ void SetExitList::ParseRawDataLate() } } -void SetExitList::DeclareReferencesLate(const std::string& prefix) +void SetExitList::DeclareReferencesLate([[maybe_unused]] const std::string& prefix) { if (!exits.empty()) { diff --git a/ZAPD/ZRoom/Commands/SetMesh.cpp b/ZAPD/ZRoom/Commands/SetMesh.cpp index 08ae6b8..d2c9337 100644 --- a/ZAPD/ZRoom/Commands/SetMesh.cpp +++ b/ZAPD/ZRoom/Commands/SetMesh.cpp @@ -113,7 +113,8 @@ RoomCommand SetMesh::GetRoomCommand() const return RoomCommand::SetMesh; } -PolygonDlist::PolygonDlist(const std::string& prefix, const std::vector<uint8_t>& nRawData, +PolygonDlist::PolygonDlist(const std::string& prefix, + [[maybe_unused]] const std::vector<uint8_t>& nRawData, uint32_t nRawDataIndex, ZFile* nParent, ZRoom* nRoom) { rawDataIndex = nRawDataIndex; @@ -151,7 +152,7 @@ void PolygonDlist::DeclareReferences(const std::string& prefix) xluDList = MakeDlist(xlu, prefix); } -ZDisplayList* PolygonDlist::MakeDlist(segptr_t ptr, const std::string& prefix) +ZDisplayList* PolygonDlist::MakeDlist(segptr_t ptr, [[maybe_unused]] const std::string& prefix) { if (ptr == 0) { @@ -268,8 +269,9 @@ std::string PolygonDlist::GetName() return name; } -BgImage::BgImage(bool nIsSubStruct, const std::string& prefix, const std::vector<uint8_t>& nRawData, - uint32_t nRawDataIndex, ZFile* nParent) +BgImage::BgImage(bool nIsSubStruct, const std::string& prefix, + [[maybe_unused]] const std::vector<uint8_t>& nRawData, uint32_t nRawDataIndex, + ZFile* nParent) { rawDataIndex = nRawDataIndex; parent = nParent; @@ -404,7 +406,8 @@ std::string BgImage::GetName() /* PolygonType section */ -PolygonTypeBase::PolygonTypeBase(ZFile* nParent, const std::vector<uint8_t>& nRawData, +PolygonTypeBase::PolygonTypeBase(ZFile* nParent, + [[maybe_unused]] const std::vector<uint8_t>& nRawData, uint32_t nRawDataIndex, ZRoom* nRoom) : rawDataIndex{nRawDataIndex}, parent{nParent}, zRoom{nRoom} { diff --git a/ZAPD/ZRoom/Commands/SetMesh.h b/ZAPD/ZRoom/Commands/SetMesh.h index 035952e..a22cbf6 100644 --- a/ZAPD/ZRoom/Commands/SetMesh.h +++ b/ZAPD/ZRoom/Commands/SetMesh.h @@ -95,6 +95,7 @@ public: PolygonTypeBase(ZFile* nParent, const std::vector<uint8_t>& nRawData, uint32_t nRawDataIndex, ZRoom* nRoom); + virtual ~PolygonTypeBase() = default; virtual void ParseRawData() = 0; virtual void DeclareReferences(const std::string& prefix) = 0; diff --git a/ZAPD/ZRoom/Commands/SetObjectList.h b/ZAPD/ZRoom/Commands/SetObjectList.h index 4f02017..7277146 100644 --- a/ZAPD/ZRoom/Commands/SetObjectList.h +++ b/ZAPD/ZRoom/Commands/SetObjectList.h @@ -10,7 +10,7 @@ public: SetObjectList(ZFile* nParent); void ParseRawData() override; - void DeclareReferences(const std::string& prefix); + void DeclareReferences(const std::string& prefix) override; std::string GetBodySourceCode() const override; diff --git a/ZAPD/ZRoom/Commands/SetPathways.cpp b/ZAPD/ZRoom/Commands/SetPathways.cpp index 91cd146..bd7e7a7 100644 --- a/ZAPD/ZRoom/Commands/SetPathways.cpp +++ b/ZAPD/ZRoom/Commands/SetPathways.cpp @@ -9,7 +9,7 @@ SetPathways::SetPathways(ZFile* nParent) : ZRoomCommand(nParent), pathwayList(nP { } -void SetPathways::DeclareReferences(const std::string& prefix) +void SetPathways::DeclareReferences([[maybe_unused]] const std::string& prefix) { if (segmentOffset != 0) parent->AddDeclarationPlaceholder(segmentOffset); diff --git a/ZAPD/ZRoom/Commands/SetRoomList.h b/ZAPD/ZRoom/Commands/SetRoomList.h index a7b45fe..9c390bf 100644 --- a/ZAPD/ZRoom/Commands/SetRoomList.h +++ b/ZAPD/ZRoom/Commands/SetRoomList.h @@ -20,7 +20,7 @@ public: SetRoomList(ZFile* nParent); void ParseRawData() override; - virtual void DeclareReferences(const std::string& prefix); + void DeclareReferences(const std::string& prefix) override; std::string GetBodySourceCode() const override; void PreGenSourceFiles() override; |
