clang-tidy: partially fix modernize-use-equals-default

This commit is contained in:
Daniel Agar
2019-10-27 17:54:24 -04:00
parent 967446af4c
commit 380cae18d1
32 changed files with 31 additions and 40 deletions

View File

@@ -79,7 +79,6 @@ Checks: '*,
-modernize-use-auto,
-modernize-use-bool-literals,
-modernize-use-default-member-init,
-modernize-use-emplace,
-modernize-use-equals-default,
-modernize-use-equals-delete,
-modernize-use-override,

View File

@@ -50,7 +50,7 @@ class VFile : public CDev
public:
static VFile *createFile(const char *fname, mode_t mode);
~VFile() {}
~VFile() = default;
ssize_t write(file_t *handlep, const char *buffer, size_t buflen) override;

View File

@@ -66,7 +66,7 @@ public:
_index(0),
_delay(-1)
{}
virtual ~BlockDelay() {}
virtual ~BlockDelay() = default;
matrix::Matrix<Type, M, N> update(const matrix::Matrix<Type, M, N> &u)
{
// store current value

View File

@@ -68,7 +68,7 @@ public:
_initialized(false),
_lowPass(this, "LP")
{}
virtual ~BlockDerivative() {}
virtual ~BlockDerivative() = default;
/**
* Update the state and get current derivative

View File

@@ -69,7 +69,7 @@ public:
_y(0),
_fCut(this, "") // only one parameter, no need to name
{}
virtual ~BlockHighPass() {}
virtual ~BlockHighPass() = default;
float update(float input);
// accessors
float getU() {return _u;}

View File

@@ -64,7 +64,7 @@ public:
SuperBlock(parent, name),
_y(0),
_limit(this, "") {}
virtual ~BlockIntegral() {}
virtual ~BlockIntegral() = default;
float update(float input);
// accessors
float getY() {return _y;}

View File

@@ -72,7 +72,7 @@ public:
_u(0),
_y(0),
_limit(this, "") {}
virtual ~BlockIntegralTrap() {}
virtual ~BlockIntegralTrap() = default;
float update(float input);
// accessors
float getU() {return _u;}

View File

@@ -69,7 +69,7 @@ public:
_min(this, "MIN"),
_max(this, "MAX")
{}
virtual ~BlockLimit() {}
virtual ~BlockLimit() = default;
float update(float input);
// accessors
float getMin() { return _min.get(); }

View File

@@ -68,7 +68,7 @@ public:
Block(parent, name),
_max(this, "MAX")
{}
virtual ~BlockLimitSym() {}
virtual ~BlockLimitSym() = default;
float update(float input);
// accessors
float getMax() { return _max.get(); }

View File

@@ -69,7 +69,7 @@ public:
_state(NAN /* initialize to invalid val, force into is_finite() check on first call */),
_fCut(this, "") // only one parameter, no need to name
{}
virtual ~BlockLowPass() {}
virtual ~BlockLowPass() = default;
float update(float input);
// accessors
float getState() { return _state; }

View File

@@ -69,7 +69,7 @@ public:
_fs(sample_freq),
_lp(_fs, _fCut.get())
{}
virtual ~BlockLowPass2() {}
virtual ~BlockLowPass2() = default;
float update(float input);
// accessors
float getState() { return _state; }

View File

@@ -70,7 +70,7 @@ public:
_state(i) = 0.0f / 0.0f;
}
}
virtual ~BlockLowPassVector() {}
virtual ~BlockLowPassVector() = default;
matrix::Vector<Type, M> update(const matrix::Matrix<Type, M, 1> &input)
{
for (size_t i = 0; i < M; i++) {

View File

@@ -70,7 +70,7 @@ public:
update(0);
}
virtual ~BlockOutput() {}
virtual ~BlockOutput() = default;
void update(float input)
{
_val = _limit.update(input + getTrim());

View File

@@ -67,7 +67,7 @@ public:
Block(parent, name),
_kP(this, "") // only one param, no need to name
{}
virtual ~BlockP() {}
virtual ~BlockP() = default;
float update(float input)
{
return getKP() * input;

View File

@@ -69,7 +69,7 @@ public:
_kP(this, "P"),
_kD(this, "D")
{}
virtual ~BlockPD() {}
virtual ~BlockPD() = default;
float update(float input)
{
return getKP() * input +

View File

@@ -69,7 +69,7 @@ public:
_kP(this, "P"),
_kI(this, "I")
{}
virtual ~BlockPI() {}
virtual ~BlockPI() = default;
float update(float input)
{
return getKP() * input +

View File

@@ -71,7 +71,7 @@ public:
_kI(this, "I"),
_kD(this, "D")
{}
virtual ~BlockPID() {}
virtual ~BlockPID() = default;
float update(float input)
{
return getKP() * input +

View File

@@ -69,7 +69,7 @@ public:
// in main program for all calls to rand
// XXX currently in nuttx if you seed to 0, rand breaks
}
virtual ~BlockRandGauss() {}
virtual ~BlockRandGauss() = default;
float update()
{
static float V1, V2, S;

View File

@@ -72,7 +72,7 @@ public:
// in main program for all calls to rand
// XXX currently in nuttx if you seed to 0, rand breaks
}
virtual ~BlockRandUniform() {}
virtual ~BlockRandUniform() = default;
float update()
{
static float rand_max = RAND_MAX;

View File

@@ -67,7 +67,7 @@ public:
_sumSq(),
_count(0)
{}
virtual ~BlockStats() {}
virtual ~BlockStats() = default;
void update(const matrix::Vector<Type, M> &u)
{
_sum += u;

View File

@@ -50,10 +50,6 @@ SMBus::SMBus(int bus_num, uint16_t address) :
{
}
SMBus::~SMBus()
{
}
int SMBus::read_word(const uint8_t cmd_code, void *data)
{
// 2 data bytes + pec byte
@@ -177,4 +173,4 @@ uint8_t SMBus::get_pec(uint8_t *buff, const uint8_t len)
}
return crc;
}
}

View File

@@ -48,7 +48,7 @@ class SMBus : public device::I2C
{
public:
SMBus(int bus_num, uint16_t address);
~SMBus();
~SMBus() override = default;
/**
* @brief Sends a block write command.

View File

@@ -192,7 +192,7 @@ public:
* @param control_cb Callback invoked when reading controls.
*/
Mixer(ControlCallback control_cb, uintptr_t cb_handle);
virtual ~Mixer() {}
virtual ~Mixer() = default;
/**
* Perform the mixing function.
@@ -471,7 +471,7 @@ class NullMixer : public Mixer
{
public:
NullMixer();
~NullMixer() {}
~NullMixer() = default;
/**
* Factory method.

View File

@@ -48,7 +48,7 @@ TerrainEstimator::TerrainEstimator() :
_time_last_distance(0),
_time_last_gps(0)
{
memset(&_x._data[0], 0, sizeof(_x._data));
_x.zero();
_u_z = 0.0f;
_P.setIdentity();
}

View File

@@ -60,7 +60,7 @@ class __EXPORT TerrainEstimator
{
public:
TerrainEstimator();
~TerrainEstimator() {}
~TerrainEstimator() = default;
bool is_valid() {return _terrain_valid;}
float get_distance_to_ground() {return -_x(0);}

View File

@@ -56,6 +56,7 @@ class FixedwingLandDetector final : public LandDetector
{
public:
FixedwingLandDetector();
~FixedwingLandDetector() override = default;
protected:

View File

@@ -60,6 +60,7 @@ class MulticopterLandDetector : public LandDetector
{
public:
MulticopterLandDetector();
~MulticopterLandDetector() override = default;
protected:
void _update_params() override;

View File

@@ -50,6 +50,7 @@ class RoverLandDetector : public LandDetector
{
public:
RoverLandDetector() = default;
~RoverLandDetector() override = default;
protected:
bool _get_ground_contact_state() override;

View File

@@ -46,10 +46,6 @@
namespace land_detector
{
VtolLandDetector::VtolLandDetector()
{
}
void VtolLandDetector::_update_topics()
{
MulticopterLandDetector::_update_topics();

View File

@@ -52,7 +52,8 @@ namespace land_detector
class VtolLandDetector : public MulticopterLandDetector
{
public:
VtolLandDetector();
VtolLandDetector() = default;
~VtolLandDetector() override = default;
protected:
void _update_topics() override;

View File

@@ -66,10 +66,6 @@ MavlinkULog::MavlinkULog(int datarate, float max_rate_factor, uint8_t target_sys
_next_rate_check = _last_sent_time + _rate_calculation_delta_t * 1.e6f;
}
MavlinkULog::~MavlinkULog()
{
}
void MavlinkULog::start_ack_received()
{
if (_waiting_for_initial_ack) {

View File

@@ -102,7 +102,7 @@ private:
MavlinkULog(int datarate, float max_rate_factor, uint8_t target_system, uint8_t target_component);
~MavlinkULog();
~MavlinkULog() = default;
static void lock()
{