diff --git a/CMakeLists.txt b/CMakeLists.txt index a4f711528..8a56f2250 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -302,8 +302,12 @@ ELSEIF( MINGW ) SET(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}") SET(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}") ENDIF() - SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long -Wa,-mbig-obj -O3 ${CMAKE_CXX_FLAGS}") - SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}") + IF (CMAKE_BUILD_TYPE STREQUAL "Debug") + SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long -Wa,-mbig-obj -g ${CMAKE_CXX_FLAGS}") + ELSE() + SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long -Wa,-mbig-obj -O3 ${CMAKE_CXX_FLAGS}") + ENDIF() + SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}") ENDIF() IF ( IOS AND NOT ASSIMP_HUNTER_ENABLED) diff --git a/code/AssetLib/3DS/3DSConverter.cpp b/code/AssetLib/3DS/3DSConverter.cpp index 5a01429e4..2421d5460 100644 --- a/code/AssetLib/3DS/3DSConverter.cpp +++ b/code/AssetLib/3DS/3DSConverter.cpp @@ -262,7 +262,7 @@ void Discreet3DSImporter::ConvertMaterial(D3DS::Material &oldMat, unsigned int iWire = 1; mat.AddProperty((int *)&iWire, 1, AI_MATKEY_ENABLE_WIREFRAME); } - +// fallthrough case D3DS::Discreet3DS::Gouraud: eShading = aiShadingMode_Gouraud; break; diff --git a/code/AssetLib/3DS/3DSLoader.cpp b/code/AssetLib/3DS/3DSLoader.cpp index 0ec8b872a..b76640218 100644 --- a/code/AssetLib/3DS/3DSLoader.cpp +++ b/code/AssetLib/3DS/3DSLoader.cpp @@ -1284,7 +1284,7 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D *out, bool acceptPercent) { switch (chunk.Flag) { case Discreet3DS::CHUNK_LINRGBF: bGamma = true; - + // fallthrough case Discreet3DS::CHUNK_RGBF: if (sizeof(float) * 3 > diff) { *out = clrError; @@ -1297,6 +1297,7 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D *out, bool acceptPercent) { case Discreet3DS::CHUNK_LINRGBB: bGamma = true; + // fallthrough case Discreet3DS::CHUNK_RGBB: { if (sizeof(char) * 3 > diff) { *out = clrError; diff --git a/code/AssetLib/ASE/ASELoader.cpp b/code/AssetLib/ASE/ASELoader.cpp index caa708961..7caac24ce 100644 --- a/code/AssetLib/ASE/ASELoader.cpp +++ b/code/AssetLib/ASE/ASELoader.cpp @@ -870,6 +870,7 @@ void ASEImporter::ConvertMaterial(ASE::Material &mat) { unsigned int iWire = 1; mat.pcInstance->AddProperty((int *)&iWire, 1, AI_MATKEY_ENABLE_WIREFRAME); } + // fallthrough case D3DS::Discreet3DS::Gouraud: eShading = aiShadingMode_Gouraud; break; diff --git a/code/AssetLib/Blender/BlenderDNA.cpp b/code/AssetLib/Blender/BlenderDNA.cpp index 2910904ba..fbb61ab4f 100644 --- a/code/AssetLib/Blender/BlenderDNA.cpp +++ b/code/AssetLib/Blender/BlenderDNA.cpp @@ -325,10 +325,10 @@ void SectionParser ::Next() { stream.SetCurrentPos(current.start + current.size); const char tmp[] = { - (const char)stream.GetI1(), - (const char)stream.GetI1(), - (const char)stream.GetI1(), - (const char)stream.GetI1() + (char)stream.GetI1(), + (char)stream.GetI1(), + (char)stream.GetI1(), + (char)stream.GetI1() }; current.id = std::string(tmp, tmp[3] ? 4 : tmp[2] ? 3 : tmp[1] ? 2 : 1); diff --git a/code/AssetLib/Blender/BlenderLoader.cpp b/code/AssetLib/Blender/BlenderLoader.cpp index 2ed0d6b8a..9322369eb 100644 --- a/code/AssetLib/Blender/BlenderLoader.cpp +++ b/code/AssetLib/Blender/BlenderLoader.cpp @@ -986,7 +986,7 @@ void BlenderImporter::ConvertMesh(const Scene & /*in*/, const Object * /*obj*/, // key is material number, value is the TextureUVMapping for the material typedef std::map MaterialTextureUVMappings; MaterialTextureUVMappings matTexUvMappings; - const uint32_t maxMat = static_cast(mesh->mat.size()); + const uint32_t maxMat = static_cast(mesh->mat.size()); for (uint32_t m = 0; m < maxMat; ++m) { // get material by index const std::shared_ptr pMat = mesh->mat[m]; diff --git a/code/AssetLib/Collada/ColladaParser.cpp b/code/AssetLib/Collada/ColladaParser.cpp index 9b3af0848..52e9b4978 100644 --- a/code/AssetLib/Collada/ColladaParser.cpp +++ b/code/AssetLib/Collada/ColladaParser.cpp @@ -1616,6 +1616,7 @@ void ColladaParser::ReadIndexData(XmlNode &node, Mesh &pMesh) { XmlParser::getValueAsString(currentNode, v); const char *content = v.c_str(); vcount.reserve(numPrimitives); + SkipSpacesAndLineEnd(&content); for (unsigned int a = 0; a < numPrimitives; a++) { if (*content == 0) { throw DeadlyImportError("Expected more values while reading contents."); diff --git a/code/AssetLib/LWO/LWOLoader.cpp b/code/AssetLib/LWO/LWOLoader.cpp index 44517a1a6..77589d63c 100644 --- a/code/AssetLib/LWO/LWOLoader.cpp +++ b/code/AssetLib/LWO/LWOLoader.cpp @@ -1540,6 +1540,7 @@ void LWOImporter::LoadLWO2File() { break; } // --- intentionally no break here + // fallthrough case AI_LWO_VMAP: { if (skip) break; diff --git a/code/AssetLib/MMD/MMDPmxParser.h b/code/AssetLib/MMD/MMDPmxParser.h index 08f57f6f0..c9df37c68 100644 --- a/code/AssetLib/MMD/MMDPmxParser.h +++ b/code/AssetLib/MMD/MMDPmxParser.h @@ -357,6 +357,8 @@ namespace pmx { public: void virtual Read(std::istream *stream, PmxSetting *setting) = 0; + + virtual ~PmxMorphOffset() = default; }; class PmxMorphVertexOffset : public PmxMorphOffset diff --git a/code/AssetLib/glTF/glTFAsset.inl b/code/AssetLib/glTF/glTFAsset.inl index 1f4544156..86fba95b7 100644 --- a/code/AssetLib/glTF/glTFAsset.inl +++ b/code/AssetLib/glTF/glTFAsset.inl @@ -891,12 +891,12 @@ inline void Mesh::Decode_O3DGC(const SCompression_Open3DGC &pCompression_Open3DG auto get_buf_offset = [](Ref &pAccessor) -> size_t { return pAccessor->byteOffset + pAccessor->bufferView->byteOffset; }; // Indices - ifs.SetCoordIndex((IndicesType *const)(decoded_data + get_buf_offset(primitives[0].indices))); + ifs.SetCoordIndex((IndicesType *)(decoded_data + get_buf_offset(primitives[0].indices))); // Coordinates - ifs.SetCoord((o3dgc::Real *const)(decoded_data + get_buf_offset(primitives[0].attributes.position[0]))); + ifs.SetCoord((o3dgc::Real *)(decoded_data + get_buf_offset(primitives[0].attributes.position[0]))); // Normals if (size_normal) { - ifs.SetNormal((o3dgc::Real *const)(decoded_data + get_buf_offset(primitives[0].attributes.normal[0]))); + ifs.SetNormal((o3dgc::Real *)(decoded_data + get_buf_offset(primitives[0].attributes.normal[0]))); } for (size_t idx = 0, idx_end = size_floatattr.size(), idx_texcoord = 0; idx < idx_end; idx++) { @@ -904,7 +904,7 @@ inline void Mesh::Decode_O3DGC(const SCompression_Open3DGC &pCompression_Open3DG case o3dgc::O3DGC_IFS_FLOAT_ATTRIBUTE_TYPE_TEXCOORD: if (idx_texcoord < primitives[0].attributes.texcoord.size()) { // See above about absent attributes. - ifs.SetFloatAttribute(static_cast(idx), (o3dgc::Real *const)(decoded_data + get_buf_offset(primitives[0].attributes.texcoord[idx]))); + ifs.SetFloatAttribute(static_cast(idx), (o3dgc::Real *)(decoded_data + get_buf_offset(primitives[0].attributes.texcoord[idx]))); idx_texcoord++; } diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index c597fc951..44ab6c9c8 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -374,6 +374,8 @@ struct CustomExtension { mValues(other.mValues) { // empty } + + CustomExtension& operator=(const CustomExtension&) = default; }; //! Base class for all glTF top-level objects diff --git a/contrib/clipper/clipper.cpp b/contrib/clipper/clipper.cpp index 857cd1c3e..2d02aff67 100644 --- a/contrib/clipper/clipper.cpp +++ b/contrib/clipper/clipper.cpp @@ -86,6 +86,13 @@ class Int128 Int128(const Int128 &val): hi(val.hi), lo(val.lo){} + Int128 operator = (const Int128 &val) + { + lo = val.lo; + hi = val.hi; + return val; + } + long64 operator = (const long64 &val) { lo = val;