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

This commit is contained in:
RoboMagus 2022-09-15 01:53:02 +02:00 committed by GitHub
parent aaf50fc2e6
commit 78b55d86e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}
InternalGPIOPin *irq_pin_ = nullptr;
InternalGPIOPin *irq_pin_{nullptr};
bool is_setup_{false};
sensor::Sensor *voltage_sensor_{nullptr};
sensor::Sensor *current_a_sensor_{nullptr};

View File

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

View File

@ -58,9 +58,9 @@ class HydreonRGxxComponent : public PollingComponent, public uart::UARTDevice {
sensor::Sensor *sensors_[NUM_SENSORS] = {nullptr};
#ifdef USE_BINARY_SENSOR
binary_sensor::BinarySensor *too_cold_sensor_ = nullptr;
binary_sensor::BinarySensor *lens_bad_sensor_ = nullptr;
binary_sensor::BinarySensor *em_sat_sensor_ = nullptr;
binary_sensor::BinarySensor *too_cold_sensor_{nullptr};
binary_sensor::BinarySensor *lens_bad_sensor_{nullptr};
binary_sensor::BinarySensor *em_sat_sensor_{nullptr};
#endif
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 filter_;
uint8_t resolutions_[3] = {0};
GPIOPin *drdy_pin_ = nullptr;
GPIOPin *drdy_pin_{nullptr};
};
} // namespace mlx90393

View File

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

View File

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

View File

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

View File

@ -176,7 +176,7 @@ template<typename... Ts> class Action {
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
/// that is currently being executed.

View File

@ -254,7 +254,7 @@ class Component {
uint32_t component_state_{0x0000}; ///< State of this component.
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.

View File

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