From 4e32cb17df3f91f224b86c104dbeee97bf1e46ee Mon Sep 17 00:00:00 2001
From: Daniel Agar <daniel@agar.ca>
Date: Fri, 18 May 2018 00:10:13 -0400
Subject: [PATCH] clang-tidy modernize-use-equals-default

---
 .../interfaces/src/camera_interface.cpp              |  4 +---
 src/drivers/distance_sensor/ll40ls/LidarLite.cpp     |  4 +---
 src/examples/segway/blocks.cpp                       |  2 +-
 src/lib/drivers/device/integrator.cpp                |  6 +-----
 src/lib/drivers/led/led.cpp                          |  4 +---
 .../commander_tests/state_machine_helper_test.cpp    | 10 ++--------
 .../LandingTargetEstimator.cpp                       |  4 +---
 src/modules/mavlink/mavlink_messages.cpp             |  2 +-
 src/modules/mavlink/mavlink_rate_limiter.cpp         |  4 +---
 src/modules/mavlink/mavlink_shell.cpp                |  4 +---
 src/modules/mavlink/mavlink_stream.cpp               |  4 +---
 .../mavlink/mavlink_tests/mavlink_ftp_test.cpp       |  5 +----
 .../mc_pos_control_tests/mc_pos_control_tests.cpp    | 12 ++----------
 src/modules/sensors/sensors.cpp                      |  3 +--
 src/modules/simulator/accelsim/accelsim.cpp          |  4 +---
 src/modules/simulator/gyrosim/gyrosim.cpp            |  2 +-
 src/modules/simulator/ledsim/led.cpp                 |  6 +-----
 src/modules/vtol_att_control/standard.cpp            |  4 +---
 src/modules/vtol_att_control/tailsitter.cpp          |  5 +----
 src/modules/vtol_att_control/tiltrotor.cpp           |  5 +----
 src/modules/vtol_att_control/vtol_type.cpp           |  5 +----
 .../posix/tests/vcdev_test/vcdevtest_example.cpp     |  4 ++--
 22 files changed, 25 insertions(+), 78 deletions(-)

diff --git a/src/drivers/camera_trigger/interfaces/src/camera_interface.cpp b/src/drivers/camera_trigger/interfaces/src/camera_interface.cpp
index b1d27f5e4b..18f8ac8013 100644
--- a/src/drivers/camera_trigger/interfaces/src/camera_interface.cpp
+++ b/src/drivers/camera_trigger/interfaces/src/camera_interface.cpp
@@ -12,9 +12,7 @@ CameraInterface::CameraInterface():
 {
 }
 
-CameraInterface::~CameraInterface()
-{
-}
+CameraInterface::~CameraInterface() = default;
 
 void CameraInterface::get_pins()
 {
diff --git a/src/drivers/distance_sensor/ll40ls/LidarLite.cpp b/src/drivers/distance_sensor/ll40ls/LidarLite.cpp
index 657376091d..3a6707e6f9 100644
--- a/src/drivers/distance_sensor/ll40ls/LidarLite.cpp
+++ b/src/drivers/distance_sensor/ll40ls/LidarLite.cpp
@@ -48,9 +48,7 @@ LidarLite::LidarLite() :
 {
 }
 
-LidarLite::~LidarLite()
-{
-}
+LidarLite::~LidarLite() = default;
 
 void LidarLite::set_minimum_distance(const float min)
 {
diff --git a/src/examples/segway/blocks.cpp b/src/examples/segway/blocks.cpp
index 4874ba3471..b751137da0 100644
--- a/src/examples/segway/blocks.cpp
+++ b/src/examples/segway/blocks.cpp
@@ -51,7 +51,7 @@ BlockWaypointGuidance::BlockWaypointGuidance(SuperBlock *parent, const char *nam
 {
 }
 
-BlockWaypointGuidance::~BlockWaypointGuidance() {};
+BlockWaypointGuidance::~BlockWaypointGuidance() = default;;
 
 void BlockWaypointGuidance::update(
 	const vehicle_global_position_s &pos,
diff --git a/src/lib/drivers/device/integrator.cpp b/src/lib/drivers/device/integrator.cpp
index 2835906b91..9adb1f95b8 100644
--- a/src/lib/drivers/device/integrator.cpp
+++ b/src/lib/drivers/device/integrator.cpp
@@ -54,13 +54,9 @@ Integrator::Integrator(uint64_t auto_reset_interval, bool coning_compensation) :
 	_last_delta_alpha(0.0f, 0.0f, 0.0f),
 	_coning_comp_on(coning_compensation)
 {
-
 }
 
-Integrator::~Integrator()
-{
-
-}
+Integrator::~Integrator() = default;
 
 bool
 Integrator::put(uint64_t timestamp, matrix::Vector3f &val, matrix::Vector3f &integral, uint64_t &integral_dt)
diff --git a/src/lib/drivers/led/led.cpp b/src/lib/drivers/led/led.cpp
index 41e8488251..f0d928538a 100644
--- a/src/lib/drivers/led/led.cpp
+++ b/src/lib/drivers/led/led.cpp
@@ -72,9 +72,7 @@ LED::LED() : CDev("led", LED0_DEVICE_PATH)
 	init();
 }
 
-LED::~LED()
-{
-}
+LED::~LED() = default;
 
 int
 LED::init()
diff --git a/src/modules/commander/commander_tests/state_machine_helper_test.cpp b/src/modules/commander/commander_tests/state_machine_helper_test.cpp
index 8f13d812c1..b1053afb3f 100644
--- a/src/modules/commander/commander_tests/state_machine_helper_test.cpp
+++ b/src/modules/commander/commander_tests/state_machine_helper_test.cpp
@@ -46,8 +46,8 @@
 class StateMachineHelperTest : public UnitTest
 {
 public:
-	StateMachineHelperTest();
-	virtual ~StateMachineHelperTest();
+	StateMachineHelperTest() = default;
+	virtual ~StateMachineHelperTest() = default;
 
 	virtual bool run_tests();
 
@@ -57,12 +57,6 @@ private:
 	bool isSafeTest();
 };
 
-StateMachineHelperTest::StateMachineHelperTest() {
-}
-
-StateMachineHelperTest::~StateMachineHelperTest() {
-}
-
 bool StateMachineHelperTest::armingStateTransitionTest()
 {
     // These are the critical values from vehicle_status_s and actuator_armed_s which must be primed
diff --git a/src/modules/landing_target_estimator/LandingTargetEstimator.cpp b/src/modules/landing_target_estimator/LandingTargetEstimator.cpp
index 05ecc94f0d..6eb60127eb 100644
--- a/src/modules/landing_target_estimator/LandingTargetEstimator.cpp
+++ b/src/modules/landing_target_estimator/LandingTargetEstimator.cpp
@@ -78,9 +78,7 @@ LandingTargetEstimator::LandingTargetEstimator() :
 	_check_params(true);
 }
 
-LandingTargetEstimator::~LandingTargetEstimator()
-{
-}
+LandingTargetEstimator::~LandingTargetEstimator() = default;
 
 void LandingTargetEstimator::update()
 {
diff --git a/src/modules/mavlink/mavlink_messages.cpp b/src/modules/mavlink/mavlink_messages.cpp
index 60748a76af..b67d27a18d 100644
--- a/src/modules/mavlink/mavlink_messages.cpp
+++ b/src/modules/mavlink/mavlink_messages.cpp
@@ -404,7 +404,7 @@ protected:
 	explicit MavlinkStreamStatustext(Mavlink *mavlink) : MavlinkStream(mavlink)
 	{}
 
-	~MavlinkStreamStatustext() {}
+	~MavlinkStreamStatustext() = default;
 
 
 	bool send(const hrt_abstime t)
diff --git a/src/modules/mavlink/mavlink_rate_limiter.cpp b/src/modules/mavlink/mavlink_rate_limiter.cpp
index d3b3e1cde3..6ca6602919 100644
--- a/src/modules/mavlink/mavlink_rate_limiter.cpp
+++ b/src/modules/mavlink/mavlink_rate_limiter.cpp
@@ -48,9 +48,7 @@ MavlinkRateLimiter::MavlinkRateLimiter(unsigned int interval) : _last_sent(0), _
 {
 }
 
-MavlinkRateLimiter::~MavlinkRateLimiter()
-{
-}
+MavlinkRateLimiter::~MavlinkRateLimiter() = default;
 
 void
 MavlinkRateLimiter::set_interval(unsigned int interval)
diff --git a/src/modules/mavlink/mavlink_shell.cpp b/src/modules/mavlink/mavlink_shell.cpp
index 1b0af87dfb..df4e31a1e9 100644
--- a/src/modules/mavlink/mavlink_shell.cpp
+++ b/src/modules/mavlink/mavlink_shell.cpp
@@ -54,9 +54,7 @@
 #include <asm/socket.h>
 #endif
 
-MavlinkShell::MavlinkShell()
-{
-}
+MavlinkShell::MavlinkShell() = default;
 
 MavlinkShell::~MavlinkShell()
 {
diff --git a/src/modules/mavlink/mavlink_stream.cpp b/src/modules/mavlink/mavlink_stream.cpp
index 34a134e8d8..21d318a542 100644
--- a/src/modules/mavlink/mavlink_stream.cpp
+++ b/src/modules/mavlink/mavlink_stream.cpp
@@ -52,9 +52,7 @@ MavlinkStream::MavlinkStream(Mavlink *mavlink) :
 {
 }
 
-MavlinkStream::~MavlinkStream()
-{
-}
+MavlinkStream::~MavlinkStream() = default;
 
 /**
  * Set messages interval in ms
diff --git a/src/modules/mavlink/mavlink_tests/mavlink_ftp_test.cpp b/src/modules/mavlink/mavlink_tests/mavlink_ftp_test.cpp
index d5ed691af1..3b44b2504f 100644
--- a/src/modules/mavlink/mavlink_tests/mavlink_ftp_test.cpp
+++ b/src/modules/mavlink/mavlink_tests/mavlink_ftp_test.cpp
@@ -65,10 +65,7 @@ MavlinkFtpTest::MavlinkFtpTest() :
 {
 }
 
-MavlinkFtpTest::~MavlinkFtpTest()
-{
-
-}
+MavlinkFtpTest::~MavlinkFtpTest() = default;
 
 /// @brief Called before every test to initialize the FTP Server.
 void MavlinkFtpTest::_init()
diff --git a/src/modules/mc_pos_control/mc_pos_control_tests/mc_pos_control_tests.cpp b/src/modules/mc_pos_control/mc_pos_control_tests/mc_pos_control_tests.cpp
index 38ac05a0e7..7f8999b7da 100644
--- a/src/modules/mc_pos_control/mc_pos_control_tests/mc_pos_control_tests.cpp
+++ b/src/modules/mc_pos_control/mc_pos_control_tests/mc_pos_control_tests.cpp
@@ -58,8 +58,8 @@ public:
 class McPosControlTests : public UnitTest
 {
 public:
-	McPosControlTests();
-	virtual ~McPosControlTests();
+	McPosControlTests() = default;
+	virtual ~McPosControlTests() = default;
 
 	virtual bool run_tests();
 
@@ -67,14 +67,6 @@ private:
 	bool cross_sphere_line_test();
 };
 
-McPosControlTests::McPosControlTests()
-{
-}
-
-McPosControlTests::~McPosControlTests()
-{
-}
-
 bool McPosControlTests::cross_sphere_line_test()
 {
 	MulticopterPositionControl control = MulticopterPositionControl();
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp
index 8f8d36804e..2e72bf7c5b 100644
--- a/src/modules/sensors/sensors.cpp
+++ b/src/modules/sensors/sensors.cpp
@@ -136,8 +136,7 @@ class Sensors : public ModuleBase<Sensors>, public ModuleParams
 {
 public:
 	Sensors(bool hil_enabled);
-
-	~Sensors() {}
+	~Sensors() = default;
 
 	/** @see ModuleBase */
 	static int task_spawn(int argc, char *argv[]);
diff --git a/src/modules/simulator/accelsim/accelsim.cpp b/src/modules/simulator/accelsim/accelsim.cpp
index 736d4c4c4e..1b3101f4ef 100644
--- a/src/modules/simulator/accelsim/accelsim.cpp
+++ b/src/modules/simulator/accelsim/accelsim.cpp
@@ -973,9 +973,7 @@ ACCELSIM_mag::ACCELSIM_mag(ACCELSIM *parent) :
 	m_id.dev_id_s.devtype = DRV_ACC_DEVTYPE_ACCELSIM;
 }
 
-ACCELSIM_mag::~ACCELSIM_mag()
-{
-}
+ACCELSIM_mag::~ACCELSIM_mag() = default;
 
 ssize_t
 ACCELSIM_mag::devRead(void *buffer, size_t buflen)
diff --git a/src/modules/simulator/gyrosim/gyrosim.cpp b/src/modules/simulator/gyrosim/gyrosim.cpp
index a26e41f01c..9cc85e865d 100644
--- a/src/modules/simulator/gyrosim/gyrosim.cpp
+++ b/src/modules/simulator/gyrosim/gyrosim.cpp
@@ -278,7 +278,7 @@ class GYROSIM_gyro  : public VirtDevObj
 {
 public:
 	GYROSIM_gyro(GYROSIM *parent, const char *path);
-	virtual ~GYROSIM_gyro() {}
+	virtual ~GYROSIM_gyro() = default;
 
 	virtual ssize_t		devRead(void *buffer, size_t buflen);
 	virtual int		devIOCTL(unsigned long cmd, unsigned long arg);
diff --git a/src/modules/simulator/ledsim/led.cpp b/src/modules/simulator/ledsim/led.cpp
index c15f5a7567..0fb91421b1 100644
--- a/src/modules/simulator/ledsim/led.cpp
+++ b/src/modules/simulator/ledsim/led.cpp
@@ -63,7 +63,7 @@ class LED : public VirtDevObj
 {
 public:
 	LED();
-	virtual ~LED();
+	virtual ~LED() = default;
 
 	virtual int		init();
 	virtual int		devIOCTL(unsigned long cmd, unsigned long arg);
@@ -79,10 +79,6 @@ LED::LED() :
 	init();
 }
 
-LED::~LED()
-{
-}
-
 int
 LED::init()
 {
diff --git a/src/modules/vtol_att_control/standard.cpp b/src/modules/vtol_att_control/standard.cpp
index e1f6b902b2..7565ce37ef 100644
--- a/src/modules/vtol_att_control/standard.cpp
+++ b/src/modules/vtol_att_control/standard.cpp
@@ -70,9 +70,7 @@ Standard::Standard(VtolAttitudeControl *attc) :
 	_params_handles_standard.reverse_delay = param_find("VT_B_REV_DEL");
 }
 
-Standard::~Standard()
-{
-}
+Standard::~Standard() = default;
 
 void
 Standard::parameters_update()
diff --git a/src/modules/vtol_att_control/tailsitter.cpp b/src/modules/vtol_att_control/tailsitter.cpp
index 4dd9178407..9d92b932dd 100644
--- a/src/modules/vtol_att_control/tailsitter.cpp
+++ b/src/modules/vtol_att_control/tailsitter.cpp
@@ -65,10 +65,7 @@ Tailsitter::Tailsitter(VtolAttitudeControl *attc) :
 	_params_handles_tailsitter.front_trans_dur_p2 = param_find("VT_TRANS_P2_DUR");
 }
 
-Tailsitter::~Tailsitter()
-{
-
-}
+Tailsitter::~Tailsitter() = default;
 
 void
 Tailsitter::parameters_update()
diff --git a/src/modules/vtol_att_control/tiltrotor.cpp b/src/modules/vtol_att_control/tiltrotor.cpp
index 87be8c2439..01695c112c 100644
--- a/src/modules/vtol_att_control/tiltrotor.cpp
+++ b/src/modules/vtol_att_control/tiltrotor.cpp
@@ -65,10 +65,7 @@ Tiltrotor::Tiltrotor(VtolAttitudeControl *attc) :
 	_params_handles_tiltrotor.diff_thrust_scale = param_find("VT_FW_DIFTHR_SC");
 }
 
-Tiltrotor::~Tiltrotor()
-{
-
-}
+Tiltrotor::~Tiltrotor() = default;
 
 void
 Tiltrotor::parameters_update()
diff --git a/src/modules/vtol_att_control/vtol_type.cpp b/src/modules/vtol_att_control/vtol_type.cpp
index 4c8893f35d..803aadbd72 100644
--- a/src/modules/vtol_att_control/vtol_type.cpp
+++ b/src/modules/vtol_att_control/vtol_type.cpp
@@ -76,10 +76,7 @@ VtolType::VtolType(VtolAttitudeControl *att_controller) :
 	}
 }
 
-VtolType::~VtolType()
-{
-
-}
+VtolType::~VtolType() = default;
 
 bool VtolType::init()
 {
diff --git a/src/platforms/posix/tests/vcdev_test/vcdevtest_example.cpp b/src/platforms/posix/tests/vcdev_test/vcdevtest_example.cpp
index ad9e974a6f..cafa7896e3 100644
--- a/src/platforms/posix/tests/vcdev_test/vcdevtest_example.cpp
+++ b/src/platforms/posix/tests/vcdev_test/vcdevtest_example.cpp
@@ -94,7 +94,7 @@ class PrivData
 {
 public:
 	PrivData() : _read_offset(0) {}
-	~PrivData() {}
+	~PrivData() = default;
 
 	size_t _read_offset;
 };
@@ -107,7 +107,7 @@ public:
 		_is_open_for_write(false),
 		_write_offset(0) {}
 
-	~VCDevNode() {}
+	~VCDevNode() = default;
 
 	virtual int open(device::file_t *handlep);
 	virtual int close(device::file_t *handlep);
-- 
GitLab