Просмотр исходного кода

Merge pull request #4027 from uerobert/clang13

Add missing diagnostic pragmas and remove unused code
Kim Kulling 4 лет назад
Родитель
Сommit
4766d75943
3 измененных файлов с 15 добавлено и 2 удалено
  1. 1 0
      code/AssetLib/glTF/glTFExporter.cpp
  2. 13 0
      code/Common/Assimp.cpp
  3. 1 2
      contrib/openddlparser/code/OpenDDLExport.cpp

+ 1 - 0
code/AssetLib/glTF/glTFExporter.cpp

@@ -526,6 +526,7 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref<Mesh>& meshRef, Ref<Buf
 
 
 #if defined(__has_warning)
 #if defined(__has_warning)
 #if __has_warning("-Wunused-but-set-variable")
 #if __has_warning("-Wunused-but-set-variable")
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 #endif
 #endif
 #endif
 #endif

+ 13 - 0
code/Common/Assimp.cpp

@@ -72,12 +72,25 @@ namespace Assimp {
 // underlying structure for aiPropertyStore
 // underlying structure for aiPropertyStore
 typedef BatchLoader::PropertyMap PropertyMap;
 typedef BatchLoader::PropertyMap PropertyMap;
 
 
+#if defined(__has_warning)
+#if __has_warning("-Wordered-compare-function-pointers")
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wordered-compare-function-pointers"
+#endif
+#endif
+
 /** Stores the LogStream objects for all active C log streams */
 /** Stores the LogStream objects for all active C log streams */
 struct mpred {
 struct mpred {
     bool operator()(const aiLogStream &s0, const aiLogStream &s1) const {
     bool operator()(const aiLogStream &s0, const aiLogStream &s1) const {
         return s0.callback < s1.callback && s0.user < s1.user;
         return s0.callback < s1.callback && s0.user < s1.user;
     }
     }
 };
 };
+
+#if defined(__has_warning)
+#if __has_warning("-Wordered-compare-function-pointers")
+#pragma GCC diagnostic pop
+#endif
+#endif
 typedef std::map<aiLogStream, Assimp::LogStream *, mpred> LogStreamMap;
 typedef std::map<aiLogStream, Assimp::LogStream *, mpred> LogStreamMap;
 
 
 /** Stores the LogStream objects allocated by #aiGetPredefinedLogStream */
 /** Stores the LogStream objects allocated by #aiGetPredefinedLogStream */

+ 1 - 2
contrib/openddlparser/code/OpenDDLExport.cpp

@@ -134,10 +134,9 @@ bool OpenDDLExport::writeToStream(const std::string &statement) {
 }
 }
 
 
 bool OpenDDLExport::writeNode(DDLNode *node, std::string &statement) {
 bool OpenDDLExport::writeNode(DDLNode *node, std::string &statement) {
-    bool success(true);
     writeNodeHeader(node, statement);
     writeNodeHeader(node, statement);
     if (node->hasProperties()) {
     if (node->hasProperties()) {
-        success |= writeProperties(node, statement);
+        writeProperties(node, statement);
     }
     }
     writeLineEnd(statement);
     writeLineEnd(statement);