From 19dfb6ea1f6745c0dbc2ce21839c30184b553878 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 8 Apr 2021 11:07:12 +0200 Subject: Cleanup: enable modernize-use-equals-default check This removes a lot of unnecessary code that is generated by the compiler automatically. In very few cases, a defaulted destructor in a .cc file is still necessary, because of forward declarations in the header. I removed some defaulted virtual destructors, because they are not necessary, when the parent class has a virtual destructor already. Defaulted constructors are only necessary when there is another constructor, but the class should still be default constructible. Differential Revision: https://developer.blender.org/D10911 --- source/blender/io/alembic/exporter/abc_custom_props.cc | 4 ---- source/blender/io/alembic/exporter/abc_custom_props.h | 2 +- source/blender/io/alembic/exporter/abc_writer_abstract.cc | 4 ---- source/blender/io/alembic/exporter/abc_writer_abstract.h | 1 - source/blender/io/alembic/exporter/abc_writer_instance.cc | 4 ---- source/blender/io/alembic/exporter/abc_writer_instance.h | 1 - source/blender/io/alembic/exporter/abc_writer_mesh.cc | 4 ---- source/blender/io/alembic/exporter/abc_writer_mesh.h | 1 - source/blender/io/alembic/intern/abc_reader_object.cc | 4 ---- source/blender/io/alembic/intern/abc_reader_object.h | 2 +- source/blender/io/collada/SkinInfo.cpp | 5 +---- source/blender/io/common/IO_abstract_hierarchy_iterator.h | 5 +---- source/blender/io/common/intern/abstract_hierarchy_iterator.cc | 4 ---- source/blender/io/common/intern/dupli_parent_finder.cc | 8 -------- source/blender/io/common/intern/dupli_parent_finder.hh | 3 --- source/blender/io/common/intern/object_identifier.cc | 9 --------- source/blender/io/usd/intern/usd_writer_abstract.cc | 4 ---- source/blender/io/usd/intern/usd_writer_abstract.h | 1 - 18 files changed, 4 insertions(+), 62 deletions(-) (limited to 'source/blender/io') diff --git a/source/blender/io/alembic/exporter/abc_custom_props.cc b/source/blender/io/alembic/exporter/abc_custom_props.cc index 382afdc294d..f5593e7ee30 100644 --- a/source/blender/io/alembic/exporter/abc_custom_props.cc +++ b/source/blender/io/alembic/exporter/abc_custom_props.cc @@ -51,10 +51,6 @@ CustomPropertiesExporter::CustomPropertiesExporter(ABCAbstractWriter *owner) : o { } -CustomPropertiesExporter::~CustomPropertiesExporter() -{ -} - void CustomPropertiesExporter::write_all(const IDProperty *group) { if (group == nullptr) { diff --git a/source/blender/io/alembic/exporter/abc_custom_props.h b/source/blender/io/alembic/exporter/abc_custom_props.h index d3f9b2fc43c..fcd47382d96 100644 --- a/source/blender/io/alembic/exporter/abc_custom_props.h +++ b/source/blender/io/alembic/exporter/abc_custom_props.h @@ -61,7 +61,7 @@ class CustomPropertiesExporter { public: CustomPropertiesExporter(ABCAbstractWriter *owner); - virtual ~CustomPropertiesExporter(); + virtual ~CustomPropertiesExporter() = default; void write_all(const IDProperty *group); diff --git a/source/blender/io/alembic/exporter/abc_writer_abstract.cc b/source/blender/io/alembic/exporter/abc_writer_abstract.cc index e99048cc0ee..27b5c2fa2a4 100644 --- a/source/blender/io/alembic/exporter/abc_writer_abstract.cc +++ b/source/blender/io/alembic/exporter/abc_writer_abstract.cc @@ -45,10 +45,6 @@ ABCAbstractWriter::ABCAbstractWriter(const ABCWriterConstructorArgs &args) { } -ABCAbstractWriter::~ABCAbstractWriter() -{ -} - bool ABCAbstractWriter::is_supported(const HierarchyContext * /*context*/) const { return true; diff --git a/source/blender/io/alembic/exporter/abc_writer_abstract.h b/source/blender/io/alembic/exporter/abc_writer_abstract.h index 4997e498199..d3500394555 100644 --- a/source/blender/io/alembic/exporter/abc_writer_abstract.h +++ b/source/blender/io/alembic/exporter/abc_writer_abstract.h @@ -50,7 +50,6 @@ class ABCAbstractWriter : public AbstractHierarchyWriter { public: explicit ABCAbstractWriter(const ABCWriterConstructorArgs &args); - virtual ~ABCAbstractWriter(); virtual void write(HierarchyContext &context) override; diff --git a/source/blender/io/alembic/exporter/abc_writer_instance.cc b/source/blender/io/alembic/exporter/abc_writer_instance.cc index 7f3b044cb8b..1737e8c091e 100644 --- a/source/blender/io/alembic/exporter/abc_writer_instance.cc +++ b/source/blender/io/alembic/exporter/abc_writer_instance.cc @@ -35,10 +35,6 @@ ABCInstanceWriter::ABCInstanceWriter(const ABCWriterConstructorArgs &args) { } -ABCInstanceWriter::~ABCInstanceWriter() -{ -} - void ABCInstanceWriter::create_alembic_objects(const HierarchyContext *context) { OObject original = args_.hierarchy_iterator->get_alembic_object(context->original_export_path); diff --git a/source/blender/io/alembic/exporter/abc_writer_instance.h b/source/blender/io/alembic/exporter/abc_writer_instance.h index f7d6450055a..1e4285d5e02 100644 --- a/source/blender/io/alembic/exporter/abc_writer_instance.h +++ b/source/blender/io/alembic/exporter/abc_writer_instance.h @@ -31,7 +31,6 @@ namespace blender::io::alembic { class ABCInstanceWriter : public ABCAbstractWriter { public: explicit ABCInstanceWriter(const ABCWriterConstructorArgs &args); - virtual ~ABCInstanceWriter(); virtual void create_alembic_objects(const HierarchyContext *context) override; virtual Alembic::Abc::OObject get_alembic_object() const override; diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index fbc662113cc..c00e57c8edc 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -113,10 +113,6 @@ void ABCGenericMeshWriter::create_alembic_objects(const HierarchyContext *contex liquid_sim_modifier_ = get_liquid_sim_modifier(scene_eval, context->object); } -ABCGenericMeshWriter::~ABCGenericMeshWriter() -{ -} - Alembic::Abc::OObject ABCGenericMeshWriter::get_alembic_object() const { if (is_subd_) { diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.h b/source/blender/io/alembic/exporter/abc_writer_mesh.h index ed4fb4e4514..0e1792b9dab 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.h +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.h @@ -51,7 +51,6 @@ class ABCGenericMeshWriter : public ABCAbstractWriter { public: explicit ABCGenericMeshWriter(const ABCWriterConstructorArgs &args); - virtual ~ABCGenericMeshWriter(); virtual void create_alembic_objects(const HierarchyContext *context) override; virtual Alembic::Abc::OObject get_alembic_object() const override; diff --git a/source/blender/io/alembic/intern/abc_reader_object.cc b/source/blender/io/alembic/intern/abc_reader_object.cc index 5ca7022bb36..d428d98fdb9 100644 --- a/source/blender/io/alembic/intern/abc_reader_object.cc +++ b/source/blender/io/alembic/intern/abc_reader_object.cc @@ -97,10 +97,6 @@ void AbcObjectReader::determine_inherits_xform() } } -AbcObjectReader::~AbcObjectReader() -{ -} - const IObject &AbcObjectReader::iobject() const { return m_iobject; diff --git a/source/blender/io/alembic/intern/abc_reader_object.h b/source/blender/io/alembic/intern/abc_reader_object.h index 8e00ed42777..dacdcf3f722 100644 --- a/source/blender/io/alembic/intern/abc_reader_object.h +++ b/source/blender/io/alembic/intern/abc_reader_object.h @@ -100,7 +100,7 @@ class AbcObjectReader { public: explicit AbcObjectReader(const Alembic::Abc::IObject &object, ImportSettings &settings); - virtual ~AbcObjectReader(); + virtual ~AbcObjectReader() = default; const Alembic::Abc::IObject &iobject() const; diff --git a/source/blender/io/collada/SkinInfo.cpp b/source/blender/io/collada/SkinInfo.cpp index 8f6f1e467d9..12dee388a58 100644 --- a/source/blender/io/collada/SkinInfo.cpp +++ b/source/blender/io/collada/SkinInfo.cpp @@ -55,10 +55,7 @@ template static const char *bc_get_joint_name(T *node) /* This is used to store data passed in write_controller_data. * Arrays from COLLADAFW::SkinControllerData lose ownership, so do this class members * so that arrays don't get freed until we free them explicitly. */ -SkinInfo::SkinInfo() -{ - /* pass */ -} +SkinInfo::SkinInfo() = default; SkinInfo::SkinInfo(const SkinInfo &skin) : weights(skin.weights), diff --git a/source/blender/io/common/IO_abstract_hierarchy_iterator.h b/source/blender/io/common/IO_abstract_hierarchy_iterator.h index 300c555ac8f..0bebc4384a9 100644 --- a/source/blender/io/common/IO_abstract_hierarchy_iterator.h +++ b/source/blender/io/common/IO_abstract_hierarchy_iterator.h @@ -123,7 +123,7 @@ struct HierarchyContext { */ class AbstractHierarchyWriter { public: - virtual ~AbstractHierarchyWriter(); + virtual ~AbstractHierarchyWriter() = default; virtual void write(HierarchyContext &context) = 0; /* TODO(Sybren): add function like absent() that's called when a writer was previously created, * but wasn't used while exporting the current frame (for example, a particle-instanced mesh of @@ -186,9 +186,6 @@ class ObjectIdentifier { ObjectIdentifier(Object *object, Object *duplicated_by, const PersistentID &persistent_id); public: - ObjectIdentifier(const ObjectIdentifier &other); - ~ObjectIdentifier(); - static ObjectIdentifier for_graph_root(); static ObjectIdentifier for_real_object(Object *object); static ObjectIdentifier for_hierarchy_context(const HierarchyContext *context); diff --git a/source/blender/io/common/intern/abstract_hierarchy_iterator.cc b/source/blender/io/common/intern/abstract_hierarchy_iterator.cc index a33d636500f..3cda4d125d0 100644 --- a/source/blender/io/common/intern/abstract_hierarchy_iterator.cc +++ b/source/blender/io/common/intern/abstract_hierarchy_iterator.cc @@ -137,10 +137,6 @@ AbstractHierarchyWriter *EnsuredWriter::operator->() return writer_; } -AbstractHierarchyWriter::~AbstractHierarchyWriter() -{ -} - bool AbstractHierarchyWriter::check_is_animated(const HierarchyContext &context) const { const Object *object = context.object; diff --git a/source/blender/io/common/intern/dupli_parent_finder.cc b/source/blender/io/common/intern/dupli_parent_finder.cc index 73e33eff164..221e70ed587 100644 --- a/source/blender/io/common/intern/dupli_parent_finder.cc +++ b/source/blender/io/common/intern/dupli_parent_finder.cc @@ -25,14 +25,6 @@ namespace blender::io { -DupliParentFinder::DupliParentFinder() -{ -} - -DupliParentFinder::~DupliParentFinder() -{ -} - void DupliParentFinder::insert(const DupliObject *dupli_ob) { dupli_set_.insert(dupli_ob->ob); diff --git a/source/blender/io/common/intern/dupli_parent_finder.hh b/source/blender/io/common/intern/dupli_parent_finder.hh index 3dcf037bb5e..b7632a72222 100644 --- a/source/blender/io/common/intern/dupli_parent_finder.hh +++ b/source/blender/io/common/intern/dupli_parent_finder.hh @@ -43,9 +43,6 @@ class DupliParentFinder final { InstancerPIDToDuplisMap instancer_pid_to_duplis_; public: - DupliParentFinder(); - ~DupliParentFinder(); - void insert(const DupliObject *dupli_ob); bool is_duplicated(const Object *object) const; diff --git a/source/blender/io/common/intern/object_identifier.cc b/source/blender/io/common/intern/object_identifier.cc index 5d0b89b0630..2df1befcd69 100644 --- a/source/blender/io/common/intern/object_identifier.cc +++ b/source/blender/io/common/intern/object_identifier.cc @@ -35,15 +35,6 @@ ObjectIdentifier::ObjectIdentifier(Object *object, { } -ObjectIdentifier::ObjectIdentifier(const ObjectIdentifier &other) - : object(other.object), duplicated_by(other.duplicated_by), persistent_id(other.persistent_id) -{ -} - -ObjectIdentifier::~ObjectIdentifier() -{ -} - ObjectIdentifier ObjectIdentifier::for_real_object(Object *object) { return ObjectIdentifier(object, nullptr, PersistentID()); diff --git a/source/blender/io/usd/intern/usd_writer_abstract.cc b/source/blender/io/usd/intern/usd_writer_abstract.cc index 694fc76a446..5e66136abf1 100644 --- a/source/blender/io/usd/intern/usd_writer_abstract.cc +++ b/source/blender/io/usd/intern/usd_writer_abstract.cc @@ -41,10 +41,6 @@ USDAbstractWriter::USDAbstractWriter(const USDExporterContext &usd_export_contex { } -USDAbstractWriter::~USDAbstractWriter() -{ -} - bool USDAbstractWriter::is_supported(const HierarchyContext * /*context*/) const { return true; diff --git a/source/blender/io/usd/intern/usd_writer_abstract.h b/source/blender/io/usd/intern/usd_writer_abstract.h index 2143164e3dd..6f143a7e241 100644 --- a/source/blender/io/usd/intern/usd_writer_abstract.h +++ b/source/blender/io/usd/intern/usd_writer_abstract.h @@ -49,7 +49,6 @@ class USDAbstractWriter : public AbstractHierarchyWriter { public: USDAbstractWriter(const USDExporterContext &usd_export_context); - virtual ~USDAbstractWriter(); virtual void write(HierarchyContext &context) override; -- cgit v1.2.3