1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-22 17:45:48 -05:00

Lint fixes

This commit is contained in:
srcejon 2024-10-08 22:19:29 +01:00
parent b0a476735d
commit b83d514c3b
9 changed files with 32 additions and 32 deletions

View File

@ -167,7 +167,7 @@ bool RemoteTCPSink::handleMessage(const Message& cmd)
{
if (MsgConfigureRemoteTCPSink::match(cmd))
{
MsgConfigureRemoteTCPSink& cfg = (MsgConfigureRemoteTCPSink&) cmd;
const MsgConfigureRemoteTCPSink& cfg = (const MsgConfigureRemoteTCPSink&) cmd;
qDebug() << "RemoteTCPSink::handleMessage: MsgConfigureRemoteTCPSink";
applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce(), cfg.getRestartRequired());
@ -175,7 +175,7 @@ bool RemoteTCPSink::handleMessage(const Message& cmd)
}
else if (DSPSignalNotification::match(cmd))
{
DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
const DSPSignalNotification& notif = (const DSPSignalNotification&) cmd;
m_basebandSampleRate = notif.getSampleRate();
qDebug() << "RemoteTCPSink::handleMessage: DSPSignalNotification: m_basebandSampleRate:" << m_basebandSampleRate;
@ -191,7 +191,7 @@ bool RemoteTCPSink::handleMessage(const Message& cmd)
}
else if (MsgSendMessage::match(cmd))
{
MsgSendMessage& msg = (MsgSendMessage&) cmd;
const MsgSendMessage& msg = (const MsgSendMessage&) cmd;
// Forward to the sink
m_basebandSink->getInputMessageQueue()->push(MsgSendMessage::create(msg.getAddress(), msg.getPort(), msg.getCallsign(), msg.getText(), msg.getBroadcast()));
@ -199,14 +199,14 @@ bool RemoteTCPSink::handleMessage(const Message& cmd)
}
else if (MsgReportConnection::match(cmd))
{
MsgReportConnection& msg = (MsgReportConnection&) cmd;
const MsgReportConnection& msg = (const MsgReportConnection&) cmd;
m_clients = msg.getClients();
updatePublicListing();
return true;
}
else if (MsgReportDisconnect::match(cmd))
{
MsgReportDisconnect& msg = (MsgReportDisconnect&) cmd;
const MsgReportDisconnect& msg = (const MsgReportDisconnect&) cmd;
m_clients = msg.getClients();
updatePublicListing();
return true;

View File

@ -198,7 +198,7 @@ public:
private:
QString m_error;
MsgError(const QString& error) :
explicit MsgError(const QString& error) :
Message(),
m_error(error)
{ }

View File

@ -125,7 +125,7 @@ bool RemoteTCPSinkBaseband::handleMessage(const Message& cmd)
if (RemoteTCPSink::MsgConfigureRemoteTCPSink::match(cmd))
{
QMutexLocker mutexLocker(&m_mutex);
RemoteTCPSink::MsgConfigureRemoteTCPSink& cfg = (RemoteTCPSink::MsgConfigureRemoteTCPSink&) cmd;
const RemoteTCPSink::MsgConfigureRemoteTCPSink& cfg = (const RemoteTCPSink::MsgConfigureRemoteTCPSink&) cmd;
qDebug() << "RemoteTCPSinkBaseband::handleMessage: MsgConfigureRemoteTCPSink";
applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce(), cfg.getRestartRequired());
@ -134,7 +134,7 @@ bool RemoteTCPSinkBaseband::handleMessage(const Message& cmd)
}
else if (DSPSignalNotification::match(cmd))
{
DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
const DSPSignalNotification& notif = (const DSPSignalNotification&) cmd;
qDebug() << "RemoteTCPSinkBaseband::handleMessage: DSPSignalNotification: basebandSampleRate:" << notif.getSampleRate();
setBasebandSampleRate(notif.getSampleRate());
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(notif.getSampleRate()));
@ -143,7 +143,7 @@ bool RemoteTCPSinkBaseband::handleMessage(const Message& cmd)
}
else if (RemoteTCPSink::MsgSendMessage::match(cmd))
{
RemoteTCPSink::MsgSendMessage& msg = (RemoteTCPSink::MsgSendMessage&) cmd;
const RemoteTCPSink::MsgSendMessage& msg = (const RemoteTCPSink::MsgSendMessage&) cmd;
m_sink.sendMessage(msg.getAddress(), msg.getPort(), msg.getCallsign(), msg.getText(), msg.getBroadcast());

View File

@ -175,7 +175,7 @@ bool RemoteTCPSinkGUI::handleMessage(const Message& message)
{
if (RemoteTCPSink::MsgConfigureRemoteTCPSink::match(message))
{
const RemoteTCPSink::MsgConfigureRemoteTCPSink& cfg = (RemoteTCPSink::MsgConfigureRemoteTCPSink&) message;
const RemoteTCPSink::MsgConfigureRemoteTCPSink& cfg = (const RemoteTCPSink::MsgConfigureRemoteTCPSink&) message;
if ((cfg.getSettings().m_channelSampleRate != m_settings.m_channelSampleRate)
|| (cfg.getSettings().m_sampleBits != m_settings.m_sampleBits)) {
@ -195,7 +195,7 @@ bool RemoteTCPSinkGUI::handleMessage(const Message& message)
}
else if (RemoteTCPSink::MsgReportConnection::match(message))
{
const RemoteTCPSink::MsgReportConnection& report = (RemoteTCPSink::MsgReportConnection&) message;
const RemoteTCPSink::MsgReportConnection& report = (const RemoteTCPSink::MsgReportConnection&) message;
ui->clients->setText(QString("%1/%2").arg(report.getClients()).arg(m_settings.m_maxClients));
QString ip = QString("%1:%2").arg(report.getAddress().toString()).arg(report.getPort());
@ -208,7 +208,7 @@ bool RemoteTCPSinkGUI::handleMessage(const Message& message)
}
else if (RemoteTCPSink::MsgReportDisconnect::match(message))
{
const RemoteTCPSink::MsgReportDisconnect& report = (RemoteTCPSink::MsgReportDisconnect&) message;
const RemoteTCPSink::MsgReportDisconnect& report = (const RemoteTCPSink::MsgReportDisconnect&) message;
ui->clients->setText(QString("%1/%2").arg(report.getClients()).arg(m_settings.m_maxClients));
QString ip = QString("%1:%2").arg(report.getAddress().toString()).arg(report.getPort());
@ -222,7 +222,7 @@ bool RemoteTCPSinkGUI::handleMessage(const Message& message)
}
else if (RemoteTCPSink::MsgReportBW::match(message))
{
const RemoteTCPSink::MsgReportBW& report = (RemoteTCPSink::MsgReportBW&) message;
const RemoteTCPSink::MsgReportBW& report = (const RemoteTCPSink::MsgReportBW&) message;
m_bwAvg(report.getBW());
m_networkBWAvg(report.getNetworkBW());

View File

@ -220,14 +220,14 @@ bool RemoteTCPInput::handleMessage(const Message& message)
else if (MsgConfigureRemoteTCPInput::match(message))
{
qDebug() << "RemoteTCPInput::handleMessage:" << message.getIdentifier();
MsgConfigureRemoteTCPInput& conf = (MsgConfigureRemoteTCPInput&) message;
const MsgConfigureRemoteTCPInput& conf = (const MsgConfigureRemoteTCPInput&) message;
applySettings(conf.getSettings(), conf.getSettingsKeys(), conf.getForce());
return true;
}
else if (RemoteTCPInputTCPHandler::MsgReportConnection::match(message))
{
qDebug() << "RemoteTCPInput::handleMessage:" << message.getIdentifier();
RemoteTCPInputTCPHandler::MsgReportConnection& report = (RemoteTCPInputTCPHandler::MsgReportConnection&) message;
const RemoteTCPInputTCPHandler::MsgReportConnection& report = (const RemoteTCPInputTCPHandler::MsgReportConnection&) message;
if (report.getConnected())
{
qDebug() << "Disconnected - stopping DSP";
@ -237,19 +237,19 @@ bool RemoteTCPInput::handleMessage(const Message& message)
}
else if (MsgSaveReplay::match(message))
{
MsgSaveReplay& cmd = (MsgSaveReplay&) message;
const MsgSaveReplay& cmd = (const MsgSaveReplay&) message;
m_replayBuffer.save(cmd.getFilename(), m_settings.m_devSampleRate, getCenterFrequency());
return true;
}
else if (MsgSendMessage::match(message))
{
MsgSendMessage& msg = (MsgSendMessage&) message;
const MsgSendMessage& msg = (const MsgSendMessage&) message;
m_remoteInputTCPPHandler->getInputMessageQueue()->push(MsgSendMessage::create(msg.getCallsign(), msg.getText(), msg.getBroadcast()));
return true;
}
else if (MsgReportPosition::match(message))
{
MsgReportPosition& report = (MsgReportPosition&) message;
const MsgReportPosition& report = (const MsgReportPosition&) message;
m_latitude = report.getLatitude();
m_longitude = report.getLongitude();
@ -261,7 +261,7 @@ bool RemoteTCPInput::handleMessage(const Message& message)
}
else if (MsgReportDirection::match(message))
{
MsgReportDirection& report = (MsgReportDirection&) message;
const MsgReportDirection& report = (const MsgReportDirection&) message;
m_isotropic = report.getIsotropic();
m_azimuth = report.getAzimuth();

View File

@ -79,10 +79,10 @@ public:
return new MsgStartStop(startStop);
}
protected:
private:
bool m_startStop;
MsgStartStop(bool startStop) :
explicit MsgStartStop(bool startStop) :
Message(),
m_startStop(startStop)
{ }
@ -105,7 +105,7 @@ public:
outBytesAvailable, outSize, outSeconds);
}
protected:
private:
qint64 m_inBytesAvailable;
qint64 m_inSize;
float m_inSeconds;
@ -135,7 +135,7 @@ public:
return new MsgSaveReplay(filename);
}
protected:
private:
QString m_filename;
MsgSaveReplay(const QString& filename) :
@ -156,7 +156,7 @@ public:
return new MsgSendMessage(callsign, text, broadcast);
}
protected:
private:
QString m_callsign;
QString m_text;
bool m_broadcast;

View File

@ -151,7 +151,7 @@ bool RemoteTCPInputGui::handleMessage(const Message& message)
{
if (RemoteTCPInput::MsgConfigureRemoteTCPInput::match(message))
{
const RemoteTCPInput::MsgConfigureRemoteTCPInput& cfg = (RemoteTCPInput::MsgConfigureRemoteTCPInput&) message;
const RemoteTCPInput::MsgConfigureRemoteTCPInput& cfg = (const RemoteTCPInput::MsgConfigureRemoteTCPInput&) message;
if (cfg.getForce()) {
m_settings = cfg.getSettings();
@ -166,7 +166,7 @@ bool RemoteTCPInputGui::handleMessage(const Message& message)
}
else if (RemoteTCPInput::MsgStartStop::match(message))
{
RemoteTCPInput::MsgStartStop& notif = (RemoteTCPInput::MsgStartStop&) message;
const RemoteTCPInput::MsgStartStop& notif = (const RemoteTCPInput::MsgStartStop&) message;
m_connectionError = false;
blockApplySettings(true);
ui->startStop->setChecked(notif.getStartStop());
@ -175,7 +175,7 @@ bool RemoteTCPInputGui::handleMessage(const Message& message)
}
else if (RemoteTCPInput::MsgReportTCPBuffer::match(message))
{
const RemoteTCPInput::MsgReportTCPBuffer& report = (RemoteTCPInput::MsgReportTCPBuffer&) message;
const RemoteTCPInput::MsgReportTCPBuffer& report = (const RemoteTCPInput::MsgReportTCPBuffer&) message;
ui->inGauge->setMaximum((int)report.getInSize());
ui->inGauge->setValue((int)report.getInBytesAvailable());
ui->inBufferLenSecsText->setText(QString("%1s").arg(report.getInSeconds(), 0, 'f', 2));
@ -186,7 +186,7 @@ bool RemoteTCPInputGui::handleMessage(const Message& message)
}
else if (RemoteTCPInputTCPHandler::MsgReportRemoteDevice::match(message))
{
const RemoteTCPInputTCPHandler::MsgReportRemoteDevice& report = (RemoteTCPInputTCPHandler::MsgReportRemoteDevice&) message;
const RemoteTCPInputTCPHandler::MsgReportRemoteDevice& report = (const RemoteTCPInputTCPHandler::MsgReportRemoteDevice&) message;
QHash<RemoteTCPProtocol::Device, QString> devices = {
{RemoteTCPProtocol::RTLSDR_E4000, "RTLSDR E4000"},
{RemoteTCPProtocol::RTLSDR_FC0012, "RTLSDR FC0012"},
@ -301,7 +301,7 @@ bool RemoteTCPInputGui::handleMessage(const Message& message)
}
else if (RemoteTCPInputTCPHandler::MsgReportConnection::match(message))
{
const RemoteTCPInputTCPHandler::MsgReportConnection& report = (RemoteTCPInputTCPHandler::MsgReportConnection&) message;
const RemoteTCPInputTCPHandler::MsgReportConnection& report = (const RemoteTCPInputTCPHandler::MsgReportConnection&) message;
qDebug() << "RemoteTCPInputGui::handleMessage: MsgReportConnection connected: " << report.getConnected();
m_connectionError = !report.getConnected();
updateStatus();

View File

@ -45,7 +45,7 @@ class DeviceAPI;
class FIFO {
public:
FIFO(qsizetype elements = 10);
explicit FIFO(qsizetype elements = 10);
qsizetype write(quint8 *data, qsizetype elements);
qsizetype read(quint8 *data, qsizetype elements);

View File

@ -54,7 +54,7 @@ class SDRBASE_API TCPSocket : public Socket {
public:
TCPSocket(QTcpSocket *socket) ;
explicit TCPSocket(QTcpSocket *socket) ;
qint64 write(const char *data, qint64 length) override;
void flush() override;
qint64 read(char *data, qint64 length) override;
@ -72,7 +72,7 @@ class SDRBASE_API WebSocket : public Socket {
public:
WebSocket(QWebSocket *socket);
explicit WebSocket(QWebSocket *socket);
qint64 write(const char *data, qint64 length) override;
void flush() override;
qint64 read(char *data, qint64 length) override;