Unify 'nullptr' initalization of class members; (#3805)

This commit is contained in:
RoboMagus 2022-09-15 01:53:02 +02:00 committed by Jesse Hills
parent cea7deab91
commit 6b23b7cad7
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A
10 changed files with 16 additions and 16 deletions

View file

@ -82,7 +82,7 @@ class ADE7953 : public i2c::I2CDevice, public PollingComponent {
return i2c::ERROR_OK; return i2c::ERROR_OK;
} }
InternalGPIOPin *irq_pin_ = nullptr; InternalGPIOPin *irq_pin_{nullptr};
bool is_setup_{false}; bool is_setup_{false};
sensor::Sensor *voltage_sensor_{nullptr}; sensor::Sensor *voltage_sensor_{nullptr};
sensor::Sensor *current_a_sensor_{nullptr}; sensor::Sensor *current_a_sensor_{nullptr};

View file

@ -116,9 +116,9 @@ class APINoiseFrameHelper : public APIFrameHelper {
std::vector<uint8_t> prologue_; std::vector<uint8_t> prologue_;
std::shared_ptr<APINoiseContext> ctx_; std::shared_ptr<APINoiseContext> ctx_;
NoiseHandshakeState *handshake_ = nullptr; NoiseHandshakeState *handshake_{nullptr};
NoiseCipherState *send_cipher_ = nullptr; NoiseCipherState *send_cipher_{nullptr};
NoiseCipherState *recv_cipher_ = nullptr; NoiseCipherState *recv_cipher_{nullptr};
NoiseProtocolId nid_; NoiseProtocolId nid_;
enum class State { enum class State {

View file

@ -58,9 +58,9 @@ class HydreonRGxxComponent : public PollingComponent, public uart::UARTDevice {
sensor::Sensor *sensors_[NUM_SENSORS] = {nullptr}; sensor::Sensor *sensors_[NUM_SENSORS] = {nullptr};
#ifdef USE_BINARY_SENSOR #ifdef USE_BINARY_SENSOR
binary_sensor::BinarySensor *too_cold_sensor_ = nullptr; binary_sensor::BinarySensor *too_cold_sensor_{nullptr};
binary_sensor::BinarySensor *lens_bad_sensor_ = nullptr; binary_sensor::BinarySensor *lens_bad_sensor_{nullptr};
binary_sensor::BinarySensor *em_sat_sensor_ = nullptr; binary_sensor::BinarySensor *em_sat_sensor_{nullptr};
#endif #endif
int16_t boot_count_ = 0; int16_t boot_count_ = 0;

View file

@ -52,7 +52,7 @@ class MLX90393Cls : public PollingComponent, public i2c::I2CDevice, public MLX90
uint8_t temperature_oversampling_ = 0; uint8_t temperature_oversampling_ = 0;
uint8_t filter_; uint8_t filter_;
uint8_t resolutions_[3] = {0}; uint8_t resolutions_[3] = {0};
GPIOPin *drdy_pin_ = nullptr; GPIOPin *drdy_pin_{nullptr};
}; };
} // namespace mlx90393 } // namespace mlx90393

View file

@ -59,8 +59,8 @@ class PIDClimate : public climate::Climate, public Component {
/// The sensor used for getting the current temperature /// The sensor used for getting the current temperature
sensor::Sensor *sensor_; sensor::Sensor *sensor_;
output::FloatOutput *cool_output_ = nullptr; output::FloatOutput *cool_output_{nullptr};
output::FloatOutput *heat_output_ = nullptr; output::FloatOutput *heat_output_{nullptr};
PIDController controller_; PIDController controller_;
/// Output value as reported by the PID controller, for PIDClimateSensor /// Output value as reported by the PID controller, for PIDClimateSensor
float output_value_; float output_value_;

View file

@ -31,11 +31,11 @@ class PulseMeterSensor : public sensor::Sensor, public Component {
protected: protected:
static void gpio_intr(PulseMeterSensor *sensor); static void gpio_intr(PulseMeterSensor *sensor);
InternalGPIOPin *pin_ = nullptr; InternalGPIOPin *pin_{nullptr};
ISRInternalGPIOPin isr_pin_; ISRInternalGPIOPin isr_pin_;
uint32_t filter_us_ = 0; uint32_t filter_us_ = 0;
uint32_t timeout_us_ = 1000000UL * 60UL * 5UL; uint32_t timeout_us_ = 1000000UL * 60UL * 5UL;
sensor::Sensor *total_sensor_ = nullptr; sensor::Sensor *total_sensor_{nullptr};
InternalFilterMode filter_mode_{FILTER_EDGE}; InternalFilterMode filter_mode_{FILTER_EDGE};
Deduplicator<uint32_t> pulse_width_dedupe_; Deduplicator<uint32_t> pulse_width_dedupe_;

View file

@ -114,7 +114,7 @@ class PVVXDisplay : public ble_client::BLEClientNode, public PollingComponent {
void delayed_disconnect_(); void delayed_disconnect_();
#ifdef USE_TIME #ifdef USE_TIME
void sync_time_(); void sync_time_();
time::RealTimeClock *time_ = nullptr; time::RealTimeClock *time_{nullptr};
#endif #endif
uint16_t char_handle_ = 0; uint16_t char_handle_ = 0;
bool connection_established_ = false; bool connection_established_ = false;

View file

@ -176,7 +176,7 @@ template<typename... Ts> class Action {
return this->next_->is_running(); return this->next_->is_running();
} }
Action<Ts...> *next_ = nullptr; Action<Ts...> *next_{nullptr};
/// The number of instances of this sequence in the list of actions /// The number of instances of this sequence in the list of actions
/// that is currently being executed. /// that is currently being executed.

View file

@ -254,7 +254,7 @@ class Component {
uint32_t component_state_{0x0000}; ///< State of this component. uint32_t component_state_{0x0000}; ///< State of this component.
float setup_priority_override_{NAN}; float setup_priority_override_{NAN};
const char *component_source_ = nullptr; const char *component_source_{nullptr};
}; };
/** This class simplifies creating components that periodically check a state. /** This class simplifies creating components that periodically check a state.

View file

@ -73,7 +73,7 @@ class ISRInternalGPIOPin {
void pin_mode(gpio::Flags flags); void pin_mode(gpio::Flags flags);
protected: protected:
void *arg_ = nullptr; void *arg_{nullptr};
}; };
class InternalGPIOPin : public GPIOPin { class InternalGPIOPin : public GPIOPin {