From 5d24bf9086d3a25baffdd81a6d063b1396484d3d Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Wed, 9 Jun 2021 17:14:56 +0100 Subject: [PATCH] Fix gcc warnings --- plugins/channelrx/noisefigure/noisefigure.cpp | 3 ++- .../channelrx/noisefigure/noisefigurecontroldialog.h | 2 +- plugins/channelrx/noisefigure/noisefigureenrdialog.h | 2 +- plugins/channelrx/noisefigure/noisefiguregui.cpp | 1 + plugins/channelrx/noisefigure/noisefiguresink.cpp | 1 + sdrbase/util/visa.cpp | 12 ++++++------ 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/channelrx/noisefigure/noisefigure.cpp b/plugins/channelrx/noisefigure/noisefigure.cpp index f4f8eec65..b98b0df24 100644 --- a/plugins/channelrx/noisefigure/noisefigure.cpp +++ b/plugins/channelrx/noisefigure/noisefigure.cpp @@ -148,7 +148,8 @@ void NoiseFigure::processVISA(QStringList commands) if (command.endsWith("?")) { char buf[1024] = ""; - m_visa.viScanf(m_session, "%t", buf); + char format[] = "%t"; + m_visa.viScanf(m_session, format, buf); qDebug() << "VISA <-: " << buf; } } diff --git a/plugins/channelrx/noisefigure/noisefigurecontroldialog.h b/plugins/channelrx/noisefigure/noisefigurecontroldialog.h index 1a0fd322f..852226608 100644 --- a/plugins/channelrx/noisefigure/noisefigurecontroldialog.h +++ b/plugins/channelrx/noisefigure/noisefigurecontroldialog.h @@ -18,7 +18,7 @@ #ifndef INCLUDE_NOISEFIGURECONTROLDIALOG_H #define INCLUDE_NOISEFIGURECONTROLDIALOG_H -#include "ui_NoiseFigureControlDialog.h" +#include "ui_noisefigurecontroldialog.h" #include "noisefiguresettings.h" class NoiseFigureControlDialog : public QDialog { diff --git a/plugins/channelrx/noisefigure/noisefigureenrdialog.h b/plugins/channelrx/noisefigure/noisefigureenrdialog.h index 5442a796d..84d157b31 100644 --- a/plugins/channelrx/noisefigure/noisefigureenrdialog.h +++ b/plugins/channelrx/noisefigure/noisefigureenrdialog.h @@ -18,7 +18,7 @@ #ifndef INCLUDE_NOISEFIGUREENRDIALOG_H #define INCLUDE_NOISEFIGUREENRDIALOG_H -#include "ui_NoiseFigureENRDialog.h" +#include "ui_noisefigureenrdialog.h" #include "noisefiguresettings.h" class NoiseFigureENRDialog : public QDialog { diff --git a/plugins/channelrx/noisefigure/noisefiguregui.cpp b/plugins/channelrx/noisefigure/noisefiguregui.cpp index a1fae2d9a..ba3578768 100644 --- a/plugins/channelrx/noisefigure/noisefiguregui.cpp +++ b/plugins/channelrx/noisefigure/noisefiguregui.cpp @@ -51,6 +51,7 @@ public: virtual QString displayText(const QVariant &value, const QLocale &locale) const override { + (void) locale; return QString::number(value.toDouble(), 'f', m_precision); } diff --git a/plugins/channelrx/noisefigure/noisefiguresink.cpp b/plugins/channelrx/noisefigure/noisefiguresink.cpp index 035fe2995..b914389ee 100644 --- a/plugins/channelrx/noisefigure/noisefiguresink.cpp +++ b/plugins/channelrx/noisefigure/noisefiguresink.cpp @@ -122,6 +122,7 @@ void NoiseFigureSink::processOneSample(Complex &ci) void NoiseFigureSink::applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force) { + (void) force; qDebug() << "NoiseFigureSink::applyChannelSettings:" << " channelSampleRate: " << channelSampleRate << " channelFrequencyOffset: " << channelFrequencyOffset; diff --git a/sdrbase/util/visa.cpp b/sdrbase/util/visa.cpp index f51d6668d..eee60b1c5 100644 --- a/sdrbase/util/visa.cpp +++ b/sdrbase/util/visa.cpp @@ -37,17 +37,17 @@ VISA::VISA() : #ifdef _MSC_VER const char *visaName = "visa32.dll"; // Loads visa64.dll on WIN64 #else - const char *visaName = "visakt32.so"; // Keysight library + const char *visaName = "libktvisa32.so"; // Keysight library #endif visaLibrary = libraryOpen(visaName); if (visaLibrary) { - viOpenDefaultRM = (ViStatus (WINAPI *)(ViPSession)) libraryFunc(visaLibrary, "viOpenDefaultRM"); - viOpen = (ViStatus (WINAPI *)(ViSession sesn, ViRsrc name, ViAccessMode mode, ViUInt32 timeout, ViPSession vi)) libraryFunc(visaLibrary, "viOpen"); - viClose = (ViStatus (WINAPI *)(ViObject vi)) libraryFunc(visaLibrary, "viClose"); - viPrintf = (ViStatus (WINAPI *) (ViSession vi, ViString writeFmt, ...)) libraryFunc(visaLibrary, "viPrintf"); - viScanf = (ViStatus (WINAPI *) (ViSession vi, ViString writeFmt, ...)) libraryFunc(visaLibrary, "viScanf"); + viOpenDefaultRM = (ViStatus (*)(ViPSession)) libraryFunc(visaLibrary, "viOpenDefaultRM"); + viOpen = (ViStatus (*)(ViSession sesn, ViRsrc name, ViAccessMode mode, ViUInt32 timeout, ViPSession vi)) libraryFunc(visaLibrary, "viOpen"); + viClose = (ViStatus (*)(ViObject vi)) libraryFunc(visaLibrary, "viClose"); + viPrintf = (ViStatus (*) (ViSession vi, ViString writeFmt, ...)) libraryFunc(visaLibrary, "viPrintf"); + viScanf = (ViStatus (*) (ViSession vi, ViString writeFmt, ...)) libraryFunc(visaLibrary, "viScanf"); if (viOpenDefaultRM && viOpen && viClose && viPrintf) { m_available = true;