From 7df4efea4460056d530a65201cab0638493fc672 Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Sat, 1 Apr 2023 21:34:36 +0800 Subject: [PATCH] Fix warning related to inconsistent-missing-destructor-override. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/AssetLib/3DS/3DSLoader.h | 2 +- code/AssetLib/3MF/3MFTypes.h | 8 ++++---- code/AssetLib/Raw/RawLoader.h | 2 +- code/AssetLib/Unreal/UnrealLoader.h | 2 +- code/AssetLib/glTF2/glTF2Asset.h | 2 +- code/CMakeLists.txt | 1 - code/Common/ZipArchiveIOSystem.cpp | 2 +- include/assimp/DefaultIOStream.h | 2 +- include/assimp/MemoryIOWrapper.h | 10 +++++----- include/assimp/ZipArchiveIOSystem.h | 2 +- 10 files changed, 16 insertions(+), 17 deletions(-) diff --git a/code/AssetLib/3DS/3DSLoader.h b/code/AssetLib/3DS/3DSLoader.h index f47fcfef9..6bd73f412 100644 --- a/code/AssetLib/3DS/3DSLoader.h +++ b/code/AssetLib/3DS/3DSLoader.h @@ -68,7 +68,7 @@ using namespace D3DS; class Discreet3DSImporter : public BaseImporter { public: Discreet3DSImporter(); - ~Discreet3DSImporter(); + ~Discreet3DSImporter() override; // ------------------------------------------------------------------- /** Returns whether the class can handle the format of the given file. diff --git a/code/AssetLib/3MF/3MFTypes.h b/code/AssetLib/3MF/3MFTypes.h index 02238ceab..8207b568b 100644 --- a/code/AssetLib/3MF/3MFTypes.h +++ b/code/AssetLib/3MF/3MFTypes.h @@ -93,7 +93,7 @@ public: // empty } - ~EmbeddedTexture() = default; + ~EmbeddedTexture() override = default; ResourceType getType() const override { return ResourceType::RT_EmbeddedTexture2D; @@ -110,7 +110,7 @@ public: // empty } - ~Texture2DGroup() = default; + ~Texture2DGroup() override = default; ResourceType getType() const override { return ResourceType::RT_Texture2DGroup; @@ -127,7 +127,7 @@ public: // empty } - ~BaseMaterials() = default; + ~BaseMaterials() override = default; ResourceType getType() const override { return ResourceType::RT_BaseMaterials; @@ -152,7 +152,7 @@ public: // empty } - ~Object() = default; + ~Object() override = default; ResourceType getType() const override { return ResourceType::RT_Object; diff --git a/code/AssetLib/Raw/RawLoader.h b/code/AssetLib/Raw/RawLoader.h index 6e4c4d110..54314f728 100644 --- a/code/AssetLib/Raw/RawLoader.h +++ b/code/AssetLib/Raw/RawLoader.h @@ -58,7 +58,7 @@ namespace Assimp { class RAWImporter : public BaseImporter { public: RAWImporter(); - ~RAWImporter(); + ~RAWImporter() override; // ------------------------------------------------------------------- /** Returns whether the class can handle the format of the given file. diff --git a/code/AssetLib/Unreal/UnrealLoader.h b/code/AssetLib/Unreal/UnrealLoader.h index a931a86dd..fda784cfb 100644 --- a/code/AssetLib/Unreal/UnrealLoader.h +++ b/code/AssetLib/Unreal/UnrealLoader.h @@ -56,7 +56,7 @@ namespace Assimp { class UnrealImporter : public BaseImporter { public: UnrealImporter(); - ~UnrealImporter(); + ~UnrealImporter() override; // ------------------------------------------------------------------- /** @brief Returns whether we can handle the format of the given file diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index 1d7cff325..166c10038 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -483,7 +483,7 @@ private: public: Buffer(); - ~Buffer(); + ~Buffer() override; void Read(Value &obj, Asset &r); diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index fd3b1cb88..184347145 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1211,7 +1211,6 @@ IF (ASSIMP_WARNINGS_AS_ERRORS) -Wno-undef -Wno-suggest-destructor-override -Wno-suggest-override - -Wno-inconsistent-missing-destructor-override -Wno-zero-as-null-pointer-constant -Wno-global-constructors -Wno-exit-time-destructors diff --git a/code/Common/ZipArchiveIOSystem.cpp b/code/Common/ZipArchiveIOSystem.cpp index d0c2f3204..51a250810 100644 --- a/code/Common/ZipArchiveIOSystem.cpp +++ b/code/Common/ZipArchiveIOSystem.cpp @@ -68,7 +68,7 @@ class ZipFile : public IOStream { public: std::string m_Filename; - virtual ~ZipFile(); + virtual ~ZipFile() override; // IOStream interface size_t Read(void *pvBuffer, size_t pSize, size_t pCount) override; diff --git a/include/assimp/DefaultIOStream.h b/include/assimp/DefaultIOStream.h index e8d9ed329..67cba3c5c 100644 --- a/include/assimp/DefaultIOStream.h +++ b/include/assimp/DefaultIOStream.h @@ -84,7 +84,7 @@ protected: public: /** Destructor public to allow simple deletion to close the file. */ - ~DefaultIOStream (); + ~DefaultIOStream () override; // ------------------------------------------------------------------- /// Read from stream diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 1b986ff1b..4023f7529 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -65,8 +65,8 @@ namespace Assimp { // ---------------------------------------------------------------------------------- class MemoryIOStream : public IOStream { public: - MemoryIOStream (const uint8_t* buff, size_t len, bool own = false) : - buffer (buff), + MemoryIOStream (const uint8_t* buff, size_t len, bool own = false) : + buffer (buff), length(len), pos(static_cast(0)), own(own) { @@ -145,7 +145,7 @@ public: } /// @brief Destructor. - ~MemoryIOSystem() = default; + ~MemoryIOSystem() override = default; // ------------------------------------------------------------------- /// @brief Tests for the existence of a file at the given path. @@ -190,7 +190,7 @@ public: bool ComparePaths(const char* one, const char* second) const override { return existing_io ? existing_io->ComparePaths(one, second) : false; } - + /// @brief Will push the directory. bool PushDirectory( const std::string &path ) override { return existing_io ? existing_io->PushDirectory(path) : false; @@ -216,7 +216,7 @@ public: bool CreateDirectory( const std::string &path ) override { return existing_io ? existing_io->CreateDirectory(path) : false; } - + /// @brief Will change the directory. bool ChangeDirectory( const std::string &path ) override { return existing_io ? existing_io->ChangeDirectory(path) : false; diff --git a/include/assimp/ZipArchiveIOSystem.h b/include/assimp/ZipArchiveIOSystem.h index dac60b501..9f3a4783b 100644 --- a/include/assimp/ZipArchiveIOSystem.h +++ b/include/assimp/ZipArchiveIOSystem.h @@ -63,7 +63,7 @@ public: //! Open a Zip using the proffered IOSystem ZipArchiveIOSystem(IOSystem* pIOHandler, const char *pFilename, const char* pMode = "r"); ZipArchiveIOSystem(IOSystem* pIOHandler, const std::string& rFilename, const char* pMode = "r"); - virtual ~ZipArchiveIOSystem(); + virtual ~ZipArchiveIOSystem() override; bool Exists(const char* pFilename) const override; char getOsSeparator() const override; IOStream* Open(const char* pFilename, const char* pMode = "rb") override;