mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 17:55:45 +08:00
Fix cppcheck and compiler warnings
This commit is contained in:
@@ -204,7 +204,7 @@ namespace BlackCore
|
||||
// restart timer, normally it should be started already, paranoia
|
||||
// as I run in "my thread" starting timer should be OK
|
||||
{
|
||||
QMutexLocker lock(&m_mutex);
|
||||
QMutexLocker lock2(&m_mutex);
|
||||
if (m_voiceServerTimer) { m_voiceServerTimer->start(PositionUpdatesMs); }
|
||||
}
|
||||
m_retryConnectAttempt = 0;
|
||||
@@ -498,21 +498,21 @@ namespace BlackCore
|
||||
quint32 roundedFrequencyHz = static_cast<quint32>(qRound(frequencyHz / 1000.0)) * 1000;
|
||||
roundedFrequencyHz = this->getAliasFrequencyHz(roundedFrequencyHz);
|
||||
|
||||
bool updateTransceivers = false;
|
||||
bool update = false;
|
||||
{
|
||||
QMutexLocker lockTransceivers(&m_mutexTransceivers);
|
||||
if (m_transceivers.size() >= id + 1)
|
||||
{
|
||||
if (m_transceivers[id].frequencyHz != roundedFrequencyHz)
|
||||
{
|
||||
updateTransceivers = true;
|
||||
update = true;
|
||||
m_transceivers[id].frequencyHz = roundedFrequencyHz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// outside lock to avoid deadlock
|
||||
if (updateTransceivers)
|
||||
if (update)
|
||||
{
|
||||
this->updateTransceivers(false); // no frequency update
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace BlackCore
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
// posted in QAM thread, reply is nullptr if called from another thread
|
||||
QNetworkReply *reply = sApp->postToNetwork(request, CApplication::NoLogRequestId, QJsonDocument(obj).toJson(),
|
||||
sApp->postToNetwork(request, CApplication::NoLogRequestId, QJsonDocument(obj).toJson(),
|
||||
{
|
||||
this, [ = ](QNetworkReply * nwReply)
|
||||
{
|
||||
@@ -125,7 +125,6 @@ namespace BlackCore
|
||||
callback(m_isAuthenticated);
|
||||
}
|
||||
});
|
||||
Q_UNUSED(reply)
|
||||
}
|
||||
|
||||
PostCallsignResponseDto CApiServerConnection::addCallsign(const QString &callsign)
|
||||
@@ -176,7 +175,7 @@ namespace BlackCore
|
||||
QByteArray receivedData;
|
||||
|
||||
// posted in QAM thread, reply is nullptr if called from another thread
|
||||
QNetworkReply *reply = sApp->getFromNetwork(request,
|
||||
sApp->getFromNetwork(request,
|
||||
{
|
||||
this, [ =, &receivedData ](QNetworkReply * nwReply)
|
||||
{
|
||||
@@ -198,7 +197,6 @@ namespace BlackCore
|
||||
if (loop) { loop->exit(); }
|
||||
}
|
||||
});
|
||||
Q_UNUSED(reply)
|
||||
|
||||
if (loop) { loop->exec(); }
|
||||
return receivedData;
|
||||
@@ -212,7 +210,7 @@ namespace BlackCore
|
||||
QByteArray receivedData;
|
||||
|
||||
// posted in QAM thread, reply is nullptr if called from another thread
|
||||
QNetworkReply *reply = sApp->postToNetwork(request, CApplication::NoLogRequestId, data,
|
||||
sApp->postToNetwork(request, CApplication::NoLogRequestId, data,
|
||||
{
|
||||
this, [ =, &receivedData ](QNetworkReply * nwReply)
|
||||
{
|
||||
@@ -234,7 +232,6 @@ namespace BlackCore
|
||||
if (loop) { loop->exit(); }
|
||||
}
|
||||
});
|
||||
Q_UNUSED(reply)
|
||||
|
||||
if (loop) { loop->exec(); }
|
||||
return receivedData;
|
||||
|
||||
@@ -61,15 +61,15 @@ namespace BlackCore
|
||||
|
||||
if (authenticated)
|
||||
{
|
||||
const QString callsign = m_connection.getCallsign();
|
||||
m_connection.setTokens(m_apiServerConnection->addCallsign(callsign));
|
||||
const QString cs = m_connection.getCallsign();
|
||||
m_connection.setTokens(m_apiServerConnection->addCallsign(cs));
|
||||
m_connection.setTsAuthenticatedToNow();
|
||||
m_connection.createCryptoChannels();
|
||||
m_connection.setTsHeartbeatToNow();
|
||||
this->connectToVoiceServer();
|
||||
// taskServerConnectionCheck.Start();
|
||||
|
||||
CLogMessage(this).info(u"Connected: '%1' to voice server, socket open: %2") << callsign << boolToYesNo(m_udpSocket->isOpen());
|
||||
CLogMessage(this).info(u"Connected: '%1' to voice server, socket open: %2") << cs << boolToYesNo(m_udpSocket->isOpen());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace BlackCore
|
||||
headerBuffer.close();
|
||||
const quint16 headerLength = static_cast<quint16>(headerBuffer.buffer().size());
|
||||
|
||||
const QByteArray dtoNameBuffer = T::getDtoName();
|
||||
const QByteArray dtoShortName = T::getShortDtoName();
|
||||
const quint16 dtoNameLength = static_cast<quint16>(dtoShortName.size());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user