Browse Source

demodchirpchat: initialize missing settings members

Initialize m_rollupState to nullptr in the constructor and set
m_autoNbSymbolsMax to false in resetToDefaults(). This ensures the optional
rollup state pointer and the automatic message length setting have defined
initial values rather than relying on uninitialized storage.

Pointed out by cppcheck.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 4 months ago
parent
commit
9c6ec8aab6
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 4
      plugins/channelrx/demodchirpchat/chirpchatdemodsettings.cpp

4
plugins/channelrx/demodchirpchat/chirpchatdemodsettings.cpp

@ -59,7 +59,8 @@ const int ChirpChatDemodSettings::oversampling = 2; @@ -59,7 +59,8 @@ const int ChirpChatDemodSettings::oversampling = 2;
ChirpChatDemodSettings::ChirpChatDemodSettings() :
m_inputFrequencyOffset(0),
m_channelMarker(0),
m_spectrumGUI(0)
m_spectrumGUI(0),
m_rollupState(nullptr)
{
resetToDefaults();
}
@ -74,6 +75,7 @@ void ChirpChatDemodSettings::resetToDefaults() @@ -74,6 +75,7 @@ void ChirpChatDemodSettings::resetToDefaults()
m_fftWindow = FFTWindow::Rectangle;
m_eomSquelchTenths = 60;
m_nbSymbolsMax = 255;
m_autoNbSymbolsMax = false;
m_preambleChirps = 8;
m_packetLength = 32;
m_nbParityBits = 1;

Loading…
Cancel
Save