diff --git a/sdrbase/audio/audiocompressorsnd.cpp b/sdrbase/audio/audiocompressorsnd.cpp index d95893e64..cce62ba7c 100644 --- a/sdrbase/audio/audiocompressorsnd.cpp +++ b/sdrbase/audio/audiocompressorsnd.cpp @@ -25,7 +25,25 @@ #include "audiocompressorsnd.h" -AudioCompressorSnd::AudioCompressorSnd() +AudioCompressorSnd::AudioCompressorSnd() : + m_rate(0.0f), + m_pregain(0.0f), + m_threshold(0.0f), + m_knee(0.0f), + m_ratio(0.0f), + m_attack(0.0f), + m_release(0.0f), + m_predelay(0.0f), + m_releasezone1(0.0f), + m_releasezone2(0.0f), + m_releasezone3(0.0f), + m_releasezone4(0.0f), + m_postgain(0.0f), + m_wet(0.0f), + m_compressorState{}, + m_storageBuffer{}, + m_processedBuffer{}, + m_sampleIndex(0) { m_sampleIndex = 0; std::fill(m_processedBuffer, m_processedBuffer+AUDIOCOMPRESSORSND_SF_COMPRESSOR_CHUNKSIZE, 0.0f); diff --git a/sdrbase/audio/audiofilter.cpp b/sdrbase/audio/audiofilter.cpp index 5c3b8183d..cb625b432 100644 --- a/sdrbase/audio/audiofilter.cpp +++ b/sdrbase/audio/audiofilter.cpp @@ -33,9 +33,13 @@ const float AudioFilter::m_hpa[3] = {1.000000e+00, 1.667871e+00, -7.156964e-01} const float AudioFilter::m_hpb[3] = {8.459039e-01, -1.691760e+00, 8.459039e-01}; AudioFilter::AudioFilter() : - m_filterLP(m_lpa, m_lpb), - m_filterHP(m_hpa, m_hpb), - m_useHP(false) + m_filterLP(m_lpa, m_lpb), + m_filterHP(m_hpa, m_hpb), + m_useHP(false), + m_lpva{}, + m_lpvb{}, + m_hpva{}, + m_hpvb{} {} AudioFilter::~AudioFilter() diff --git a/sdrbase/audio/audioinputdevice.cpp b/sdrbase/audio/audioinputdevice.cpp index 955c644c0..12100341d 100644 --- a/sdrbase/audio/audioinputdevice.cpp +++ b/sdrbase/audio/audioinputdevice.cpp @@ -35,11 +35,12 @@ MESSAGE_CLASS_DEFINITION(AudioInputDevice::MsgStop, Message) MESSAGE_CLASS_DEFINITION(AudioInputDevice::MsgReportSampleRate, Message) AudioInputDevice::AudioInputDevice() : - m_audioInput(0), - m_audioUsageCount(0), - m_onExit(false), - m_volume(0.5f), - m_audioFifos() + m_audioInput(0), + m_audioUsageCount(0), + m_onExit(false), + m_volume(0.5f), + m_audioFifos(), + m_managerMessageQueue(nullptr) { connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); } diff --git a/sdrbase/availablechannelorfeature.h b/sdrbase/availablechannelorfeature.h index a3b9f3dab..077bdbd47 100644 --- a/sdrbase/availablechannelorfeature.h +++ b/sdrbase/availablechannelorfeature.h @@ -27,11 +27,11 @@ struct SDRBASE_API AvailableChannelOrFeature { QChar m_kind; //!< 'R' or 'T' for channel, 'M' for MIMO channel, 'F' for feature as from MainCore::getDeviceSetTypeId - int m_superIndex; //!< Device Set index or Feature Set index - int m_index; //!< Channel or Feature index - int m_streamIndex; //!< For MIMO channels only + int m_superIndex = 0; //!< Device Set index or Feature Set index + int m_index = 0; //!< Channel or Feature index + int m_streamIndex = 0; //!< For MIMO channels only QString m_type; //!< Plugin type (E.g. NFMDemod) - QObject *m_object; //!< Pointer to the object (ChannelAPI or Feature object) + QObject *m_object = nullptr; //!< Pointer to the object (ChannelAPI or Feature object) AvailableChannelOrFeature() = default; AvailableChannelOrFeature(const AvailableChannelOrFeature&) = default; diff --git a/sdrbase/device/deviceset.cpp b/sdrbase/device/deviceset.cpp index c35b952b6..406e7750b 100644 --- a/sdrbase/device/deviceset.cpp +++ b/sdrbase/device/deviceset.cpp @@ -33,7 +33,8 @@ #include "deviceset.h" -DeviceSet::DeviceSet(int tabIndex, int deviceType) +DeviceSet::DeviceSet(int tabIndex, int deviceType) : + m_spectrumVis(nullptr) { m_deviceAPI = nullptr; m_deviceSourceEngine = nullptr; diff --git a/sdrbase/dsp/devicesamplemimo.cpp b/sdrbase/dsp/devicesamplemimo.cpp index c3de8162b..efc789038 100644 --- a/sdrbase/dsp/devicesamplemimo.cpp +++ b/sdrbase/dsp/devicesamplemimo.cpp @@ -20,6 +20,7 @@ #include "devicesamplemimo.h" DeviceSampleMIMO::DeviceSampleMIMO() : + m_mimoType(MIMOAsynchronous), m_guiMessageQueue(nullptr) { connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); diff --git a/sdrbase/dsp/fftfilt.cpp b/sdrbase/dsp/fftfilt.cpp index aa8123c76..39f238fe4 100644 --- a/sdrbase/dsp/fftfilt.cpp +++ b/sdrbase/dsp/fftfilt.cpp @@ -99,6 +99,10 @@ void fftfilt::init_filter() // f2 == 0 ==> high pass filter //------------------------------------------------------------------------------ fftfilt::fftfilt(int len) : + m_dnrScheme(FFTNoiseReduction::SchemeAverage), + m_dnrAboveAvgFactor(0.0f), + m_dnrSigmaFactor(0.0f), + m_dnrNbPeaks(0), m_noiseReduction(len) { flen = len; @@ -109,6 +113,10 @@ fftfilt::fftfilt(int len) : } fftfilt::fftfilt(float f1, float f2, int len) : + m_dnrScheme(FFTNoiseReduction::SchemeAverage), + m_dnrAboveAvgFactor(0.0f), + m_dnrSigmaFactor(0.0f), + m_dnrNbPeaks(0), m_noiseReduction(len) { flen = len; @@ -120,6 +128,10 @@ fftfilt::fftfilt(float f1, float f2, int len) : } fftfilt::fftfilt(float f2, int len) : + m_dnrScheme(FFTNoiseReduction::SchemeAverage), + m_dnrAboveAvgFactor(0.0f), + m_dnrSigmaFactor(0.0f), + m_dnrNbPeaks(0), m_noiseReduction(len) { flen = len; diff --git a/sdrbase/dsp/fftnr.cpp b/sdrbase/dsp/fftnr.cpp index 56328f660..2237a5c94 100644 --- a/sdrbase/dsp/fftnr.cpp +++ b/sdrbase/dsp/fftnr.cpp @@ -25,7 +25,9 @@ #include "fftnr.h" FFTNoiseReduction::FFTNoiseReduction(int len) : - m_flen(len) + m_flen(len), + m_magAvg(0.0f), + m_magThr(0.0f) { m_scheme = SchemeAverage; m_mags = new float[m_flen]; @@ -107,7 +109,8 @@ void FFTNoiseReduction::setScheme(Scheme scheme) m_scheme = scheme; } -FFTNoiseReduction::ExponentialFilter::ExponentialFilter() +FFTNoiseReduction::ExponentialFilter::ExponentialFilter() : + m_prev(0.0f) { m_alpha = 1.0; m_init = true; diff --git a/sdrbase/dsp/filerecord.cpp b/sdrbase/dsp/filerecord.cpp index e60b054ea..e772a1c7c 100644 --- a/sdrbase/dsp/filerecord.cpp +++ b/sdrbase/dsp/filerecord.cpp @@ -53,7 +53,8 @@ FileRecord::FileRecord(const QString& fileBase) : m_centerFrequency(0), m_recordOn(false), m_recordStart(false), - m_byteCount(0) + m_byteCount(0), + m_msShift(0) { setObjectName("FileRecord"); } diff --git a/sdrbase/dsp/filerecordinterface.cpp b/sdrbase/dsp/filerecordinterface.cpp index 4b6c95964..3172f362e 100644 --- a/sdrbase/dsp/filerecordinterface.cpp +++ b/sdrbase/dsp/filerecordinterface.cpp @@ -25,7 +25,8 @@ #include "filerecordinterface.h" -FileRecordInterface::FileRecordInterface() +FileRecordInterface::FileRecordInterface() : + m_guiMessageQueue(nullptr) { connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); } diff --git a/sdrbase/dsp/kissfft.h b/sdrbase/dsp/kissfft.h index ff0975d90..5dcb3c2e3 100644 --- a/sdrbase/dsp/kissfft.h +++ b/sdrbase/dsp/kissfft.h @@ -114,9 +114,11 @@ public: typedef typename traits_type::scalar_type scalar_type; typedef typename traits_type::cpx_type cpx_type; - kissfft() - { - } + kissfft() : + _nfft(0), + _inverse(false) + { + } kissfft(int nfft, bool inverse, const traits_type & traits = traits_type()) : _nfft(nfft), _inverse(inverse), _traits(traits) diff --git a/sdrbase/dsp/morsedemod.cpp b/sdrbase/dsp/morsedemod.cpp index 014220ead..29bd28a01 100644 --- a/sdrbase/dsp/morsedemod.cpp +++ b/sdrbase/dsp/morsedemod.cpp @@ -24,9 +24,17 @@ MESSAGE_CLASS_DEFINITION(MorseDemod::MsgReportIdent, Message) MorseDemod::MorseDemod() : + m_messageQueueToChannel(nullptr), m_movingAverageIdent(5000), + m_identMaxs{}, + m_identNoise(0.0), + m_binSampleCnt(0), + m_binCnt(0), + m_samplesPerDot7wpm(0), + m_samplesPerDot10wpm(0), m_prevBit(0), - m_bitTime(0) + m_bitTime(0), + m_identThreshold(0) { } diff --git a/sdrbase/dsp/nco.cpp b/sdrbase/dsp/nco.cpp index d148b7f17..cab6dee5c 100644 --- a/sdrbase/dsp/nco.cpp +++ b/sdrbase/dsp/nco.cpp @@ -38,7 +38,12 @@ void NCO::initTable() m_tableInitialized = true; } -NCO::NCO() +NCO::NCO() : + m_phaseIncrement(0), + m_phase(0), + m_phaseDithered(0), + m_lfsr(0), + m_ditherMask(0) { initTable(); m_phase = 0; diff --git a/sdrbase/dsp/projector.cpp b/sdrbase/dsp/projector.cpp index 135d8b6e8..8c99d0b67 100644 --- a/sdrbase/dsp/projector.cpp +++ b/sdrbase/dsp/projector.cpp @@ -22,6 +22,7 @@ Projector::Projector(ProjectionType projectionType) : m_projectionType(projectionType), m_prevArg(0.0f), + m_prevVal(0.0f), m_cache(nullptr), m_cacheMaster(true) { diff --git a/sdrbase/dsp/replaybuffer.h b/sdrbase/dsp/replaybuffer.h index 9e52ab0c1..dae72d75d 100644 --- a/sdrbase/dsp/replaybuffer.h +++ b/sdrbase/dsp/replaybuffer.h @@ -33,12 +33,13 @@ template class ReplayBuffer { public: - ReplayBuffer() : + ReplayBuffer() : m_data(1000000*2, 0), m_write(0), m_read(0), m_readOffset(0), - m_count(0) + m_count(0), + m_loop(false) { } diff --git a/sdrbase/dsp/samplemofifo.cpp b/sdrbase/dsp/samplemofifo.cpp index aa9a0ba2d..85539a56a 100644 --- a/sdrbase/dsp/samplemofifo.cpp +++ b/sdrbase/dsp/samplemofifo.cpp @@ -24,7 +24,14 @@ const unsigned int SampleMOFifo::m_guardDivisor = 10; SampleMOFifo::SampleMOFifo(QObject *parent) : QObject(parent), - m_nbStreams(0) + m_nbStreams(0), + m_size(0), + m_lowGuard(0), + m_highGuard(0), + m_midPoint(0), + m_readCount(0), + m_readHead(0), + m_writeHead(0) {} SampleMOFifo::SampleMOFifo(unsigned int nbStreams, unsigned int size, QObject *parent) : diff --git a/sdrbase/dsp/samplesourcefifo.cpp b/sdrbase/dsp/samplesourcefifo.cpp index 8ae0b1945..a1ee7830f 100644 --- a/sdrbase/dsp/samplesourcefifo.cpp +++ b/sdrbase/dsp/samplesourcefifo.cpp @@ -24,7 +24,14 @@ const unsigned int SampleSourceFifo::m_rwDivisor = 2; const unsigned int SampleSourceFifo::m_guardDivisor = 10; SampleSourceFifo::SampleSourceFifo(QObject *parent) : - QObject(parent) + QObject(parent), + m_size(0), + m_lowGuard(0), + m_highGuard(0), + m_midPoint(0), + m_readHead(0), + m_writeHead(0), + m_readCount(0) {} SampleSourceFifo::SampleSourceFifo(unsigned int size, QObject *parent) : diff --git a/sdrbase/dsp/scopevis.h b/sdrbase/dsp/scopevis.h index da1023c78..2b487f6d3 100644 --- a/sdrbase/dsp/scopevis.h +++ b/sdrbase/dsp/scopevis.h @@ -601,6 +601,7 @@ private: struct ConvertBuffers { ConvertBuffers(uint32_t nbStreams = 1) : + m_size(0), m_convertBuffers(nbStreams) {} diff --git a/sdrbase/dsp/spectrumsettings.cpp b/sdrbase/dsp/spectrumsettings.cpp index b88f286a6..de84f0584 100644 --- a/sdrbase/dsp/spectrumsettings.cpp +++ b/sdrbase/dsp/spectrumsettings.cpp @@ -320,8 +320,8 @@ bool SpectrumSettings::deserialize(const QByteArray& data) int histogramMarkersSize; d.readS32(100, &histogramMarkersSize, 0); histogramMarkersSize = histogramMarkersSize < 0 ? 0 : - histogramMarkersSize > SpectrumHistogramMarker::m_maxNbOfMarkers ? - SpectrumHistogramMarker::m_maxNbOfMarkers : histogramMarkersSize; + (histogramMarkersSize > SpectrumHistogramMarker::m_maxNbOfMarkers ? + SpectrumHistogramMarker::m_maxNbOfMarkers : histogramMarkersSize); m_histogramMarkers.clear(); for (int i = 0; i < histogramMarkersSize; i++) @@ -335,8 +335,8 @@ bool SpectrumSettings::deserialize(const QByteArray& data) d.readS32(110, &waterfallMarkersSize, 0); waterfallMarkersSize = waterfallMarkersSize < 0 ? 0 : - waterfallMarkersSize > SpectrumWaterfallMarker::m_maxNbOfMarkers ? - SpectrumWaterfallMarker::m_maxNbOfMarkers : waterfallMarkersSize; + (waterfallMarkersSize > SpectrumWaterfallMarker::m_maxNbOfMarkers ? + SpectrumWaterfallMarker::m_maxNbOfMarkers : waterfallMarkersSize); m_waterfallMarkers.clear(); for (int i = 0; i < waterfallMarkersSize; i++) diff --git a/sdrbase/dsp/wavfilerecord.cpp b/sdrbase/dsp/wavfilerecord.cpp index 221dafff8..504921795 100644 --- a/sdrbase/dsp/wavfilerecord.cpp +++ b/sdrbase/dsp/wavfilerecord.cpp @@ -53,6 +53,7 @@ WavFileRecord::WavFileRecord(const QString& fileBase) : m_recordOn(false), m_recordStart(false), m_byteCount(0), + m_msShift(0), m_nbChannels(2) { setObjectName("WavFileRecord"); diff --git a/sdrbase/feature/feature.cpp b/sdrbase/feature/feature.cpp index 8502e7606..2af7dfeef 100644 --- a/sdrbase/feature/feature.cpp +++ b/sdrbase/feature/feature.cpp @@ -29,11 +29,13 @@ Feature::Feature(const QString& uri, WebAPIAdapterInterface *webAPIAdapterInterface) : m_guiMessageQueue(nullptr), - m_state(StNotStarted), - m_webAPIAdapterInterface(webAPIAdapterInterface), + m_state(StNotStarted), + m_webAPIAdapterInterface(webAPIAdapterInterface), m_name(uri), - m_uri(uri), - m_uid(UidCalculator::getNewObjectId()) + m_uri(uri), + m_uid(UidCalculator::getNewObjectId()), + m_indexInFeatureSet(0), + m_workspaceIndex(0) { connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); } diff --git a/sdrbase/remotetcpsinkstarter.cpp b/sdrbase/remotetcpsinkstarter.cpp index 71d3c0e8c..acafecab1 100644 --- a/sdrbase/remotetcpsinkstarter.cpp +++ b/sdrbase/remotetcpsinkstarter.cpp @@ -60,6 +60,8 @@ RemoteTCPSinkStarter::RemoteTCPSinkStarter(const QString& address, int port, con m_dataPort(port), m_deviceSet(nullptr) { + Q_UNUSED(serial); + // Add device of requested type SWGSDRangel::SWGDeviceSettings *response = new SWGSDRangel::SWGDeviceSettings(); response->init(); diff --git a/sdrbase/settings/preset.h b/sdrbase/settings/preset.h index 4cd906b8b..dfc1cc82d 100644 --- a/sdrbase/settings/preset.h +++ b/sdrbase/settings/preset.h @@ -61,10 +61,10 @@ public: struct SelectedDevice { - QString m_deviceId; - QString m_deviceSerial; - int m_deviceSequence; - int m_deviceItemIndex; + QString m_deviceId; + QString m_deviceSerial; + int m_deviceSequence = 0; + int m_deviceItemIndex = 0; SelectedDevice() = default; SelectedDevice(const SelectedDevice&) = default; diff --git a/sdrbase/util/ais.cpp b/sdrbase/util/ais.cpp index 0bcc78ff4..ceed68035 100644 --- a/sdrbase/util/ais.cpp +++ b/sdrbase/util/ais.cpp @@ -531,7 +531,9 @@ AISBinaryBroadcast::AISBinaryBroadcast(QByteArray ba) : } AISSARAircraftPositionReport::AISSARAircraftPositionReport(QByteArray ba) : - AISMessage(ba) + AISMessage(ba), + m_headingAvailable(false), + m_heading(0) { m_altitude = ((ba[4] & 0x3) << 10) | ((ba[5] & 0xff) << 2) | ((ba[6] >> 6) & 0x3); m_altitudeAvailable = m_altitude != 4095; @@ -831,7 +833,8 @@ QString AISStaticDataReport::toString() } AISSingleSlotBinaryMessage::AISSingleSlotBinaryMessage(QByteArray ba) : - AISMessage(ba) + AISMessage(ba), + m_destinationId(0) { m_destinationIndicator = (ba[4] >> 1) & 1; m_binaryDataFlag = ba[4] & 1; diff --git a/sdrbase/util/aprs.h b/sdrbase/util/aprs.h index 97fe59ad8..4981f052c 100644 --- a/sdrbase/util/aprs.h +++ b/sdrbase/util/aprs.h @@ -175,45 +175,96 @@ struct SDRBASE_API APRSPacket { bool decode(AX25Packet packet); APRSPacket() : + m_utc(false), m_hasTimestamp(false), + m_latitude(0.0f), + m_longitude(0.0f), m_hasPosition(false), + m_altitudeFt(0.0f), m_hasAltitude(false), + m_symbolTable(0), + m_symbolCode(0), m_hasSymbol(false), + m_course(0), + m_speed(0), m_hasCourseAndSpeed(false), + m_powerWatts(0), + m_antennaHeightFt(0), + m_antennaGainDB(0), m_hasStationDetails(false), + m_radioRangeMiles(0), m_hasRadioRange(false), + m_dfStrength(0), + m_dfHeightFt(0), + m_dfGainDB(0), m_hasDf(false), m_objectLive(false), m_objectKilled(false), + m_windDirection(0), m_hasWindDirection(false), + m_windSpeed(0), m_hasWindSpeed(false), + m_gust(0), m_hasGust(false), + m_temp(0), m_hasTemp(false), + m_rainLastHr(0), m_hasRainLastHr(false), + m_rainLast24Hrs(0), m_hasRainLast24Hrs(false), + m_rainSinceMidnight(0), m_hasRainSinceMidnight(false), + m_humidity(0), m_hasHumidity(false), + m_barometricPressure(0), m_hasBarometricPressure(false), + m_luminosity(0), m_hasLuminsoity(false), + m_snowfallLast24Hrs(0), m_hasSnowfallLast24Hrs(false), + m_rawRainCounter(0), m_hasRawRainCounter(false), + m_radiationLevel(0), m_hasRadiationLevel(false), + m_floodLevel(0), m_hasFloodLevel(false), + m_batteryVolts(0), m_hasBatteryVolts(false), m_hasWeather(false), + m_stormDirection(0), + m_stormSpeed(0), + m_stormSustainedWindSpeed(0), + m_stormPeakWindGusts(0), + m_stormCentralPresure(0), + m_stormRadiusHurricanWinds(0), + m_stormRadiusTropicalStormWinds(0), + m_stormRadiusWholeGail(0), m_hasStormRadiusWholeGail(false), m_hasStormData(false), + m_beamHeading(0), + m_beamPower(0), m_hasBeam(false), m_hasStatus(false), m_hasMessage(false), + m_telemetryCoefficientsA{}, + m_telemetryCoefficientsB{}, + m_telemetryCoefficientsC{}, m_hasTelemetryCoefficients(0), + m_telemetryBitSense{}, m_hasTelemetryBitSense(false), + m_seqNo(0), m_hasSeqNo(false), + m_a1(0), m_a1HasValue(false), + m_a2(0), m_a2HasValue(false), + m_a3(0), m_a3HasValue(false), + m_a4(0), m_a4HasValue(false), + m_a5(0), m_a5HasValue(false), + m_b{}, m_bHasValue(false), m_hasTelemetry(false) { diff --git a/sdrbase/util/crc.h b/sdrbase/util/crc.h index 472298b9c..8d15ba23f 100644 --- a/sdrbase/util/crc.h +++ b/sdrbase/util/crc.h @@ -30,6 +30,7 @@ public: // Create and initialise CRC with specified polynomial and parameters crc(int poly_bits, uint32_t polynomial, bool msb_first, uint32_t init_value, uint32_t final_xor) : m_polynomial(polynomial), + m_polynomial_rev(0), m_poly_bits(poly_bits), m_msb_first(msb_first), m_init_value(init_value), diff --git a/sdrbase/util/fits.cpp b/sdrbase/util/fits.cpp index f91cddf30..b711ca709 100644 --- a/sdrbase/util/fits.cpp +++ b/sdrbase/util/fits.cpp @@ -27,7 +27,17 @@ #include "fits.h" FITS::FITS(QString resourceName) : - m_valid(false) + m_valid(false), + m_width(0), + m_height(0), + m_bitsPerPixel(0), + m_bytesPerPixel(0), + m_bzero(0), + m_bscale(0.0), + m_uintScale(0.0f), + m_cdelta1(0.0), + m_cdelta2(0.0), + m_dataStart(0) { QResource m_res(resourceName); if (!m_res.isValid()) { diff --git a/sdrbase/util/golay2312.cpp b/sdrbase/util/golay2312.cpp index 0ad1cf7bc..9a2be0e0b 100644 --- a/sdrbase/util/golay2312.cpp +++ b/sdrbase/util/golay2312.cpp @@ -63,7 +63,9 @@ const unsigned int Golay2312::m_I12[12] = { 0b000000000001, }; -Golay2312::Golay2312() +Golay2312::Golay2312() : + m_corrPL{}, + m_corrPF{} { initG(); initH(); diff --git a/sdrbase/util/kiwisdrlist.cpp b/sdrbase/util/kiwisdrlist.cpp index 115ba1fdb..6e4aa93ae 100644 --- a/sdrbase/util/kiwisdrlist.cpp +++ b/sdrbase/util/kiwisdrlist.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "util/corsproxy.h" @@ -100,6 +101,7 @@ void KiwiSDRList::handleReply(QNetworkReply* reply) void KiwiSDRList::handleHTML(const QString& url, const QByteArray& bytes) { + static QSet unhandledKeys{}; (void) url; QList sdrs; @@ -123,7 +125,7 @@ void KiwiSDRList::handleHTML(const QString& url, const QByteArray& bytes) if (urlMatch.hasMatch()) { - KiwiSDR sdr; + KiwiSDR sdr{}; sdr.m_url = urlMatch.captured(1); @@ -193,6 +195,11 @@ void KiwiSDRList::handleHTML(const QString& url, const QByteArray& bytes) { sdr.m_snr = value; } + else if (!unhandledKeys.contains(key)) + { + qDebug() << "KiwiSDRList::handleHTML: Unhandled key:" << key << "value:" << value; + unhandledKeys.insert(key); + } } sdrs.append(sdr); diff --git a/sdrbase/util/movingaverage.h b/sdrbase/util/movingaverage.h index c1849b3eb..99ec47f27 100644 --- a/sdrbase/util/movingaverage.h +++ b/sdrbase/util/movingaverage.h @@ -29,8 +29,11 @@ template class MovingAverageUtil { public: - MovingAverageUtil() - : m_num_samples(0), m_index(0), m_total(0) + MovingAverageUtil() : + m_samples{}, + m_num_samples(0), + m_index(0), + m_total(0) { } void reset() diff --git a/sdrbase/util/openaip.cpp b/sdrbase/util/openaip.cpp index 197411c62..6bba524ae 100644 --- a/sdrbase/util/openaip.cpp +++ b/sdrbase/util/openaip.cpp @@ -520,7 +520,8 @@ QDateTime OpenAIP::m_airspacesModifiedDateTime; QDateTime OpenAIP::m_navAidsModifiedDateTime; OpenAIP::OpenAIP(QObject *parent) : - QObject(parent) + QObject(parent), + m_countryIndex(0) { connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &OpenAIP::downloadFinished); } diff --git a/sdrbase/util/png.cpp b/sdrbase/util/png.cpp index f9aaadd93..8617e684e 100644 --- a/sdrbase/util/png.cpp +++ b/sdrbase/util/png.cpp @@ -22,7 +22,9 @@ #include #include -PNG::PNG() +PNG::PNG() : + m_width(0), + m_height(0) { } diff --git a/sdrbase/util/popcount.h b/sdrbase/util/popcount.h index 974a5b0b1..79cc62838 100644 --- a/sdrbase/util/popcount.h +++ b/sdrbase/util/popcount.h @@ -31,11 +31,17 @@ #include #define popcount __popcnt #else -static int popcount(int in) +// https://en.cppreference.com/cpp/numeric/popcount +// std::popcount requires an unsigned integer type. +// +// Brian Kernighan's method: +// https://graphics.stanford.edu/~seander/bithacks.html +static int popcount(unsigned int in) { - int cnt = 0; - for(int i = 0; i < 32; i++) - cnt += (in >> i) & 1; + for (int cnt = 0; in; cnt++) + { + in &= in - 1; // clear the least significant bit set + } return cnt; } #endif diff --git a/sdrbase/util/radiosonde.cpp b/sdrbase/util/radiosonde.cpp index b9f37cfb9..4cc3603c7 100644 --- a/sdrbase/util/radiosonde.cpp +++ b/sdrbase/util/radiosonde.cpp @@ -25,6 +25,7 @@ RS41Frame::RS41Frame(const QByteArray ba) : m_statusValid(false), + m_frameNumber(0), m_batteryVoltage(0.0), m_pcbTemperature(0), m_humiditySensorHeating(0), @@ -37,10 +38,18 @@ RS41Frame::RS41Frame(const QByteArray ba) : m_latitude(0.0), m_longitude(0.0), m_height(0.0), + m_speed(0.0), + m_heading(0.0), + m_verticalRate(0.0), + m_satellitesUsed(0), m_bytes(ba), + m_pressure(0.0), m_pressureCalibrated(false), + m_temperature(0.0), m_temperatureCalibrated(false), + m_humidityTemperature(0.0), m_humidityTemperatureCalibrated(false), + m_humidity(0.0), m_humidityCalibrated(false) { int length = getFrameLength(ba[RS41_OFFSET_FRAME_TYPE]); diff --git a/sdrbase/util/simpleserializer.cpp b/sdrbase/util/simpleserializer.cpp index 0ced52faa..5734a1a07 100644 --- a/sdrbase/util/simpleserializer.cpp +++ b/sdrbase/util/simpleserializer.cpp @@ -313,7 +313,8 @@ bool SimpleSerializer::writeTag(Type type, quint32 id, quint32 length) } SimpleDeserializer::SimpleDeserializer(const QByteArray& data) : - m_data(data) + m_data(data), + m_version(0) { m_valid = parseAll(); diff --git a/sdrbase/util/visa.cpp b/sdrbase/util/visa.cpp index 49b09491f..8deca6976 100644 --- a/sdrbase/util/visa.cpp +++ b/sdrbase/util/visa.cpp @@ -35,8 +35,9 @@ VISA::VISA() : viScanf(nullptr), viFindRsrc(nullptr), viFindNext(nullptr), - visaLibrary(nullptr), - m_available(false) + m_available(false), + m_debugIO(false), + visaLibrary(nullptr) { #ifdef _MSC_VER const char *visaName = "visa32.dll"; // Loads visa64.dll on WIN64 diff --git a/sdrbase/util/weather.cpp b/sdrbase/util/weather.cpp index 83337ca5b..66a3ec4a5 100644 --- a/sdrbase/util/weather.cpp +++ b/sdrbase/util/weather.cpp @@ -25,7 +25,9 @@ #include #include -Weather::Weather() +Weather::Weather() : + m_latitude(0.0f), + m_longitude(0.0f) { connect(&m_timer, &QTimer::timeout, this, &Weather::update); } diff --git a/sdrbase/webapi/webapiadapterbase.cpp b/sdrbase/webapi/webapiadapterbase.cpp index da26089a2..14d66d740 100644 --- a/sdrbase/webapi/webapiadapterbase.cpp +++ b/sdrbase/webapi/webapiadapterbase.cpp @@ -27,7 +27,8 @@ #include "dsp/spectrumsettings.h" #include "webapiadapterbase.h" -WebAPIAdapterBase::WebAPIAdapterBase() +WebAPIAdapterBase::WebAPIAdapterBase() : + m_pluginManager(nullptr) {} WebAPIAdapterBase::~WebAPIAdapterBase() diff --git a/sdrbase/websockets/wsspectrum.cpp b/sdrbase/websockets/wsspectrum.cpp index 401a7751d..a92a4dae0 100644 --- a/sdrbase/websockets/wsspectrum.cpp +++ b/sdrbase/websockets/wsspectrum.cpp @@ -47,6 +47,17 @@ WSSpectrum::~WSSpectrum() void WSSpectrum::openSocket() { + if (m_webSocketServer) + { + if (m_webSocketServer->isListening()) + { + qDebug() << "WSSpectrum::openSocket: invoked while spectrum server already listening at " + << m_listeningAddress.toString() << " on port " << m_port; + return; + } + closeSocket(); + } + m_webSocketServer = new QWebSocketServer( QStringLiteral("Spectrum Server"), QWebSocketServer::NonSecureMode, @@ -126,10 +137,10 @@ void WSSpectrum::processClientMessage(const QString &message) void WSSpectrum::socketDisconnected() { QWebSocket *pClient = qobject_cast(sender()); - qDebug() << getWebSocketIdentifier(pClient) << " disconnected"; if (pClient) { + qDebug() << getWebSocketIdentifier(pClient) << " disconnected"; m_clients.removeAll(pClient); pClient->deleteLater(); }