Commit 0de1d960 authored by murata's avatar murata

AutoPilotPlugins: Change NULL or 0 to nullptr

parent 35bab343
......@@ -18,7 +18,7 @@ class APMAirframeComponent : public VehicleComponent
Q_OBJECT
public:
APMAirframeComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMAirframeComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const override;
......
......@@ -38,19 +38,19 @@
APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent)
: AutoPilotPlugin (vehicle, parent)
, _incorrectParameterVersion(false)
, _airframeComponent (NULL)
, _cameraComponent (NULL)
, _lightsComponent (NULL)
, _subFrameComponent (NULL)
, _flightModesComponent (NULL)
, _powerComponent (NULL)
, _motorComponent (NULL)
, _radioComponent (NULL)
, _safetyComponent (NULL)
, _sensorsComponent (NULL)
, _tuningComponent (NULL)
, _esp8266Component (NULL)
, _heliComponent (NULL)
, _airframeComponent (nullptr)
, _cameraComponent (nullptr)
, _lightsComponent (nullptr)
, _subFrameComponent (nullptr)
, _flightModesComponent (nullptr)
, _powerComponent (nullptr)
, _motorComponent (nullptr)
, _radioComponent (nullptr)
, _safetyComponent (nullptr)
, _sensorsComponent (nullptr)
, _tuningComponent (nullptr)
, _esp8266Component (nullptr)
, _heliComponent (nullptr)
{
#if !defined(NO_SERIAL_LINK) && !defined(__android__)
connect(vehicle->parameterManager(), &ParameterManager::parametersReadyChanged, this, &APMAutoPilotPlugin::_checkForBadCubeBlack);
......
......@@ -18,7 +18,7 @@ class APMCameraComponent : public VehicleComponent
Q_OBJECT
public:
APMCameraComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMCameraComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const final;
......
......@@ -73,9 +73,9 @@ CalWorkerThread::calibrate_return CalWorkerThread::calibrate(void)
for (size_t cur_mag=0; cur_mag<max_mags; cur_mag++) {
// Initialize to no memory allocated
worker_data.x[cur_mag] = NULL;
worker_data.y[cur_mag] = NULL;
worker_data.z[cur_mag] = NULL;
worker_data.x[cur_mag] = nullptr;
worker_data.y[cur_mag] = nullptr;
worker_data.z[cur_mag] = nullptr;
worker_data.calibration_counter_total[cur_mag] = 0;
}
......@@ -86,7 +86,7 @@ CalWorkerThread::calibrate_return CalWorkerThread::calibrate(void)
worker_data.x[cur_mag] = reinterpret_cast<float *>(malloc(sizeof(float) * calibration_points_maxcount));
worker_data.y[cur_mag] = reinterpret_cast<float *>(malloc(sizeof(float) * calibration_points_maxcount));
worker_data.z[cur_mag] = reinterpret_cast<float *>(malloc(sizeof(float) * calibration_points_maxcount));
if (worker_data.x[cur_mag] == NULL || worker_data.y[cur_mag] == NULL || worker_data.z[cur_mag] == NULL) {
if (worker_data.x[cur_mag] == nullptr || worker_data.y[cur_mag] == nullptr || worker_data.z[cur_mag] == nullptr) {
_emitVehicleTextMessage(QStringLiteral("[cal] ERROR: out of memory"));
result = calibrate_return_error;
}
......@@ -576,8 +576,8 @@ int CalWorkerThread::sphere_fit_least_squares(const float x[], const float y[],
}
APMCompassCal::APMCompassCal(void)
: _vehicle(NULL)
, _calWorkerThread(NULL)
: _vehicle(nullptr)
, _calWorkerThread(nullptr)
{
}
......
......@@ -26,7 +26,7 @@ class CalWorkerThread : public QThread
Q_OBJECT
public:
CalWorkerThread(Vehicle* vehicle, QObject* parent = NULL);
CalWorkerThread(Vehicle* vehicle, QObject* parent = nullptr);
// Cancel currently in progress calibration
void cancel(void) { _cancel = true; }
......
......@@ -18,7 +18,7 @@ class APMFlightModesComponent : public VehicleComponent
Q_OBJECT
public:
APMFlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMFlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const final;
......
......@@ -16,7 +16,7 @@ class APMHeliComponent : public VehicleComponent
Q_OBJECT
public:
APMHeliComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMHeliComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const override;
......
......@@ -18,7 +18,7 @@ class APMLightsComponent : public VehicleComponent
Q_OBJECT
public:
APMLightsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMLightsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const final;
......
......@@ -18,7 +18,7 @@ class APMMotorComponent : public MotorComponent
Q_OBJECT
public:
APMMotorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMMotorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
QUrl setupSource(void) const final;
......
......@@ -18,7 +18,7 @@ class APMPowerComponent : public VehicleComponent
Q_OBJECT
public:
APMPowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMPowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Overrides from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const override { return QStringList(); }
......
......@@ -19,7 +19,7 @@ class APMRadioComponent : public VehicleComponent
Q_OBJECT
public:
APMRadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMRadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const final;
......
......@@ -18,7 +18,7 @@ class APMSafetyComponent : public VehicleComponent
Q_OBJECT
public:
APMSafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMSafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const override;
......
......@@ -18,7 +18,7 @@ class APMSensorsComponent : public VehicleComponent
Q_OBJECT
public:
APMSensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMSensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
bool compassSetupNeeded(void) const;
bool accelSetupNeeded(void) const;
......
......@@ -24,11 +24,11 @@ QGC_LOGGING_CATEGORY(APMSensorsComponentControllerVerboseLog, "APMSensorsCompone
const char* APMSensorsComponentController::_compassCalFitnessParam = "COMPASS_CAL_FIT";
APMSensorsComponentController::APMSensorsComponentController(void)
: _sensorsComponent(NULL)
, _statusLog(NULL)
, _progressBar(NULL)
, _nextButton(NULL)
, _cancelButton(NULL)
: _sensorsComponent(nullptr)
, _statusLog(nullptr)
, _progressBar(nullptr)
, _nextButton(nullptr)
, _cancelButton(nullptr)
, _showOrientationCalArea(false)
, _calTypeInProgress(CalTypeNone)
, _orientationCalDownSideDone(false)
......
......@@ -18,7 +18,7 @@ class APMSubFrameComponent : public VehicleComponent
Q_OBJECT
public:
APMSubFrameComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMSubFrameComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const final;
......
......@@ -59,7 +59,7 @@ signals:
protected:
/// All access to AutoPilotPugin objects is through getInstanceForAutoPilotPlugin
AutoPilotPlugin(QObject* parent = NULL) : QObject(parent) { }
AutoPilotPlugin(QObject* parent = nullptr) : QObject(parent) { }
Vehicle* _vehicle;
FirmwarePlugin* _firmwarePlugin;
......
......@@ -17,7 +17,7 @@ class ESP8266Component : public VehicleComponent
{
Q_OBJECT
public:
ESP8266Component (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
ESP8266Component (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList() const;
......
......@@ -19,7 +19,7 @@ class MotorComponent : public VehicleComponent
Q_OBJECT
public:
MotorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
MotorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const final;
......
......@@ -17,7 +17,7 @@ class SyslinkComponent : public VehicleComponent
{
Q_OBJECT
public:
SyslinkComponent (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
SyslinkComponent (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList() const;
......
......@@ -23,7 +23,7 @@ class GenericAutoPilotPlugin : public AutoPilotPlugin
Q_OBJECT
public:
GenericAutoPilotPlugin(Vehicle* vehicle, QObject* parent = NULL);
GenericAutoPilotPlugin(Vehicle* vehicle, QObject* parent = nullptr);
// Overrides from AutoPilotPlugin
const QVariantList& vehicleComponents(void) final;
......
......@@ -22,7 +22,7 @@ class AirframeComponent : public VehicleComponent
Q_OBJECT
public:
AirframeComponent(Vehicle* vehicles, AutoPilotPlugin* autopilot, QObject* parent = NULL);
AirframeComponent(Vehicle* vehicles, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -71,7 +71,7 @@ class Airframe : public QObject
Q_OBJECT
public:
Airframe(const QString& name, int autostartId, QObject* parent = NULL);
Airframe(const QString& name, int autostartId, QObject* parent = nullptr);
~Airframe();
Q_PROPERTY(QString text MEMBER _name CONSTANT)
......@@ -87,7 +87,7 @@ class AirframeType : public QObject
Q_OBJECT
public:
AirframeType(const QString& name, const QString& imageResource, QObject* parent = NULL);
AirframeType(const QString& name, const QString& imageResource, QObject* parent = nullptr);
~AirframeType();
Q_PROPERTY(QString name MEMBER _name CONSTANT)
......
......@@ -23,7 +23,7 @@ class CameraComponent : public VehicleComponent
Q_OBJECT
public:
CameraComponent (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
CameraComponent (Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList (void) const;
......
......@@ -22,7 +22,7 @@ class FlightModesComponent : public VehicleComponent
Q_OBJECT
public:
FlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
FlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -34,7 +34,7 @@ class PX4AirframeLoader : QObject
public:
/// @param uas Uas which this set of facts is associated with
PX4AirframeLoader(AutoPilotPlugin* autpilot,UASInterface* uas, QObject* parent = NULL);
PX4AirframeLoader(AutoPilotPlugin* autpilot,UASInterface* uas, QObject* parent = nullptr);
static void loadAirframeMetaData(void);
......
......@@ -30,16 +30,16 @@
PX4AutoPilotPlugin::PX4AutoPilotPlugin(Vehicle* vehicle, QObject* parent)
: AutoPilotPlugin(vehicle, parent)
, _incorrectParameterVersion(false)
, _airframeComponent(NULL)
, _radioComponent(NULL)
, _esp8266Component(NULL)
, _flightModesComponent(NULL)
, _sensorsComponent(NULL)
, _safetyComponent(NULL)
, _powerComponent(NULL)
, _motorComponent(NULL)
, _tuningComponent(NULL)
, _syslinkComponent(NULL)
, _airframeComponent(nullptr)
, _radioComponent(nullptr)
, _esp8266Component(nullptr)
, _flightModesComponent(nullptr)
, _sensorsComponent(nullptr)
, _safetyComponent(nullptr)
, _powerComponent(nullptr)
, _motorComponent(nullptr)
, _tuningComponent(nullptr)
, _syslinkComponent(nullptr)
{
if (!vehicle) {
qWarning() << "Internal error";
......
......@@ -18,7 +18,7 @@ class PX4RadioComponent : public VehicleComponent
Q_OBJECT
public:
PX4RadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
PX4RadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -18,7 +18,7 @@ class PX4TuningComponent : public VehicleComponent
Q_OBJECT
public:
PX4TuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
PX4TuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const final;
......
......@@ -22,7 +22,7 @@ class PowerComponent : public VehicleComponent
Q_OBJECT
public:
PowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
PowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Overrides from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const override;
......
......@@ -23,7 +23,7 @@ class SafetyComponent : public VehicleComponent
Q_OBJECT
public:
SafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
SafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const override;
......
......@@ -22,7 +22,7 @@ class SensorsComponent : public VehicleComponent
Q_OBJECT
public:
SensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
SensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const override;
......
......@@ -19,15 +19,15 @@
QGC_LOGGING_CATEGORY(SensorsComponentControllerLog, "SensorsComponentControllerLog")
SensorsComponentController::SensorsComponentController(void)
: _statusLog (NULL)
, _progressBar (NULL)
, _compassButton (NULL)
, _gyroButton (NULL)
, _accelButton (NULL)
, _airspeedButton (NULL)
, _levelButton (NULL)
, _cancelButton (NULL)
, _setOrientationsButton (NULL)
: _statusLog (nullptr)
, _progressBar (nullptr)
, _compassButton (nullptr)
, _gyroButton (nullptr)
, _accelButton (nullptr)
, _airspeedButton (nullptr)
, _levelButton (nullptr)
, _cancelButton (nullptr)
, _setOrientationsButton (nullptr)
, _showOrientationCalArea (false)
, _gyroCalInProgress (false)
, _magCalInProgress (false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment