From e1593617f9491d04e04729c1e78f49561f82bc69 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 8 Jun 2021 11:13:39 -0500 Subject: [PATCH] Clean up functions that trigger GCC9 warnings Signed-off-by: Michael Carroll --- tpe/lib/src/AABBTree.cc | 4 +--- tpe/lib/src/Collision.hh | 2 +- tpe/lib/src/CollisionDetector.cc | 4 +--- tpe/lib/src/Entity.hh | 2 +- tpe/lib/src/Link.hh | 2 +- tpe/lib/src/Model.hh | 2 +- tpe/lib/src/Shape.cc | 35 -------------------------------- tpe/lib/src/Shape.hh | 26 +++++------------------- 8 files changed, 11 insertions(+), 66 deletions(-) diff --git a/tpe/lib/src/AABBTree.cc b/tpe/lib/src/AABBTree.cc index 83690c340..0eae4c44a 100644 --- a/tpe/lib/src/AABBTree.cc +++ b/tpe/lib/src/AABBTree.cc @@ -53,9 +53,7 @@ AABBTree::AABBTree() } ////////////////////////////////////////////////// -AABBTree::~AABBTree() -{ -} +AABBTree::~AABBTree() = default; ////////////////////////////////////////////////// void AABBTree::AddNode(std::size_t _id, const math::AxisAlignedBox &_aabb) diff --git a/tpe/lib/src/Collision.hh b/tpe/lib/src/Collision.hh index bf6414720..897b70bc3 100644 --- a/tpe/lib/src/Collision.hh +++ b/tpe/lib/src/Collision.hh @@ -47,7 +47,7 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE Collision : public Entity public: Collision(const Collision &_other); /// \brief Destructor - public: ~Collision(); + public: virtual ~Collision(); /// \brief Assignment operator /// \param[in] _other collision diff --git a/tpe/lib/src/CollisionDetector.cc b/tpe/lib/src/CollisionDetector.cc index 55ea5131c..32caf350c 100644 --- a/tpe/lib/src/CollisionDetector.cc +++ b/tpe/lib/src/CollisionDetector.cc @@ -59,9 +59,7 @@ CollisionDetector::CollisionDetector() } ////////////////////////////////////////////////// -CollisionDetector::~CollisionDetector() -{ -} +CollisionDetector::~CollisionDetector() = default; ////////////////////////////////////////////////// std::vector CollisionDetector::CheckCollisions( diff --git a/tpe/lib/src/Entity.hh b/tpe/lib/src/Entity.hh index 740b74067..0e3e8f3b0 100644 --- a/tpe/lib/src/Entity.hh +++ b/tpe/lib/src/Entity.hh @@ -60,7 +60,7 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE Entity protected: explicit Entity(std::size_t _id); /// \brief Destructor - public: ~Entity(); + public: virtual ~Entity(); /// \brief Assignment operator /// \param[in] _other Other entity to copy from diff --git a/tpe/lib/src/Link.hh b/tpe/lib/src/Link.hh index 05cfccf65..588e61628 100644 --- a/tpe/lib/src/Link.hh +++ b/tpe/lib/src/Link.hh @@ -39,7 +39,7 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE Link : public Entity public: explicit Link(std::size_t _id); /// \brief Destructor - public: ~Link() = default; + public: virtual ~Link() = default; /// \brief Add a collision /// \return Newly created Collision diff --git a/tpe/lib/src/Model.hh b/tpe/lib/src/Model.hh index 9ae9fc3fa..f70719eb9 100644 --- a/tpe/lib/src/Model.hh +++ b/tpe/lib/src/Model.hh @@ -42,7 +42,7 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE Model : public Entity public: explicit Model(std::size_t _id); /// \brief Destructor - public: ~Model(); + public: virtual ~Model(); /// \brief Add a link /// \return Newly created Link diff --git a/tpe/lib/src/Shape.cc b/tpe/lib/src/Shape.cc index 6337aebd3..9d9093db8 100644 --- a/tpe/lib/src/Shape.cc +++ b/tpe/lib/src/Shape.cc @@ -56,18 +56,6 @@ BoxShape::BoxShape() : Shape() this->type = ShapeType::BOX; } -////////////////////////////////////////////////// -BoxShape::BoxShape(const BoxShape &_other) - : Shape() -{ - *this = _other; -} - -////////////////////////////////////////////////// -BoxShape::~BoxShape() -{ -} - ////////////////////////////////////////////////// Shape &BoxShape::operator=(const Shape &_other) { @@ -103,13 +91,6 @@ CylinderShape::CylinderShape() : Shape() this->type = ShapeType::CYLINDER; } -////////////////////////////////////////////////// -CylinderShape::CylinderShape(const CylinderShape &_other) - : Shape() -{ - *this = _other; -} - ////////////////////////////////////////////////// Shape &CylinderShape::operator=(const Shape &_other) { @@ -158,13 +139,6 @@ SphereShape::SphereShape() : Shape() this->type = ShapeType::SPHERE; } -////////////////////////////////////////////////// -SphereShape::SphereShape(const SphereShape &_other) - : Shape() -{ - *this = _other; -} - ////////////////////////////////////////////////// Shape &SphereShape::operator=(const Shape &_other) { @@ -199,13 +173,6 @@ MeshShape::MeshShape() : Shape() this->type = ShapeType::MESH; } -////////////////////////////////////////////////// -MeshShape::MeshShape(const MeshShape &_other) - : Shape() -{ - *this = _other; -} - ////////////////////////////////////////////////// Shape &MeshShape::operator=(const Shape &_other) { @@ -245,5 +212,3 @@ void MeshShape::UpdateBoundingBox() this->bbox = math::AxisAlignedBox( this->scale * this->meshAABB.Min(), this->scale * this->meshAABB.Max()); } - - diff --git a/tpe/lib/src/Shape.hh b/tpe/lib/src/Shape.hh index a79042ea8..231a55508 100644 --- a/tpe/lib/src/Shape.hh +++ b/tpe/lib/src/Shape.hh @@ -63,7 +63,7 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE Shape public: Shape(); /// \brief Destructor - public: ~Shape() = default; + public: virtual ~Shape() = default; /// \brief Get bounding box of shape /// \return Shape's bounding box @@ -92,12 +92,8 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE BoxShape : public Shape /// \brief Constructor public: BoxShape(); - /// \brief Copy Constructor - /// \param[in] _other shape to copy from - public: BoxShape(const BoxShape &_other); - /// \brief Destructor - public: ~BoxShape(); + public: virtual ~BoxShape() = default; /// \brief Assignment operator /// \param[in] _other shape to copy from @@ -126,12 +122,8 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE CylinderShape : public Shape /// \brief Constructor public: CylinderShape(); - /// \brief Copy Constructor - /// \param[in] _other shape to copy from - public: CylinderShape(const CylinderShape &_other); - /// \brief Destructor - public: ~CylinderShape() = default; + public: virtual ~CylinderShape() = default; /// \brief Assignment operator /// \param[in] _other shape to copy from @@ -169,12 +161,8 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE SphereShape : public Shape /// \brief Constructor public: SphereShape(); - /// \brief Copy Constructor - /// \param[in] _other shape to copy from - public: SphereShape(const SphereShape &_other); - /// \brief Destructor - public: ~SphereShape() = default; + public: virtual ~SphereShape() = default; /// \brief Assignment operator /// \param[in] _other shape to copy from @@ -201,12 +189,8 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE MeshShape : public Shape /// \brief Constructor public: MeshShape(); - /// \brief Copy Constructor - /// \param[in] _other shape to copy from - public: MeshShape(const MeshShape &_other); - /// \brief Destructor - public: ~MeshShape() = default; + public: virtual ~MeshShape() = default; /// \brief Assignment operator /// \param[in] _other shape to copy from