Ref T488 Fixed cppcheck warnings.

This commit is contained in:
Mat Sutcliffe
2018-12-26 20:55:45 +00:00
parent e709d27e05
commit 7cb581f865
8 changed files with 19 additions and 22 deletions

View File

@@ -118,7 +118,7 @@ namespace BlackSimPlugin
}
}
HRESULT CLobbyClient::connectFs9ToHost(const QString address)
HRESULT CLobbyClient::connectFs9ToHost(const QString &address)
{
HRESULT hr = S_OK;

View File

@@ -31,7 +31,7 @@ namespace BlackSimPlugin
bool canLobbyConnect();
//! Connect FS9 simulator to our host
HRESULT connectFs9ToHost(const QString address);
HRESULT connectFs9ToHost(const QString &address);
private:
//! Alloc and fill up a DPL_CONNECTION_SETTINGS. Call FreeConnectSettings later to free it.

View File

@@ -399,8 +399,7 @@ namespace BlackSimPlugin
read = true;
// time, basically as a heartbeat
QString fsTime;
fsTime.sprintf("%02d:%02d:%02d", localFsTimeRaw[0], localFsTimeRaw[1], localFsTimeRaw[2]);
QString fsTime = QString::asprintf("%02d:%02d:%02d", localFsTimeRaw[0], localFsTimeRaw[1], localFsTimeRaw[2]);
if (cockpit)
{

View File

@@ -114,8 +114,7 @@ namespace BlackSimPlugin
// generic exception warning
if (logGenericExceptionInfo)
{
QString ex;
ex.sprintf("Exception=%lu | SendID=%lu | Index=%lu | cbData=%lu", exceptionId, sendId, index, data);
QString ex = QString::asprintf("Exception=%lu | SendID=%lu | Index=%lu | cbData=%lu", exceptionId, sendId, index, data);
const QString exceptionString(CSimConnectUtilities::simConnectExceptionToString(static_cast<DWORD>(exception->dwException)));
const QString sendIdDetails = simulatorFsxP3D->getSendIdTraceDetails(sendId);
CLogMessage(simulatorFsxP3D).warning(u"Caught simConnect exception: '%1' '%2' | send details: '%3'")