From c0947b704e8a318a5cebe98377340e92c6ca1bd9 Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:24:15 +0800 Subject: [PATCH 1/6] Fix warning related to missing-variable-declarations, remove unused global variables. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/AssetLib/FBX/FBXMaterial.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/code/AssetLib/FBX/FBXMaterial.cpp b/code/AssetLib/FBX/FBXMaterial.cpp index 2677d652a..2f575a511 100644 --- a/code/AssetLib/FBX/FBXMaterial.cpp +++ b/code/AssetLib/FBX/FBXMaterial.cpp @@ -138,20 +138,6 @@ Material::Material(uint64_t id, const Element& element, const Document& doc, con // ------------------------------------------------------------------------------------------------ Material::~Material() = default; - aiVector2D uvTrans; - aiVector2D uvScaling; - ai_real uvRotation; - - std::string type; - std::string relativeFileName; - std::string fileName; - std::string alphaSource; - std::shared_ptr props; - - unsigned int crop[4]{}; - - const Video* media; - // ------------------------------------------------------------------------------------------------ Texture::Texture(uint64_t id, const Element& element, const Document& doc, const std::string& name) : Object(id,element,name), From 739cf15a1eeabb006b071eec866b5ee08781b5e1 Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:26:03 +0800 Subject: [PATCH 2/6] Fix warning related to missing-variable-declarations, remove unused global variables. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/AssetLib/SIB/SIBImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/SIB/SIBImporter.cpp b/code/AssetLib/SIB/SIBImporter.cpp index 323a69a00..9f299180b 100644 --- a/code/AssetLib/SIB/SIBImporter.cpp +++ b/code/AssetLib/SIB/SIBImporter.cpp @@ -85,7 +85,7 @@ static const aiImporterDesc desc = { struct SIBChunk { uint32_t Tag; uint32_t Size; -} PACK_STRUCT; +}; enum { POS, From 5738b3d172f052ebc5c1f1f523abb7e883f596e8 Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:27:23 +0800 Subject: [PATCH 3/6] Fix warning related to missing-variable-declarations, add static to global variable. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/AssetLib/Assjson/cencode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/Assjson/cencode.c b/code/AssetLib/Assjson/cencode.c index 614a2671f..ec771536d 100644 --- a/code/AssetLib/Assjson/cencode.c +++ b/code/AssetLib/Assjson/cencode.c @@ -7,7 +7,7 @@ For details, see http://sourceforge.net/projects/libb64 #include "cencode.h" // changed from -const int CHARS_PER_LINE = 72; +static const int CHARS_PER_LINE = 72; #ifdef _MSC_VER #pragma warning(push) From 1244e582744a120c3e0f2aa192126cc8357a1b10 Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:28:08 +0800 Subject: [PATCH 4/6] Fix warning related to missing-variable-declarations, add static to global variable. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- contrib/unzip/unzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/unzip/unzip.c b/contrib/unzip/unzip.c index ba15257a9..4bc6773ef 100644 --- a/contrib/unzip/unzip.c +++ b/contrib/unzip/unzip.c @@ -78,7 +78,7 @@ # pragma warning(disable : 4131 4244 4189 4245) #endif // _MSC_VER -const char unz_copyright[] = +static const char unz_copyright[] = " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; /* unz_file_info_internal contain internal info about a file in zipfile*/ From 46677b835c74f28bc36a4bf125b322297d681654 Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:28:36 +0800 Subject: [PATCH 5/6] Fix warning related to missing-variable-declarations, add static to global variable. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/AssetLib/Blender/BlenderCustomData.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/Blender/BlenderCustomData.cpp b/code/AssetLib/Blender/BlenderCustomData.cpp index c74a6bb75..2359482e1 100644 --- a/code/AssetLib/Blender/BlenderCustomData.cpp +++ b/code/AssetLib/Blender/BlenderCustomData.cpp @@ -96,7 +96,8 @@ struct CustomDataTypeDescription { * other (like CD_ORCO, ...) uses arrays of rawtypes or even arrays of Structures * use a special readfunction for that cases */ -std::array customDataTypeDescriptions = { { DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(MVert), +static std::array customDataTypeDescriptions = { { + DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(MVert), DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION, DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION, DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(MEdge), From ff17f1fe3de0ca2f97aa3a04af350999034d77b2 Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:29:03 +0800 Subject: [PATCH 6/6] Remove -Wno-missing-variable-declarations. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 05e31624a..6e0d0f143 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1236,7 +1236,6 @@ IF (ASSIMP_WARNINGS_AS_ERRORS) -Wno-tautological-value-range-compare -Wno-tautological-type-limit-compare -Wno-missing-noreturn - -Wno-missing-variable-declarations -Wno-extra-semi -Wno-nonportable-system-include-path -Wno-undefined-reinterpret-cast