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/depsgraph/intern/builder/deg_builder.cc | 4 ---- source/blender/depsgraph/intern/builder/deg_builder.h | 2 +- source/blender/depsgraph/intern/builder/deg_builder_cache.cc | 4 ---- source/blender/depsgraph/intern/builder/deg_builder_cache.h | 1 - source/blender/depsgraph/intern/builder/deg_builder_map.cc | 8 -------- source/blender/depsgraph/intern/builder/deg_builder_map.h | 3 --- source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc | 8 -------- source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h | 4 ---- source/blender/depsgraph/intern/builder/deg_builder_rna.cc | 4 +--- source/blender/depsgraph/intern/builder/pipeline.cc | 4 ---- source/blender/depsgraph/intern/builder/pipeline.h | 2 +- .../depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc | 8 -------- .../depsgraph/intern/eval/deg_eval_runtime_backup_animation.h | 3 +-- source/blender/depsgraph/intern/node/deg_node_operation.cc | 4 ---- source/blender/depsgraph/intern/node/deg_node_operation.h | 1 - 15 files changed, 4 insertions(+), 56 deletions(-) (limited to 'source/blender/depsgraph') diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index e4660c34762..f4d65698bee 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -77,10 +77,6 @@ DepsgraphBuilder::DepsgraphBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuild { } -DepsgraphBuilder::~DepsgraphBuilder() -{ -} - bool DepsgraphBuilder::need_pull_base_into_graph(Base *base) { /* Simple check: enabled bases are always part of dependency graph. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder.h b/source/blender/depsgraph/intern/builder/deg_builder.h index 36b6b1bf17d..6e1c8d8526f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.h +++ b/source/blender/depsgraph/intern/builder/deg_builder.h @@ -37,7 +37,7 @@ class DepsgraphBuilderCache; class DepsgraphBuilder { public: - virtual ~DepsgraphBuilder(); + virtual ~DepsgraphBuilder() = default; virtual bool need_pull_base_into_graph(Base *base); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_cache.cc b/source/blender/depsgraph/intern/builder/deg_builder_cache.cc index df108072142..af7717d7595 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_cache.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_cache.cc @@ -149,10 +149,6 @@ bool AnimatedPropertyStorage::isPropertyAnimated(const PointerRNA *pointer_rna, /* Builder cache itself. */ -DepsgraphBuilderCache::DepsgraphBuilderCache() -{ -} - DepsgraphBuilderCache::~DepsgraphBuilderCache() { for (AnimatedPropertyStorage *animated_property_storage : diff --git a/source/blender/depsgraph/intern/builder/deg_builder_cache.h b/source/blender/depsgraph/intern/builder/deg_builder_cache.h index e04ae3a3727..c955a22a5cf 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_cache.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_cache.h @@ -81,7 +81,6 @@ class AnimatedPropertyStorage { /* Cached data which can be re-used by multiple builders. */ class DepsgraphBuilderCache { public: - DepsgraphBuilderCache(); ~DepsgraphBuilderCache(); /* Makes sure storage for animated properties exists and initialized for the given ID. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_map.cc b/source/blender/depsgraph/intern/builder/deg_builder_map.cc index 5da54350cfc..6e926da6b29 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_map.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_map.cc @@ -27,14 +27,6 @@ namespace blender::deg { -BuilderMap::BuilderMap() -{ -} - -BuilderMap::~BuilderMap() -{ -} - bool BuilderMap::checkIsBuilt(ID *id, int tag) const { return (getIDTag(id) & tag) == tag; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_map.h b/source/blender/depsgraph/intern/builder/deg_builder_map.h index 8b23d3d0d3b..53f6a722e85 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_map.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_map.h @@ -47,9 +47,6 @@ class BuilderMap { TAG_SCENE_COMPOSITOR | TAG_SCENE_SEQUENCER | TAG_SCENE_AUDIO), }; - BuilderMap(); - ~BuilderMap(); - /* Check whether given ID is already handled by builder (or if it's being handled). */ bool checkIsBuilt(ID *id, int tag = TAG_COMPLETE) const; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc index 197e14c1a21..17c2925b7f4 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc @@ -30,14 +30,6 @@ namespace blender::deg { -RootPChanMap::RootPChanMap() -{ -} - -RootPChanMap::~RootPChanMap() -{ -} - /* Debug contents of map */ void RootPChanMap::print_debug() { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h index 7a6ea38a0f0..0dd4062c353 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h @@ -29,10 +29,6 @@ namespace blender { namespace deg { struct RootPChanMap { - /* Constructor and destructor - Create and free the internal map respectively. */ - RootPChanMap(); - ~RootPChanMap(); - /* Debug contents of map. */ void print_debug(); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index 4064058f231..54c51adec66 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -119,9 +119,7 @@ RNANodeQuery::RNANodeQuery(Depsgraph *depsgraph, DepsgraphBuilder *builder) { } -RNANodeQuery::~RNANodeQuery() -{ -} +RNANodeQuery::~RNANodeQuery() = default; Node *RNANodeQuery::find_node(const PointerRNA *ptr, const PropertyRNA *prop, diff --git a/source/blender/depsgraph/intern/builder/pipeline.cc b/source/blender/depsgraph/intern/builder/pipeline.cc index b96236ba2e3..10bc7213061 100644 --- a/source/blender/depsgraph/intern/builder/pipeline.cc +++ b/source/blender/depsgraph/intern/builder/pipeline.cc @@ -40,10 +40,6 @@ AbstractBuilderPipeline::AbstractBuilderPipeline(::Depsgraph *graph) { } -AbstractBuilderPipeline::~AbstractBuilderPipeline() -{ -} - void AbstractBuilderPipeline::build() { double start_time = 0.0; diff --git a/source/blender/depsgraph/intern/builder/pipeline.h b/source/blender/depsgraph/intern/builder/pipeline.h index dcd1bc6f26e..d0ccf352c21 100644 --- a/source/blender/depsgraph/intern/builder/pipeline.h +++ b/source/blender/depsgraph/intern/builder/pipeline.h @@ -50,7 +50,7 @@ class DepsgraphRelationBuilder; class AbstractBuilderPipeline { public: AbstractBuilderPipeline(::Depsgraph *graph); - virtual ~AbstractBuilderPipeline(); + virtual ~AbstractBuilderPipeline() = default; void build(); diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc index c1d2dd8b6cc..bd872d40825 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc @@ -75,19 +75,11 @@ void animated_property_store_cb(ID *id, FCurve *fcurve, void *data_v) } // namespace -AnimationValueBackup::AnimationValueBackup() -{ -} - AnimationValueBackup::AnimationValueBackup(const string &rna_path, int array_index, float value) : rna_path(rna_path), array_index(array_index), value(value) { } -AnimationValueBackup::~AnimationValueBackup() -{ -} - AnimationBackup::AnimationBackup(const Depsgraph *depsgraph) { meed_value_backup = !depsgraph->is_active; diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h index 6b5d5eab75f..8f71457ae6f 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h @@ -34,9 +34,8 @@ struct Depsgraph; class AnimationValueBackup { public: - AnimationValueBackup(); + AnimationValueBackup() = default; AnimationValueBackup(const string &rna_path, int array_index, float value); - ~AnimationValueBackup(); AnimationValueBackup(const AnimationValueBackup &other) = default; AnimationValueBackup(AnimationValueBackup &&other) noexcept = default; diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc index 97aca6280be..7e57467f905 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc @@ -213,10 +213,6 @@ OperationNode::OperationNode() : name_tag(-1), flag(0) { } -OperationNode::~OperationNode() -{ -} - string OperationNode::identifier() const { return string(operationCodeAsString(opcode)) + "(" + name + ")"; diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h index 40369de08f5..1d966cffd5d 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.h +++ b/source/blender/depsgraph/intern/node/deg_node_operation.h @@ -231,7 +231,6 @@ enum OperationFlag { /* Atomic Operation - Base type for all operations */ struct OperationNode : public Node { OperationNode(); - ~OperationNode(); virtual string identifier() const override; string full_identifier() const; -- cgit v1.2.3