From 55db78bdaf4a9f317fe148e8e3c0dafbce776804 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Tue, 24 Nov 2020 14:15:11 +0000 Subject: [PATCH] Fix GCC compiler warnings --- plugins/channelrx/demodvor/navaid.h | 1 - plugins/channelrx/demodvor/vordemod.h | 1 + plugins/channelrx/demodvor/vordemodgui.cpp | 22 ++++++++++++++----- plugins/channelrx/demodvor/vordemodgui.h | 1 + plugins/channelrx/demodvor/vordemodplugin.cpp | 2 ++ plugins/channelrx/demodvor/vordemodsink.cpp | 22 +++++++++---------- 6 files changed, 31 insertions(+), 18 deletions(-) diff --git a/plugins/channelrx/demodvor/navaid.h b/plugins/channelrx/demodvor/navaid.h index c083fbac3..f770b281c 100644 --- a/plugins/channelrx/demodvor/navaid.h +++ b/plugins/channelrx/demodvor/navaid.h @@ -246,7 +246,6 @@ struct NavAid { size_t nameLen = 0; char *frequencyString = NULL; int frequency; - size_t frequencyLen = 0; float latitude = 0.0f; char *latitudeString = NULL; size_t latitudeLen = 0; diff --git a/plugins/channelrx/demodvor/vordemod.h b/plugins/channelrx/demodvor/vordemod.h index 3151b82f3..0246296a5 100644 --- a/plugins/channelrx/demodvor/vordemod.h +++ b/plugins/channelrx/demodvor/vordemod.h @@ -66,6 +66,7 @@ public: virtual ~VORDemod(); virtual void destroy() { delete this; } + using BasebandSampleSink::feed; virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po); virtual void start(); virtual void stop(); diff --git a/plugins/channelrx/demodvor/vordemodgui.cpp b/plugins/channelrx/demodvor/vordemodgui.cpp index 5e767698c..0bd14eff3 100644 --- a/plugins/channelrx/demodvor/vordemodgui.cpp +++ b/plugins/channelrx/demodvor/vordemodgui.cpp @@ -581,16 +581,17 @@ void VORDemodGUI::resizeTable() { // Fill table with a row of dummy data that will size the columns nicely // Trailing spaces are for sort arrow + QString morse("---- ---- ----"); int row = ui->vorData->rowCount(); ui->vorData->setRowCount(row + 1); ui->vorData->setItem(row, VOR_COL_NAME, new QTableWidgetItem("White Sulphur Springs")); ui->vorData->setItem(row, VOR_COL_FREQUENCY, new QTableWidgetItem("Freq (MHz) ")); ui->vorData->setItem(row, VOR_COL_OFFSET, new QTableWidgetItem("Offset (kHz) ")); ui->vorData->setItem(row, VOR_COL_IDENT, new QTableWidgetItem("Ident ")); - ui->vorData->setItem(row, VOR_COL_MORSE, new QTableWidgetItem(Morse::toSpacedUnicode(QString("---- ---- ----")))); - ui->vorData->setItem(row, VOR_COL_RADIAL, new QTableWidgetItem("Radial (°) ")); + ui->vorData->setItem(row, VOR_COL_MORSE, new QTableWidgetItem(Morse::toSpacedUnicode(morse))); + ui->vorData->setItem(row, VOR_COL_RADIAL, new QTableWidgetItem("Radial (o) ")); ui->vorData->setItem(row, VOR_COL_RX_IDENT, new QTableWidgetItem("RX Ident ")); - ui->vorData->setItem(row, VOR_COL_RX_MORSE, new QTableWidgetItem(Morse::toSpacedUnicode(QString("---- ---- ----")))); + ui->vorData->setItem(row, VOR_COL_RX_MORSE, new QTableWidgetItem(Morse::toSpacedUnicode(morse))); ui->vorData->setItem(row, VOR_COL_VAR_MAG, new QTableWidgetItem("Var (dB) ")); ui->vorData->setItem(row, VOR_COL_REF_MAG, new QTableWidgetItem("Ref (dB) ")); ui->vorData->setItem(row, VOR_COL_MUTE, new QTableWidgetItem("Mute")); @@ -601,12 +602,16 @@ void VORDemodGUI::resizeTable() // Columns in table reordered void VORDemodGUI::vorData_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex) { + (void) oldVisualIndex; + m_settings.m_columnIndexes[logicalIndex] = newVisualIndex; } // Column in table resized (when hidden size is 0) void VORDemodGUI::vorData_sectionResized(int logicalIndex, int oldSize, int newSize) { + (void) oldSize; + m_settings.m_columnSizes[logicalIndex] = newSize; } @@ -619,6 +624,8 @@ void VORDemodGUI::columnSelectMenu(QPoint pos) // Hide/show column when menu selected void VORDemodGUI::columnSelectMenuChecked(bool checked) { + (void) checked; + QAction* action = qobject_cast(sender()); if (action != nullptr) { @@ -999,7 +1006,7 @@ void VORDemodGUI::downloadFinished(const QString& filename, bool success) QUrl dbURL(urlString); m_progressDialog->setLabelText(QString("Downloading %1.").arg(urlString)); m_progressDialog->setValue(m_countryIndex); - QNetworkReply *reply = m_dlm.download(dbURL, vorDBFile); + m_dlm.download(dbURL, vorDBFile); } else { @@ -1028,6 +1035,8 @@ void VORDemodGUI::downloadFinished(const QString& filename, bool success) void VORDemodGUI::on_getOurAirportsVORDB_clicked(bool checked) { + (void) checked; + // Don't try to download while already in progress if (m_progressDialog == nullptr) { @@ -1049,6 +1058,8 @@ void VORDemodGUI::on_getOurAirportsVORDB_clicked(bool checked) void VORDemodGUI::on_getOpenAIPVORDB_clicked(bool checked) { + (void) checked; + // Don't try to download while already in progress if (m_progressDialog == nullptr) { @@ -1066,7 +1077,7 @@ void VORDemodGUI::on_getOpenAIPVORDB_clicked(bool checked) m_progressDialog->setMaximum(sizeof(countryCodes)/sizeof(countryCodes[0])); m_progressDialog->setValue(0); m_progressDialog->setLabelText(QString("Downloading %1.").arg(urlString)); - QNetworkReply *reply = m_dlm.download(dbURL, vorDBFile); + m_dlm.download(dbURL, vorDBFile); } } } @@ -1393,7 +1404,6 @@ void VORDemodGUI::tick() { // Move antenna icon to estimated position QQuickItem *item = ui->map->rootObject(); - QObject *object = item->findChild("map"); QObject *stationObject = item->findChild("station"); if(stationObject != NULL) { diff --git a/plugins/channelrx/demodvor/vordemodgui.h b/plugins/channelrx/demodvor/vordemodgui.h index 5cb7a8c91..741c9a4fe 100644 --- a/plugins/channelrx/demodvor/vordemodgui.h +++ b/plugins/channelrx/demodvor/vordemodgui.h @@ -117,6 +117,7 @@ public: bool setData(const QModelIndex &index, const QVariant& value, int role = Qt::EditRole) override; Qt::ItemFlags flags(const QModelIndex &index) const override { + (void) index; return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable; } diff --git a/plugins/channelrx/demodvor/vordemodplugin.cpp b/plugins/channelrx/demodvor/vordemodplugin.cpp index 36830b287..c7382e118 100644 --- a/plugins/channelrx/demodvor/vordemodplugin.cpp +++ b/plugins/channelrx/demodvor/vordemodplugin.cpp @@ -75,6 +75,8 @@ ChannelGUI* VORDemodPlugin::createRxChannelGUI( DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const { + (void) deviceUISet; + (void) rxChannel; return 0; } #else diff --git a/plugins/channelrx/demodvor/vordemodsink.cpp b/plugins/channelrx/demodvor/vordemodsink.cpp index c5b50fcd6..272836971 100644 --- a/plugins/channelrx/demodvor/vordemodsink.cpp +++ b/plugins/channelrx/demodvor/vordemodsink.cpp @@ -32,25 +32,25 @@ VORDemodSink::VORDemodSink(const VORDemodSettings& settings, int subChannel, MessageQueue *messageQueueToGUI) : + m_channelFrequencyOffset(0), + m_outOfBand(true), m_channelSampleRate(VORDEMOD_CHANNEL_SAMPLE_RATE), m_audioSampleRate(48000), - m_channelFrequencyOffset(0), m_squelchCount(0), m_squelchOpen(false), m_squelchDelayLine(9600), m_magsqSum(0.0f), m_magsqPeak(0.0f), m_magsqCount(0), + m_messageQueueToGUI(messageQueueToGUI), m_volumeAGC(0.003), m_audioFifo(48000), - m_movingAverageIdent(5000), - m_bitTime(0), - m_prevBit(0), - m_varGoertzel(30, VORDEMOD_CHANNEL_SAMPLE_RATE), - m_refGoertzel(30, VORDEMOD_CHANNEL_SAMPLE_RATE), m_refPrev(0.0f), - m_outOfBand(true), - m_messageQueueToGUI(messageQueueToGUI) + m_movingAverageIdent(5000), + m_prevBit(0), + m_bitTime(0), + m_varGoertzel(30, VORDEMOD_CHANNEL_SAMPLE_RATE), + m_refGoertzel(30, VORDEMOD_CHANNEL_SAMPLE_RATE) { m_audioBuffer.resize(1<<14); m_audioBufferFill = 0; @@ -139,14 +139,14 @@ void VORDemodSink::processOneAudioSample(Complex &ci) } else { - if (m_squelchCount < m_audioSampleRate / 10) { + if (m_squelchCount < (unsigned int)m_audioSampleRate / 10) { m_squelchCount++; } } qint16 sample; - m_squelchOpen = (m_squelchCount >= m_audioSampleRate / 20); + m_squelchOpen = (m_squelchCount >= (unsigned int)m_audioSampleRate / 20); if (m_squelchOpen && !m_settings.m_audioMute && !m_settings.m_subChannelSettings.value(m_subChannelId)->m_audioMute) { @@ -313,7 +313,7 @@ void VORDemodSink::processOneSample(Complex &ci) { if (m_ident != "") { - qDebug() << m_ident << " " << Morse::toString(m_ident.simplified()); + qDebug() << m_ident << " " << Morse::toString(m_ident); if (getMessageQueueToGUI()) { VORDemodReport::MsgReportIdent *msg = VORDemodReport::MsgReportIdent::create(m_subChannelId, m_ident);