mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
std::shared_ptr doesn't need to be initialized with nullptr. The C++ standard already guarantees it will behave as if it is.
Change-Id: I160567e9fb2857f8d7ac4acbe093c4100a7421eb
This commit is contained in:
@@ -55,5 +55,5 @@ class AnalogAccelerometer : public SensorBase,
|
||||
float m_zeroGVoltage = 2.5;
|
||||
bool m_allocatedChannel;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -82,5 +82,5 @@ class AnalogInput : public SensorBase,
|
||||
void *m_port;
|
||||
int64_t m_accumulatorOffset;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -34,5 +34,5 @@ class AnalogOutput : public SensorBase, public LiveWindowSendable {
|
||||
uint32_t m_channel;
|
||||
void *m_port;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -37,5 +37,5 @@ class BuiltInAccelerometer : public Accelerometer,
|
||||
virtual void StopLiveWindowMode() override {}
|
||||
|
||||
private:
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -242,7 +242,7 @@ class CANJaguar : public MotorSafety,
|
||||
void InitTable(std::shared_ptr<ITable> subTable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
|
||||
private:
|
||||
void InitCANJaguar();
|
||||
|
||||
@@ -59,7 +59,7 @@ class Compressor : public SensorBase,
|
||||
private:
|
||||
void SetCompressor(bool on);
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
#endif /* Compressor_H_ */
|
||||
|
||||
@@ -118,5 +118,5 @@ class Counter : public SensorBase,
|
||||
private:
|
||||
uint32_t m_index = 0; ///< The index of this counter.
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -43,5 +43,5 @@ class DigitalInput : public DigitalSource, public LiveWindowSendable {
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -51,5 +51,5 @@ class DigitalOutput : public DigitalSource,
|
||||
uint32_t m_channel;
|
||||
void *m_pwmGenerator;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -49,5 +49,5 @@ class DoubleSolenoid : public SolenoidBase,
|
||||
uint8_t m_forwardMask; ///< The mask for the forward channel.
|
||||
uint8_t m_reverseMask; ///< The mask for the reverse channel.
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -115,5 +115,5 @@ class Encoder : public SensorBase,
|
||||
EncodingType m_encodingType; // Encoding type
|
||||
int32_t m_encodingScale; // 1x, 2x, or 4x, per the encodingType
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -108,7 +108,7 @@ class PWM : public SensorBase,
|
||||
void InitTable(std::shared_ptr<ITable> subTable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
|
||||
@@ -41,7 +41,7 @@ class PowerDistributionPanel : public SensorBase, public LiveWindowSendable {
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
uint8_t m_module;
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class Relay : public MotorSafety,
|
||||
void InitTable(std::shared_ptr<ITable> subTable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
|
||||
@@ -114,10 +114,10 @@ class RobotDrive : public MotorSafety, public ErrorBase {
|
||||
static const int32_t kMaxNumberOfMotors = 4;
|
||||
float m_sensitivity = 0.5;
|
||||
double m_maxOutput = 1.0;
|
||||
std::shared_ptr<SpeedController> m_frontLeftMotor = nullptr;
|
||||
std::shared_ptr<SpeedController> m_frontRightMotor = nullptr;
|
||||
std::shared_ptr<SpeedController> m_rearLeftMotor = nullptr;
|
||||
std::shared_ptr<SpeedController> m_rearRightMotor = nullptr;
|
||||
std::shared_ptr<SpeedController> m_frontLeftMotor;
|
||||
std::shared_ptr<SpeedController> m_frontRightMotor;
|
||||
std::shared_ptr<SpeedController> m_rearLeftMotor;
|
||||
std::shared_ptr<SpeedController> m_rearRightMotor;
|
||||
std::unique_ptr<MotorSafetyHelper> m_safetyHelper;
|
||||
uint8_t m_syncGroup = 0;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class Servo : public SafePWM {
|
||||
void InitTable(std::shared_ptr<ITable> subTable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
|
||||
private:
|
||||
float GetServoAngleRange() const { return kMaxServoAngle - kMinServoAngle; }
|
||||
|
||||
@@ -41,5 +41,5 @@ class Solenoid : public SolenoidBase,
|
||||
|
||||
private:
|
||||
uint32_t m_channel; ///< The channel on the module to control.
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -107,5 +107,5 @@ class Ultrasonic : public SensorBase,
|
||||
Ultrasonic *m_nextSensor;
|
||||
DistanceUnit m_units;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ class Trigger : public Sendable {
|
||||
virtual std::string GetSmartDashboardType() const;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -184,7 +184,7 @@ class Command : public ErrorBase, public NamedSendable, public ITableListener {
|
||||
std::shared_ptr<nt::Value> value, bool isNew);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -64,7 +64,7 @@ class Scheduler : public ErrorBase, public NamedSendable {
|
||||
std::vector<std::string> commands;
|
||||
std::vector<double> ids;
|
||||
std::vector<double> toCancel;
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
bool m_runningCommandsChanged = false;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,7 @@ class Subsystem : public ErrorBase, public NamedSendable {
|
||||
virtual std::string GetSmartDashboardType() const;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Base.h"
|
||||
|
||||
std::shared_ptr<RobotStateInterface> RobotState::impl = nullptr;
|
||||
std::shared_ptr<RobotStateInterface> RobotState::impl;
|
||||
|
||||
void RobotState::SetImplementation(RobotStateInterface& i) {
|
||||
impl = std::shared_ptr<RobotStateInterface>(
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "networktables/NetworkTable.h"
|
||||
#include "HLUsageReporting.h"
|
||||
|
||||
std::shared_ptr<ITable> SmartDashboard::m_table = nullptr;
|
||||
std::shared_ptr<ITable> SmartDashboard::m_table;
|
||||
std::map<std::shared_ptr<ITable> , Sendable *> SmartDashboard::m_tablesToData;
|
||||
|
||||
void SmartDashboard::init() {
|
||||
|
||||
@@ -51,5 +51,5 @@ private:
|
||||
SimFloatInput* m_impl;
|
||||
int64_t m_accumulatorOffset;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -36,5 +36,5 @@ private:
|
||||
bool m_lastValue;
|
||||
SimDigitalInput *m_impl;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -56,5 +56,5 @@ private:
|
||||
|
||||
SimGyro* impl;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
};
|
||||
|
||||
@@ -96,7 +96,7 @@ protected:
|
||||
void InitTable(std::shared_ptr<ITable> subTable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
void InitTable(std::shared_ptr<ITable> subTable) override;
|
||||
std::shared_ptr<ITable> GetTable() const override;
|
||||
|
||||
std::shared_ptr<ITable> m_table = nullptr;
|
||||
std::shared_ptr<ITable> m_table;
|
||||
|
||||
private:
|
||||
uint32_t m_channel;
|
||||
|
||||
Reference in New Issue
Block a user