[Bf-blender-cvs] [19dfb6ea1f6] master: Cleanup: enable modernize-use-equals-default check
Jacques Lucke
noreply at git.blender.org
Thu Apr 8 11:07:55 CEST 2021
Commit: 19dfb6ea1f6745c0dbc2ce21839c30184b553878
Author: Jacques Lucke
Date: Thu Apr 8 11:07:12 2021 +0200
Branches: master
https://developer.blender.org/rB19dfb6ea1f6745c0dbc2ce21839c30184b553878
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
===================================================================
M .clang-tidy
M source/blender/blenkernel/BKE_geometry_set.hh
M source/blender/blenkernel/intern/cryptomatte.cc
M source/blender/blenkernel/intern/geometry_set.cc
M source/blender/blenkernel/intern/volume.cc
M source/blender/blenlib/intern/delaunay_2d.cc
M source/blender/blenlib/intern/mesh_intersect.cc
M source/blender/blenlib/intern/task_pool.cc
M source/blender/blenloader/tests/blendfile_loading_base_test.cc
M source/blender/blenloader/tests/blendfile_loading_base_test.h
M source/blender/compositor/intern/COM_NodeGraph.cc
M source/blender/compositor/intern/COM_NodeGraph.h
M source/blender/compositor/intern/COM_NodeOperationBuilder.cc
M source/blender/compositor/intern/COM_NodeOperationBuilder.h
M source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc
M source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
M source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cc
M source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
M source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cc
M source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h
M source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cc
M source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h
M source/blender/compositor/operations/COM_DistanceYCCMatteOperation.cc
M source/blender/compositor/operations/COM_DistanceYCCMatteOperation.h
M source/blender/compositor/operations/COM_MixOperation.cc
M source/blender/compositor/operations/COM_MixOperation.h
M source/blender/depsgraph/intern/builder/deg_builder.cc
M source/blender/depsgraph/intern/builder/deg_builder.h
M source/blender/depsgraph/intern/builder/deg_builder_cache.cc
M source/blender/depsgraph/intern/builder/deg_builder_cache.h
M source/blender/depsgraph/intern/builder/deg_builder_map.cc
M source/blender/depsgraph/intern/builder/deg_builder_map.h
M source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc
M source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h
M source/blender/depsgraph/intern/builder/deg_builder_rna.cc
M source/blender/depsgraph/intern/builder/pipeline.cc
M source/blender/depsgraph/intern/builder/pipeline.h
M source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc
M source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h
M source/blender/depsgraph/intern/node/deg_node_operation.cc
M source/blender/depsgraph/intern/node/deg_node_operation.h
M source/blender/gpu/intern/gpu_batch_private.hh
M source/blender/gpu/intern/gpu_shader_interface.cc
M source/blender/gpu/opengl/gl_batch.cc
M source/blender/gpu/opengl/gl_batch.hh
M source/blender/imbuf/intern/openexr/openexr_api.cpp
M source/blender/io/alembic/exporter/abc_custom_props.cc
M source/blender/io/alembic/exporter/abc_custom_props.h
M source/blender/io/alembic/exporter/abc_writer_abstract.cc
M source/blender/io/alembic/exporter/abc_writer_abstract.h
M source/blender/io/alembic/exporter/abc_writer_instance.cc
M source/blender/io/alembic/exporter/abc_writer_instance.h
M source/blender/io/alembic/exporter/abc_writer_mesh.cc
M source/blender/io/alembic/exporter/abc_writer_mesh.h
M source/blender/io/alembic/intern/abc_reader_object.cc
M source/blender/io/alembic/intern/abc_reader_object.h
M source/blender/io/collada/SkinInfo.cpp
M source/blender/io/common/IO_abstract_hierarchy_iterator.h
M source/blender/io/common/intern/abstract_hierarchy_iterator.cc
M source/blender/io/common/intern/dupli_parent_finder.cc
M source/blender/io/common/intern/dupli_parent_finder.hh
M source/blender/io/common/intern/object_identifier.cc
M source/blender/io/usd/intern/usd_writer_abstract.cc
M source/blender/io/usd/intern/usd_writer_abstract.h
===================================================================
diff --git a/.clang-tidy b/.clang-tidy
index 23a541eefd1..b03163b54b9 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -35,7 +35,6 @@ Checks: >
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
- -modernize-use-equals-default,
-modernize-use-nodiscard,
-modernize-loop-convert,
-modernize-pass-by-value,
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index 4454669b59a..ab126ecb152 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -135,7 +135,7 @@ class GeometryComponent {
public:
GeometryComponent(GeometryComponentType type);
- virtual ~GeometryComponent();
+ virtual ~GeometryComponent() = default;
static GeometryComponent *create(GeometryComponentType component_type);
/* The returned component should be of the same type as the type this is called on. */
diff --git a/source/blender/blenkernel/intern/cryptomatte.cc b/source/blender/blenkernel/intern/cryptomatte.cc
index 99f0342e223..1ff0ca92306 100644
--- a/source/blender/blenkernel/intern/cryptomatte.cc
+++ b/source/blender/blenkernel/intern/cryptomatte.cc
@@ -54,7 +54,7 @@ struct CryptomatteSession {
/* Layer names in order of creation. */
blender::Vector<std::string> layer_names;
- CryptomatteSession();
+ CryptomatteSession() = default;
CryptomatteSession(const Main *bmain);
CryptomatteSession(StampData *stamp_data);
CryptomatteSession(const Scene *scene);
@@ -67,10 +67,6 @@ struct CryptomatteSession {
#endif
};
-CryptomatteSession::CryptomatteSession()
-{
-}
-
CryptomatteSession::CryptomatteSession(const Main *bmain)
{
if (!BLI_listbase_is_empty(&bmain->objects)) {
diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc
index 281512fe323..3b027c05f39 100644
--- a/source/blender/blenkernel/intern/geometry_set.cc
+++ b/source/blender/blenkernel/intern/geometry_set.cc
@@ -49,10 +49,6 @@ GeometryComponent::GeometryComponent(GeometryComponentType type) : type_(type)
{
}
-GeometryComponent ::~GeometryComponent()
-{
-}
-
GeometryComponent *GeometryComponent::create(GeometryComponentType component_type)
{
switch (component_type) {
diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc
index 9b5231f7d6f..6c0d361a64c 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -171,10 +171,6 @@ static struct VolumeFileCache {
};
/* Cache */
- VolumeFileCache()
- {
- }
-
~VolumeFileCache()
{
BLI_assert(cache.empty());
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc
index 06a749ab921..9444d1a29cb 100644
--- a/source/blender/blenlib/intern/delaunay_2d.cc
+++ b/source/blender/blenlib/intern/delaunay_2d.cc
@@ -334,9 +334,6 @@ template<typename T> class CDT_state {
T epsilon;
explicit CDT_state(int num_input_verts, int num_input_edges, int num_input_faces, T epsilon);
- ~CDT_state()
- {
- }
};
template<typename T> CDTArrangement<T>::~CDTArrangement()
diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc
index b2b8dd4e900..ce3a5b55f98 100644
--- a/source/blender/blenlib/intern/mesh_intersect.cc
+++ b/source/blender/blenlib/intern/mesh_intersect.cc
@@ -527,9 +527,7 @@ IMeshArena::IMeshArena()
pimpl_ = std::make_unique<IMeshArenaImpl>();
}
-IMeshArena::~IMeshArena()
-{
-}
+IMeshArena::~IMeshArena() = default;
void IMeshArena::reserve(int vert_num_hint, int face_num_hint)
{
@@ -753,27 +751,6 @@ struct BoundingBox {
BoundingBox(const float3 &min, const float3 &max) : min(min), max(max)
{
}
- BoundingBox(const BoundingBox &other) : min(other.min), max(other.max)
- {
- }
- BoundingBox(BoundingBox &&other) noexcept : min(std::move(other.min)), max(std::move(other.max))
- {
- }
- ~BoundingBox() = default;
- BoundingBox operator=(const BoundingBox &other)
- {
- if (this != &other) {
- min = other.min;
- max = other.max;
- }
- return *this;
- }
- BoundingBox operator=(BoundingBox &&other) noexcept
- {
- min = std::move(other.min);
- max = std::move(other.max);
- return *this;
- }
void combine(const float3 &p)
{
@@ -936,28 +913,6 @@ class CoplanarCluster {
{
this->add_tri(t, bb);
}
- CoplanarCluster(const CoplanarCluster &other) : tris_(other.tris_), bb_(other.bb_)
- {
- }
- CoplanarCluster(CoplanarCluster &&other) noexcept
- : tris_(std::move(other.tris_)), bb_(std::move(other.bb_))
- {
- }
- ~CoplanarCluster() = default;
- CoplanarCluster &operator=(const CoplanarCluster &other)
- {
- if (this != &other) {
- tris_ = other.tris_;
- bb_ = other.bb_;
- }
- return *this;
- }
- CoplanarCluster &operator=(CoplanarCluster &&other) noexcept
- {
- tris_ = std::move(other.tris_);
- bb_ = std::move(other.bb_);
- return *this;
- }
/* Assume that caller knows this will not be a duplicate. */
void add_tri(int t, const BoundingBox &bb)
@@ -1073,38 +1028,6 @@ struct ITT_value {
ITT_value(ITT_value_kind k, const mpq3 &p1, const mpq3 &p2) : p1(p1), p2(p2), kind(k)
{
}
- ITT_value(const ITT_value &other)
- : p1(other.p1), p2(other.p2), t_source(other.t_source), kind(other.kind)
- {
- }
- ITT_value(ITT_value &&other) noexcept
- : p1(std::move(other.p1)),
- p2(std::move(other.p2)),
- t_source(other.t_source),
- kind(other.kind)
- {
- }
- ~ITT_value()
- {
- }
- ITT_value &operator=(const ITT_value &other)
- {
- if (this != &other) {
- kind = other.kind;
- p1 = other.p1;
- p2 = other.p2;
- t_source = other.t_source;
- }
- return *this;
- }
- ITT_value &operator=(ITT_value &&other) noexcept
- {
- kind = other.kind;
- p1 = std::move(other.p1);
- p2 = std::move(other.p2);
- t_source = other.t_source;
- return *this;
- }
};
static std::ostream &operator<<(std::ostream &os, const ITT_value &itt);
diff --git a/source/blender/blenlib/intern/task_pool.cc b/source/blender/blenlib/intern/task_pool.cc
index 00ba659a9c8..6404f5264cc 100644
--- a/source/blender/blenlib/intern/task_pool.cc
+++ b/source/blender/blenlib/intern/task_pool.cc
@@ -147,10 +147,6 @@ class TBBTaskGroup : public tbb::task_group {
}
# endif
}
-
- ~TBBTaskGroup()
- {
- }
};
#endif
diff --git a/source/blender/blenloader/tests/blendfile_loading_base_test.cc b/source/blender/blenloader/tests/blendfile_loading_base_test.cc
index 8d8dc3aebf7..280a4b42b36 100644
--- a/source/blender/blenloader/tests/blendfile_loading_base_test.cc
+++ b/source/blender/blenloader/tests/blendfile_loading_base_test.cc
@@ -50,10 +50,6 @@
#include "CLG_log.h"
-BlendfileLoadingBaseTest::~BlendfileLoadingBaseTest()
-{
-}
-
void BlendfileLoadingBaseTest::SetUpTestCase()
{
testing::Test::SetUpTestCase();
diff --git a/source/blender/blenloader/tests/blendfile_loading_base_test.h b/source/blender/blenloader/tests/blendfile_loading_base_test.h
index 32bb2959dcc..d352aecfe41 100644
--- a/source/blender/blenloader/tests/blendfile_loading_base_test.h
+++ b/source/blender/blenloader/tests/blendfile_loading_base_test.h
@@ -30,8 +30,6 @@ class BlendfileLoadingBaseTest : public testing::Test {
struct Depsgraph *depsgraph = nullptr;
public:
- virtual ~BlendfileLoadingBaseTest();
-
/* Sets up Blender just enough to not crash on loading
* a blendfile and constructing a depsgraph. */
static void SetUpTestCase();
diff --git a/source/blender/compositor/intern/COM_NodeGraph.cc b/source/blender/compositor/intern/COM_NodeGraph.cc
index 1907022e0ec..fbe56dd4b5a 100644
--- a/source/blender/compositor/intern/COM_NodeGraph.cc
+++ b/source/blender/compositor/intern/COM_NodeGraph.cc
@@ -39,10 +39,6 @@ namespace blender::compositor {
**** NodeGraph ****
*******************/
-NodeGraph::NodeGraph()
-{
-}
-
NodeGraph::~NodeGraph()
{
while (m_nodes.size()) {
diff --git a/source/blender/compositor/intern/COM_NodeGraph.h b/source/blender/compositor/intern/COM_NodeGraph.h
index 68bba7b1007..7fa01593e1e 100644
--- a/source/blender/compositor/intern/COM_NodeGraph.h
+++ b/source/blender/compositor/intern/COM_NodeGraph.h
@@ -56,7 +56,6 @@ class NodeGraph {
Vector<Link> m_links;
public:
- NodeGraph();
~NodeGraph();
const Vector<Node *> &nodes() const
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
index 889af4ea39a..82eb969b752 100644
--- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
+++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
@@ -46,10 +46,6 @@ NodeOperationBuilder::NodeOperationBuilder(const CompositorContext *context, bNo
m_graph.from_bNodeTree(*context, b_nodetree);
}
-NodeOperationBuilder::~NodeOperationBuilder()
-{
-}
-
void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
{
/* interface handle for nodes */
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.h b/source/blender/compositor/intern/COM_NodeOperationBuilder.h
index 3b0ce57ed26..b2fb822af25 100644
--- a/source/blender/compositor/intern/COM_NodeOperationBuilder.h
+++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.h
@@ -87,7 +87,6 @@ class NodeOperationBuilder {
public:
NodeOperationBuilder(const CompositorContext *context, bNodeTree *b_nodetree);
- ~NodeOperationBuilder();
const CompositorContext &context() const
{
diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc
index 34638cbe7d6..0c656753a51 100644
--- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc
+++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cc
@@ -20,11 +20,6 @@
namespace blender::compositor {
-AlphaOverKeyOperation::AlphaOverKeyOperation()
-{
- /* pass */
-}
-
void AlphaOverKeyOperation::executePixelSampled(float output[4],
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list