Переглянути джерело

Add a handful of missing fixes

Aaron Gokaslan 2 роки тому
батько
коміт
4c6652f5b0

+ 1 - 3
code/AssetLib/B3D/B3DImporter.cpp

@@ -88,9 +88,7 @@ void DeleteAllBarePointers(std::vector<T> &x) {
     }
 }
 
-B3DImporter::~B3DImporter() {
-    // empty
-}
+B3DImporter::~B3DImporter() = default;
 
 // ------------------------------------------------------------------------------------------------
 bool B3DImporter::CanRead(const std::string &pFile, IOSystem * /*pIOHandler*/, bool /*checkSig*/) const {

+ 1 - 3
code/AssetLib/STL/STLLoader.cpp

@@ -134,9 +134,7 @@ STLImporter::STLImporter() :
 
 // ------------------------------------------------------------------------------------------------
 // Destructor, private as well
-STLImporter::~STLImporter() {
-    // empty
-}
+STLImporter::~STLImporter() = default;
 
 // ------------------------------------------------------------------------------------------------
 // Returns whether the class can handle the format of the given file.

+ 1 - 3
code/Common/BaseProcess.cpp

@@ -59,9 +59,7 @@ BaseProcess::BaseProcess() AI_NO_EXCEPT
 
 // ------------------------------------------------------------------------------------------------
 // Destructor, private as well
-BaseProcess::~BaseProcess() {
-    // nothing to do here
-}
+BaseProcess::~BaseProcess() = default;
 
 // ------------------------------------------------------------------------------------------------
 void BaseProcess::ExecuteOnScene(Importer *pImp) {

+ 1 - 4
code/Common/SGSpatialSort.cpp

@@ -59,10 +59,7 @@ SGSpatialSort::SGSpatialSort()
 }
 // ------------------------------------------------------------------------------------------------
 // Destructor
-SGSpatialSort::~SGSpatialSort()
-{
-    // nothing to do here, everything destructs automatically
-}
+SGSpatialSort::~SGSpatialSort() = default;
 // ------------------------------------------------------------------------------------------------
 void SGSpatialSort::Add(const aiVector3D& vPosition, unsigned int index,
     unsigned int smoothingGroup)

+ 1 - 3
code/PostProcessing/PretransformVertices.cpp

@@ -70,9 +70,7 @@ PretransformVertices::PretransformVertices() :
 
 // ------------------------------------------------------------------------------------------------
 // Destructor, private as well
-PretransformVertices::~PretransformVertices() {
-	// nothing to do here
-}
+PretransformVertices::~PretransformVertices() = default;
 
 // ------------------------------------------------------------------------------------------------
 // Returns whether the processing step is present in the given flag field.

+ 1 - 3
test/unit/AbstractImportExportBase.cpp

@@ -44,6 +44,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 using namespace ::Assimp;
 
-AbstractImportExportBase::~AbstractImportExportBase() {
-    // empty
-}
+AbstractImportExportBase::~AbstractImportExportBase() = default;

+ 2 - 4
test/unit/ImportExport/utExporter.cpp

@@ -55,9 +55,7 @@ public:
         // empty
     }
 
-    virtual ~TestProgressHandler() {
-        // empty
-    }
+    virtual ~TestProgressHandler() = default;
 
     bool Update(float percentage = -1.f) override {
         mPercentage = percentage;
@@ -104,4 +102,4 @@ TEST_F(ExporterTest, ExporterIdTest) {
     EXPECT_EQ(nullptr, desc) << "More exporters than claimed";
 }
 
-#endif
+#endif

+ 1 - 3
test/unit/SceneDiffer.cpp

@@ -53,9 +53,7 @@ SceneDiffer::SceneDiffer()
     // empty
 }
 
-SceneDiffer::~SceneDiffer() {
-    // empty
-}
+SceneDiffer::~SceneDiffer() = default;
 
 bool SceneDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
     if ( expected == toCompare ) {

+ 1 - 1
test/unit/utBlendImportAreaLight.cpp

@@ -69,7 +69,7 @@ TEST_F(BlendImportAreaLight, testImportLight) {
     std::vector<std::pair<std::string, size_t>> lightNames;
 
     for (size_t i = 0; i < pTest->mNumLights; i++) {
-        lightNames.push_back(std::make_pair(pTest->mLights[i]->mName.C_Str(), i));
+        lightNames.emplace_back(pTest->mLights[i]->mName.C_Str(), i);
     }
 
     std::sort(lightNames.begin(), lightNames.end());

+ 1 - 3
test/unit/utObjTools.cpp

@@ -55,9 +55,7 @@ public:
         // empty
     }
 
-    ~TestObjFileParser() {
-        // empty
-    }
+    ~TestObjFileParser() = default;
 
     void testCopyNextWord(char *pBuffer, size_t length) {
         copyNextWord(pBuffer, length);

+ 1 - 3
tools/assimp_cmd/Main.cpp

@@ -55,9 +55,7 @@ public:
 		// empty
 	}
 
-	~ConsoleProgressHandler() override {
-		// empty
-	}
+	~ConsoleProgressHandler() override = default;
 
 	bool Update(float percentage) override {
         std::cout << percentage * 100.0f << " %\n";