From de42cf0668b8c4ebd6732df18b9d6f28a6e77833 Mon Sep 17 00:00:00 2001 From: srcejon Date: Sun, 22 Sep 2024 15:11:58 +0100 Subject: [PATCH] Fix gcc warnings. --- plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp | 10 ++++++---- plugins/feature/map/mapgui.cpp | 7 ++++++- sdrgui/gui/perioddial.cpp | 2 ++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp b/plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp index 3e985cc7b..7e46e3729 100644 --- a/plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp +++ b/plugins/channelrx/remotetcpsink/remotetcpsinksink.cpp @@ -70,8 +70,8 @@ RemoteTCPSinkSink::RemoteTCPSinkSink() : m_iqCorrection(false), m_devSampleRate(0), m_log2Decim(0), - m_gain(), m_rfBW(0), + m_gain(), m_timer(this), m_azimuth(std::numeric_limits::quiet_NaN()), m_elevation(std::numeric_limits::quiet_NaN()) @@ -872,8 +872,10 @@ void RemoteTCPSinkSink::acceptTCPConnection() FLAC__StreamEncoderWriteStatus RemoteTCPSinkSink::flacWrite(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t currentFrame) { + (void) encoder; + char header[1+4]; -//qDebug() << "RemoteTCPSinkSink::flacWrite bytes" << bytes << "samples" << samples; + // Save FLAC header for clients that connect later if ((currentFrame == 0) && (samples == 0)) { @@ -1140,7 +1142,7 @@ void RemoteTCPSinkSink::processCommand() { char *buf = new char[msgLen]; len = client->read((char *)buf, msgLen); - if (len == msgLen) + if (len == (int) msgLen) { bool broadcast = (bool) buf[0]; int i; @@ -1520,7 +1522,7 @@ void RemoteTCPSinkSink::sendDirection(bool isotropic, float azimuth, float eleva RemoteTCPProtocol::encodeUInt32((quint8 *) &msg[1], 4+4+4); RemoteTCPProtocol::encodeUInt32((quint8 *) &msg[1+4], isotropic); RemoteTCPProtocol::encodeFloat((quint8 *) &msg[1+4+4], azimuth); - RemoteTCPProtocol::encodeFloat((quint8 *) &msg[1+4+4+5], elevation); + RemoteTCPProtocol::encodeFloat((quint8 *) &msg[1+4+4+4], elevation); int clients = std::min((int) m_clients.size(), m_settings.m_maxClients); for (int i = 0; i < clients; i++) diff --git a/plugins/feature/map/mapgui.cpp b/plugins/feature/map/mapgui.cpp index a729796cc..f13a53864 100644 --- a/plugins/feature/map/mapgui.cpp +++ b/plugins/feature/map/mapgui.cpp @@ -2779,6 +2779,8 @@ void MapGUI::openKiwiSDR(const QString& url) void MapGUI::kiwiSDRDeviceSetAdded(int index, DeviceAPI *device) { + (void) index; + disconnect(MainCore::instance(), &MainCore::deviceSetAdded, this, &MapGUI::kiwiSDRDeviceSetAdded); // FIXME: Doesn't work if we do it immediately. Settings overwritten? @@ -2848,7 +2850,8 @@ void MapGUI::openSpyServer(const QString& url) void MapGUI::spyServerDeviceSetAdded(int index, DeviceAPI *device) { -qDebug() << "**************** MapGUI::spyServerDeviceSetAdded"; + (void) index; + disconnect(MainCore::instance(), &MainCore::deviceSetAdded, this, &MapGUI::spyServerDeviceSetAdded); // FIXME: Doesn't work if we do it immediately. Settings overwritten? @@ -2881,6 +2884,8 @@ void MapGUI::openSDRangelServer(const QString& url) void MapGUI::sdrangelServerDeviceSetAdded(int index, DeviceAPI *device) { + (void) index; + disconnect(MainCore::instance(), &MainCore::deviceSetAdded, this, &MapGUI::sdrangelServerDeviceSetAdded); // FIXME: Doesn't work if we do it immediately. Settings overwritten? diff --git a/sdrgui/gui/perioddial.cpp b/sdrgui/gui/perioddial.cpp index 207300796..e5658e8c8 100644 --- a/sdrgui/gui/perioddial.cpp +++ b/sdrgui/gui/perioddial.cpp @@ -71,6 +71,8 @@ void PeriodDial::on_spinBox_valueChanged(int boxValue) void PeriodDial::on_units_currentIndexChanged(int index) { + (void) index; + emit valueChanged(value()); }