Browse Source

Use std::copy to copy array and remove user destructor to make sure is_trivially_copyable in order to avoid -Wno-error=nontrivial-memcall (#6029)

Use std::copy to copy array and remove user destructor to make sure is_trivially_copyable in order to avoid -Wno-error=nontrivial-memcall (#6029)
T.Yamada 4 months ago
parent
commit
f398a70163

+ 1 - 5
code/Common/SceneCombiner.cpp

@@ -985,7 +985,7 @@ inline void GetArrayCopy(Type *&dest, ai_uint num) {
     Type *old = dest;
     Type *old = dest;
 
 
     dest = new Type[num];
     dest = new Type[num];
-    ::memcpy(dest, old, sizeof(Type) * num);
+    std::copy(old, old+num, dest);
 }
 }
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
@@ -1095,10 +1095,6 @@ void SceneCombiner::Copy(aiMesh **_dest, const aiMesh *src) {
 
 
     // make a deep copy of all faces
     // make a deep copy of all faces
     GetArrayCopy(dest->mFaces, dest->mNumFaces);
     GetArrayCopy(dest->mFaces, dest->mNumFaces);
-    for (unsigned int i = 0; i < dest->mNumFaces; ++i) {
-        aiFace &f = dest->mFaces[i];
-        GetArrayCopy(f.mIndices, f.mNumIndices);
-    }
 
 
     // make a deep copy of all blend shapes
     // make a deep copy of all blend shapes
     CopyPtrArray(dest->mAnimMeshes, dest->mAnimMeshes, dest->mNumAnimMeshes);
     CopyPtrArray(dest->mAnimMeshes, dest->mAnimMeshes, dest->mNumAnimMeshes);

+ 0 - 2
contrib/Open3DGC/o3dgcCommon.h

@@ -166,7 +166,6 @@ namespace o3dgc
                                     {
                                     {
                                         memset(this, 0, sizeof(SC3DMCStats));
                                         memset(this, 0, sizeof(SC3DMCStats));
                                     };
                                     };
-                                    ~SC3DMCStats(void){};
         
         
         double                      m_timeCoord;
         double                      m_timeCoord;
         double                      m_timeNormal;
         double                      m_timeNormal;
@@ -409,4 +408,3 @@ namespace o3dgc
     }
     }
 }
 }
 #endif // O3DGC_COMMON_H
 #endif // O3DGC_COMMON_H
-

+ 0 - 3
contrib/Open3DGC/o3dgcIndexedFaceSet.h

@@ -43,8 +43,6 @@ namespace o3dgc
                                              m_isTriangularMesh = true;
                                              m_isTriangularMesh = true;
                                              m_creaseAngle      = 30;
                                              m_creaseAngle      = 30;
                                          };
                                          };
-        //! Destructor.
-                                         ~IndexedFaceSet(void) {};
         
         
         unsigned long                    GetNCoordIndex() const { return m_nCoordIndex     ;}
         unsigned long                    GetNCoordIndex() const { return m_nCoordIndex     ;}
         // only coordIndex is supported
         // only coordIndex is supported
@@ -260,4 +258,3 @@ namespace o3dgc
 }
 }
 #include "o3dgcIndexedFaceSet.inl"    // template implementation
 #include "o3dgcIndexedFaceSet.inl"    // template implementation
 #endif // O3DGC_INDEXED_FACE_SET_H
 #endif // O3DGC_INDEXED_FACE_SET_H
-

+ 0 - 3
contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h

@@ -51,8 +51,6 @@ namespace o3dgc
                                             m_intAttributePredMode[a] = O3DGC_SC3DMC_NO_PREDICTION;
                                             m_intAttributePredMode[a] = O3DGC_SC3DMC_NO_PREDICTION;
                                         }
                                         }
                                     };
                                     };
-        //! Destructor.
-                                    ~SC3DMCEncodeParams(void) {};
 
 
         O3DGCStreamType             GetStreamType()    const { return m_streamTypeMode;}
         O3DGCStreamType             GetStreamType()    const { return m_streamTypeMode;}
         O3DGCSC3DMCEncodingMode     GetEncodeMode()    const { return m_encodeMode;}
         O3DGCSC3DMCEncodingMode     GetEncodeMode()    const { return m_encodeMode;}
@@ -137,4 +135,3 @@ namespace o3dgc
     };
     };
 }
 }
 #endif // O3DGC_SC3DMC_ENCODE_PARAMS_H
 #endif // O3DGC_SC3DMC_ENCODE_PARAMS_H
-

+ 0 - 1
contrib/Open3DGC/o3dgcTimer.h

@@ -113,7 +113,6 @@ namespace o3dgc
         {
         {
             memset(this, 0, sizeof(Timer));
             memset(this, 0, sizeof(Timer));
         };
         };
-        ~Timer(void){};
         void Tic() 
         void Tic() 
         {
         {
             clock_gettime(CLOCK_REALTIME, &m_start);
             clock_gettime(CLOCK_REALTIME, &m_start);