Fixed current and potential bugs caught by Coverity

Change-Id: I9f9d09dc797ffea062eeb49c881be1d5acb63d7b
This commit is contained in:
Tyler Veness
2015-11-15 14:49:50 -08:00
committed by Peter Johnson
parent b0fec4089b
commit 055ee09825
34 changed files with 105 additions and 65 deletions

View File

@@ -22,7 +22,7 @@ class CommandGroupEntry {
CommandGroupEntry(Command *command, Sequence state, double timeout = -1.0);
bool IsTimedOut() const;
double m_timeout;
double m_timeout = -1.0;
Command *m_command = nullptr;
Sequence m_state = kSequence_InSequence;
};

View File

@@ -11,7 +11,7 @@
struct LiveWindowComponent {
std::string subsystem;
std::string name;
bool isSensor;
bool isSensor = false;
LiveWindowComponent() = default;
LiveWindowComponent(std::string subsystem, std::string name, bool isSensor) {

View File

@@ -93,7 +93,6 @@ class PIDController : public LiveWindowSendable,
float m_minimumInput = 0; // minimum input - limit setpoint to this
bool m_continuous = false; // do the endpoints wrap around? eg. Absolute encoder
bool m_enabled = false; // is the pid controller enabled
bool m_destruct; // should the calculate thread stop running
float m_prevInput = 0; // the prior sensor input (used to compute velocity)
double m_totalError = 0; // the sum of the errors for use in the integral calc
enum {
@@ -105,7 +104,7 @@ class PIDController : public LiveWindowSendable,
// the percetage or absolute error that is considered on target.
float m_tolerance = 0.05;
float m_setpoint = 0;
float m_error;
float m_error = 0;
float m_result = 0;
float m_period;

View File

@@ -56,5 +56,5 @@ class SensorBase : public ErrorBase {
private:
static SensorBase* m_singletonList;
SensorBase* m_nextSingleton;
SensorBase* m_nextSingleton = nullptr;
};