mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 11:25:33 +08:00
Ref T488 Fixed cppcheck warnings.
This commit is contained in:
@@ -345,9 +345,8 @@ namespace BlackGui
|
|||||||
f2Stations = sGui->getIContextNetwork()->getOnlineStationsForFrequency(freq2, spacing);
|
f2Stations = sGui->getIContextNetwork()->getOnlineStationsForFrequency(freq2, spacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString f1n, f2n;
|
QString f1n = QString::asprintf("%03.3f", freq1.valueRounded(CFrequencyUnit::MHz(), 3));
|
||||||
f1n.sprintf("%03.3f", freq1.valueRounded(CFrequencyUnit::MHz(), 3));
|
QString f2n = QString::asprintf("%03.3f", freq2.valueRounded(CFrequencyUnit::MHz(), 3));
|
||||||
f2n.sprintf("%03.3f", freq2.valueRounded(CFrequencyUnit::MHz(), 3));
|
|
||||||
QString f1 = QStringLiteral("COM1: %1").arg(f1n);
|
QString f1 = QStringLiteral("COM1: %1").arg(f1n);
|
||||||
QString f2 = QStringLiteral("COM2: %1").arg(f2n);
|
QString f2 = QStringLiteral("COM2: %1").arg(f2n);
|
||||||
if (f1Stations.size() == 1)
|
if (f1Stations.size() == 1)
|
||||||
|
|||||||
@@ -20,15 +20,14 @@ using namespace BlackMisc::Input;
|
|||||||
|
|
||||||
namespace BlackInput
|
namespace BlackInput
|
||||||
{
|
{
|
||||||
CJoystickDevice::CJoystickDevice(DirectInput8Ptr directInputPtr, const DIDEVICEINSTANCE *pdidInstance, QObject *parent)
|
CJoystickDevice::CJoystickDevice(DirectInput8Ptr directInputPtr, const DIDEVICEINSTANCE *pdidInstance, QObject *parent) :
|
||||||
: QObject(parent),
|
QObject(parent),
|
||||||
m_directInput(directInputPtr)
|
m_guidDevice(pdidInstance->guidInstance),
|
||||||
{
|
m_guidProduct(pdidInstance->guidProduct),
|
||||||
m_deviceName = QString::fromWCharArray(pdidInstance->tszInstanceName);
|
m_deviceName(QString::fromWCharArray(pdidInstance->tszInstanceName)),
|
||||||
m_productName = QString::fromWCharArray(pdidInstance->tszProductName);
|
m_productName(QString::fromWCharArray(pdidInstance->tszProductName)),
|
||||||
m_guidDevice = pdidInstance->guidInstance;
|
m_directInput(directInputPtr)
|
||||||
m_guidProduct = pdidInstance->guidProduct;
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
bool CJoystickDevice::init(HWND helperWindow)
|
bool CJoystickDevice::init(HWND helperWindow)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ namespace BlackSimPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CLobbyClient::connectFs9ToHost(const QString address)
|
HRESULT CLobbyClient::connectFs9ToHost(const QString &address)
|
||||||
{
|
{
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace BlackSimPlugin
|
|||||||
bool canLobbyConnect();
|
bool canLobbyConnect();
|
||||||
|
|
||||||
//! Connect FS9 simulator to our host
|
//! Connect FS9 simulator to our host
|
||||||
HRESULT connectFs9ToHost(const QString address);
|
HRESULT connectFs9ToHost(const QString &address);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Alloc and fill up a DPL_CONNECTION_SETTINGS. Call FreeConnectSettings later to free it.
|
//! Alloc and fill up a DPL_CONNECTION_SETTINGS. Call FreeConnectSettings later to free it.
|
||||||
|
|||||||
@@ -399,8 +399,7 @@ namespace BlackSimPlugin
|
|||||||
read = true;
|
read = true;
|
||||||
|
|
||||||
// time, basically as a heartbeat
|
// time, basically as a heartbeat
|
||||||
QString fsTime;
|
QString fsTime = QString::asprintf("%02d:%02d:%02d", localFsTimeRaw[0], localFsTimeRaw[1], localFsTimeRaw[2]);
|
||||||
fsTime.sprintf("%02d:%02d:%02d", localFsTimeRaw[0], localFsTimeRaw[1], localFsTimeRaw[2]);
|
|
||||||
|
|
||||||
if (cockpit)
|
if (cockpit)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -114,8 +114,7 @@ namespace BlackSimPlugin
|
|||||||
// generic exception warning
|
// generic exception warning
|
||||||
if (logGenericExceptionInfo)
|
if (logGenericExceptionInfo)
|
||||||
{
|
{
|
||||||
QString ex;
|
QString ex = QString::asprintf("Exception=%lu | SendID=%lu | Index=%lu | cbData=%lu", exceptionId, sendId, index, data);
|
||||||
ex.sprintf("Exception=%lu | SendID=%lu | Index=%lu | cbData=%lu", exceptionId, sendId, index, data);
|
|
||||||
const QString exceptionString(CSimConnectUtilities::simConnectExceptionToString(static_cast<DWORD>(exception->dwException)));
|
const QString exceptionString(CSimConnectUtilities::simConnectExceptionToString(static_cast<DWORD>(exception->dwException)));
|
||||||
const QString sendIdDetails = simulatorFsxP3D->getSendIdTraceDetails(sendId);
|
const QString sendIdDetails = simulatorFsxP3D->getSendIdTraceDetails(sendId);
|
||||||
CLogMessage(simulatorFsxP3D).warning(u"Caught simConnect exception: '%1' '%2' | send details: '%3'")
|
CLogMessage(simulatorFsxP3D).warning(u"Caught simConnect exception: '%1' '%2' | send details: '%3'")
|
||||||
|
|||||||
@@ -25,9 +25,10 @@ namespace XSwiftBus
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Constructor.
|
//! Constructor.
|
||||||
CCommand(const char *name, const char *description, std::function<void()> handler) : m_handler(handler)
|
CCommand(const char *name, const char *description, std::function<void()> handler) :
|
||||||
|
m_handler(handler),
|
||||||
|
m_command(XPLMCreateCommand(name, description))
|
||||||
{
|
{
|
||||||
m_command = XPLMCreateCommand(name, description);
|
|
||||||
XPLMRegisterCommandHandler(m_command, callback, false, static_cast<void*>(this));
|
XPLMRegisterCommandHandler(m_command, callback, false, static_cast<void*>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ namespace XSwiftBus
|
|||||||
virtual ~CDrawable() { hide(); }
|
virtual ~CDrawable() { hide(); }
|
||||||
|
|
||||||
//! Register the draw callback.
|
//! Register the draw callback.
|
||||||
virtual void show()
|
void show()
|
||||||
{
|
{
|
||||||
XPLMRegisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
XPLMRegisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Unregister the draw callback.
|
//! Unregister the draw callback.
|
||||||
virtual void hide()
|
void hide()
|
||||||
{
|
{
|
||||||
XPLMUnregisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
XPLMUnregisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user