Browse Source

Merge pull request #2954 from rgetz/rgetz-resolve-uninitMemberVar-sdrbase

resolve uninit member var in ./sdrbase
chirpmodem-v8.0.0
Edouard Griffiths 2 months ago committed by GitHub
parent
commit
22414beeb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      sdrbase/audio/audiocompressorsnd.cpp
  2. 10
      sdrbase/audio/audiofilter.cpp
  3. 11
      sdrbase/audio/audioinputdevice.cpp
  4. 8
      sdrbase/availablechannelorfeature.h
  5. 3
      sdrbase/device/deviceset.cpp
  6. 1
      sdrbase/dsp/devicesamplemimo.cpp
  7. 12
      sdrbase/dsp/fftfilt.cpp
  8. 7
      sdrbase/dsp/fftnr.cpp
  9. 3
      sdrbase/dsp/filerecord.cpp
  10. 3
      sdrbase/dsp/filerecordinterface.cpp
  11. 8
      sdrbase/dsp/kissfft.h
  12. 10
      sdrbase/dsp/morsedemod.cpp
  13. 7
      sdrbase/dsp/nco.cpp
  14. 1
      sdrbase/dsp/projector.cpp
  15. 5
      sdrbase/dsp/replaybuffer.h
  16. 9
      sdrbase/dsp/samplemofifo.cpp
  17. 9
      sdrbase/dsp/samplesourcefifo.cpp
  18. 1
      sdrbase/dsp/scopevis.h
  19. 8
      sdrbase/dsp/spectrumsettings.cpp
  20. 1
      sdrbase/dsp/wavfilerecord.cpp
  21. 10
      sdrbase/feature/feature.cpp
  22. 2
      sdrbase/remotetcpsinkstarter.cpp
  23. 8
      sdrbase/settings/preset.h
  24. 7
      sdrbase/util/ais.cpp
  25. 51
      sdrbase/util/aprs.h
  26. 1
      sdrbase/util/crc.h
  27. 12
      sdrbase/util/fits.cpp
  28. 4
      sdrbase/util/golay2312.cpp
  29. 9
      sdrbase/util/kiwisdrlist.cpp
  30. 7
      sdrbase/util/movingaverage.h
  31. 3
      sdrbase/util/openaip.cpp
  32. 4
      sdrbase/util/png.cpp
  33. 14
      sdrbase/util/popcount.h
  34. 9
      sdrbase/util/radiosonde.cpp
  35. 3
      sdrbase/util/simpleserializer.cpp
  36. 5
      sdrbase/util/visa.cpp
  37. 4
      sdrbase/util/weather.cpp
  38. 3
      sdrbase/webapi/webapiadapterbase.cpp
  39. 13
      sdrbase/websockets/wsspectrum.cpp

20
sdrbase/audio/audiocompressorsnd.cpp

@ -25,7 +25,25 @@ @@ -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);

10
sdrbase/audio/audiofilter.cpp

@ -33,9 +33,13 @@ const float AudioFilter::m_hpa[3] = {1.000000e+00, 1.667871e+00, -7.156964e-01} @@ -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()

11
sdrbase/audio/audioinputdevice.cpp

@ -35,11 +35,12 @@ MESSAGE_CLASS_DEFINITION(AudioInputDevice::MsgStop, Message) @@ -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);
}

8
sdrbase/availablechannelorfeature.h

@ -27,11 +27,11 @@ @@ -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;

3
sdrbase/device/deviceset.cpp

@ -33,7 +33,8 @@ @@ -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;

1
sdrbase/dsp/devicesamplemimo.cpp

@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
#include "devicesamplemimo.h"
DeviceSampleMIMO::DeviceSampleMIMO() :
m_mimoType(MIMOAsynchronous),
m_guiMessageQueue(nullptr)
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));

12
sdrbase/dsp/fftfilt.cpp

@ -99,6 +99,10 @@ void fftfilt::init_filter() @@ -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) : @@ -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) : @@ -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;

7
sdrbase/dsp/fftnr.cpp

@ -25,7 +25,9 @@ @@ -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) @@ -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;

3
sdrbase/dsp/filerecord.cpp

@ -53,7 +53,8 @@ FileRecord::FileRecord(const QString& fileBase) : @@ -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");
}

3
sdrbase/dsp/filerecordinterface.cpp

@ -25,7 +25,8 @@ @@ -25,7 +25,8 @@
#include "filerecordinterface.h"
FileRecordInterface::FileRecordInterface()
FileRecordInterface::FileRecordInterface() :
m_guiMessageQueue(nullptr)
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}

8
sdrbase/dsp/kissfft.h

@ -114,9 +114,11 @@ public: @@ -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)

10
sdrbase/dsp/morsedemod.cpp

@ -24,9 +24,17 @@ @@ -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)
{
}

7
sdrbase/dsp/nco.cpp

@ -38,7 +38,12 @@ void NCO::initTable() @@ -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;

1
sdrbase/dsp/projector.cpp

@ -22,6 +22,7 @@ @@ -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)
{

5
sdrbase/dsp/replaybuffer.h

@ -33,12 +33,13 @@ template <typename T> @@ -33,12 +33,13 @@ template <typename T>
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)
{
}

9
sdrbase/dsp/samplemofifo.cpp

@ -24,7 +24,14 @@ const unsigned int SampleMOFifo::m_guardDivisor = 10; @@ -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) :

9
sdrbase/dsp/samplesourcefifo.cpp

@ -24,7 +24,14 @@ const unsigned int SampleSourceFifo::m_rwDivisor = 2; @@ -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) :

1
sdrbase/dsp/scopevis.h

@ -601,6 +601,7 @@ private: @@ -601,6 +601,7 @@ private:
struct ConvertBuffers
{
ConvertBuffers(uint32_t nbStreams = 1) :
m_size(0),
m_convertBuffers(nbStreams)
{}

8
sdrbase/dsp/spectrumsettings.cpp

@ -320,8 +320,8 @@ bool SpectrumSettings::deserialize(const QByteArray& data) @@ -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) @@ -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++)

1
sdrbase/dsp/wavfilerecord.cpp

@ -53,6 +53,7 @@ WavFileRecord::WavFileRecord(const QString& fileBase) : @@ -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");

10
sdrbase/feature/feature.cpp

@ -29,11 +29,13 @@ @@ -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()));
}

2
sdrbase/remotetcpsinkstarter.cpp

@ -60,6 +60,8 @@ RemoteTCPSinkStarter::RemoteTCPSinkStarter(const QString& address, int port, con @@ -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();

8
sdrbase/settings/preset.h

@ -61,10 +61,10 @@ public: @@ -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;

7
sdrbase/util/ais.cpp

@ -531,7 +531,9 @@ AISBinaryBroadcast::AISBinaryBroadcast(QByteArray ba) : @@ -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() @@ -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;

51
sdrbase/util/aprs.h

@ -175,45 +175,96 @@ struct SDRBASE_API APRSPacket { @@ -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)
{

1
sdrbase/util/crc.h

@ -30,6 +30,7 @@ public: @@ -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),

12
sdrbase/util/fits.cpp

@ -27,7 +27,17 @@ @@ -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()) {

4
sdrbase/util/golay2312.cpp

@ -63,7 +63,9 @@ const unsigned int Golay2312::m_I12[12] = { @@ -63,7 +63,9 @@ const unsigned int Golay2312::m_I12[12] = {
0b000000000001,
};
Golay2312::Golay2312()
Golay2312::Golay2312() :
m_corrPL{},
m_corrPF{}
{
initG();
initH();

9
sdrbase/util/kiwisdrlist.cpp

@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
#include <QXmlStreamReader>
#include <QNetworkDiskCache>
#include <QRegularExpression>
#include <QSet>
#include "util/corsproxy.h"
@ -100,6 +101,7 @@ void KiwiSDRList::handleReply(QNetworkReply* reply) @@ -100,6 +101,7 @@ void KiwiSDRList::handleReply(QNetworkReply* reply)
void KiwiSDRList::handleHTML(const QString& url, const QByteArray& bytes)
{
static QSet<QString> unhandledKeys{};
(void) url;
QList<KiwiSDR> sdrs;
@ -123,7 +125,7 @@ void KiwiSDRList::handleHTML(const QString& url, const QByteArray& bytes) @@ -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) @@ -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);

7
sdrbase/util/movingaverage.h

@ -29,8 +29,11 @@ template <typename T, typename Total, int N> @@ -29,8 +29,11 @@ template <typename T, typename Total, int N>
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()

3
sdrbase/util/openaip.cpp

@ -520,7 +520,8 @@ QDateTime OpenAIP::m_airspacesModifiedDateTime; @@ -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);
}

4
sdrbase/util/png.cpp

@ -22,7 +22,9 @@ @@ -22,7 +22,9 @@
#include <QBuffer>
#include <QFile>
PNG::PNG()
PNG::PNG() :
m_width(0),
m_height(0)
{
}

14
sdrbase/util/popcount.h

@ -31,11 +31,17 @@ @@ -31,11 +31,17 @@
#include <intrin.h>
#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

9
sdrbase/util/radiosonde.cpp

@ -25,6 +25,7 @@ @@ -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) : @@ -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]);

3
sdrbase/util/simpleserializer.cpp

@ -313,7 +313,8 @@ bool SimpleSerializer::writeTag(Type type, quint32 id, quint32 length) @@ -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();

5
sdrbase/util/visa.cpp

@ -35,8 +35,9 @@ VISA::VISA() : @@ -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

4
sdrbase/util/weather.cpp

@ -25,7 +25,9 @@ @@ -25,7 +25,9 @@
#include <QJsonDocument>
#include <QJsonObject>
Weather::Weather()
Weather::Weather() :
m_latitude(0.0f),
m_longitude(0.0f)
{
connect(&m_timer, &QTimer::timeout, this, &Weather::update);
}

3
sdrbase/webapi/webapiadapterbase.cpp

@ -27,7 +27,8 @@ @@ -27,7 +27,8 @@
#include "dsp/spectrumsettings.h"
#include "webapiadapterbase.h"
WebAPIAdapterBase::WebAPIAdapterBase()
WebAPIAdapterBase::WebAPIAdapterBase() :
m_pluginManager(nullptr)
{}
WebAPIAdapterBase::~WebAPIAdapterBase()

13
sdrbase/websockets/wsspectrum.cpp

@ -47,6 +47,17 @@ WSSpectrum::~WSSpectrum() @@ -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) @@ -126,10 +137,10 @@ void WSSpectrum::processClientMessage(const QString &message)
void WSSpectrum::socketDisconnected()
{
QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
qDebug() << getWebSocketIdentifier(pClient) << " disconnected";
if (pClient)
{
qDebug() << getWebSocketIdentifier(pClient) << " disconnected";
m_clients.removeAll(pClient);
pClient->deleteLater();
}

Loading…
Cancel
Save