Skip to content

Commit

Permalink
Further cleanup of uninitialised arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
hemmer committed Apr 26, 2022
1 parent 6ce2443 commit cb9427f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion peaks/drums/high_hat.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class HighHat {
Svf vca_coloration_;
Excitation vca_envelope_;

uint32_t phase_[6];
uint32_t phase_[6] = {};

DISALLOW_COPY_AND_ASSIGN(HighHat);
};
Expand Down
2 changes: 1 addition & 1 deletion peaks/modulations/mini_sequencer.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MiniSequencer {
private:
uint8_t num_steps_;
uint8_t step_;
int16_t steps_[kMaxNumSteps];
int16_t steps_[kMaxNumSteps] = {};

bool reset_at_next_clock_;

Expand Down
2 changes: 1 addition & 1 deletion peaks/processors.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Processors {

ControlMode control_mode_;
ProcessorFunction function_;
uint16_t parameter_[4];
uint16_t parameter_[4] = {};

ProcessorCallbacks callbacks_;
static const ProcessorCallbacks callbacks_table_[PROCESSOR_FUNCTION_LAST];
Expand Down
2 changes: 1 addition & 1 deletion peaks/pulse_processor/pulse_randomizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class PulseRandomizer {
uint16_t num_pulses_;
uint16_t retrig_counter_;

uint16_t delay_counter_[kTriggerPulseBufferSize];
uint16_t delay_counter_[kTriggerPulseBufferSize] = {};

DISALLOW_COPY_AND_ASSIGN(PulseRandomizer);
};
Expand Down
2 changes: 1 addition & 1 deletion peaks/pulse_processor/pulse_shaper.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class PulseShaper {
uint16_t previous_num_pulses_;
uint16_t retrig_counter_;

Pulse pulse_buffer_[kPulseBufferSize];
Pulse pulse_buffer_[kPulseBufferSize] = {};

DISALLOW_COPY_AND_ASSIGN(PulseShaper);
};
Expand Down
18 changes: 9 additions & 9 deletions peaks/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ class Ui {
void SetFunction(uint8_t index, Function f);
void SaveState();

int32_t adc_lp_[kNumAdcChannels];
int32_t adc_value_[kNumAdcChannels];
int32_t adc_threshold_[kNumAdcChannels];
uint32_t press_time_[kNumSwitches];
bool panel_gate_control_[2];
int32_t adc_lp_[kNumAdcChannels] = {};
int32_t adc_value_[kNumAdcChannels] = {};
int32_t adc_threshold_[kNumAdcChannels] = {};
uint32_t press_time_[kNumSwitches] = {};
bool panel_gate_control_[2] = {};
static const ProcessorFunction function_table_[FUNCTION_LAST][2];

stmlib::EventQueue<32> queue_;
Expand All @@ -131,19 +131,19 @@ class Ui {
Adc adc_;

EditMode edit_mode_;
Function function_[2];
Function function_[2] = {};
Settings settings_;
uint16_t version_token_;

int16_t brightness_[2];
int16_t brightness_[2] = {};

uint8_t panel_gate_state_;

uint8_t double_press_counter_;
uint8_t pot_value_[8];
uint8_t pot_value_[8] = {};

bool snap_mode_;
bool snapped_[kNumAdcChannels];
bool snapped_[kNumAdcChannels] = {};

CalibrationData* calibration_data_;
bool calibrating_;
Expand Down

0 comments on commit cb9427f

Please sign in to comment.