mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T488 Fixed cppcheck warnings.
This commit is contained in:
@@ -345,9 +345,8 @@ namespace BlackGui
|
||||
f2Stations = sGui->getIContextNetwork()->getOnlineStationsForFrequency(freq2, spacing);
|
||||
}
|
||||
|
||||
QString f1n, f2n;
|
||||
f1n.sprintf("%03.3f", freq1.valueRounded(CFrequencyUnit::MHz(), 3));
|
||||
f2n.sprintf("%03.3f", freq2.valueRounded(CFrequencyUnit::MHz(), 3));
|
||||
QString f1n = QString::asprintf("%03.3f", freq1.valueRounded(CFrequencyUnit::MHz(), 3));
|
||||
QString f2n = QString::asprintf("%03.3f", freq2.valueRounded(CFrequencyUnit::MHz(), 3));
|
||||
QString f1 = QStringLiteral("COM1: %1").arg(f1n);
|
||||
QString f2 = QStringLiteral("COM2: %1").arg(f2n);
|
||||
if (f1Stations.size() == 1)
|
||||
|
||||
@@ -20,15 +20,14 @@ using namespace BlackMisc::Input;
|
||||
|
||||
namespace BlackInput
|
||||
{
|
||||
CJoystickDevice::CJoystickDevice(DirectInput8Ptr directInputPtr, const DIDEVICEINSTANCE *pdidInstance, QObject *parent)
|
||||
: QObject(parent),
|
||||
m_directInput(directInputPtr)
|
||||
{
|
||||
m_deviceName = QString::fromWCharArray(pdidInstance->tszInstanceName);
|
||||
m_productName = QString::fromWCharArray(pdidInstance->tszProductName);
|
||||
m_guidDevice = pdidInstance->guidInstance;
|
||||
m_guidProduct = pdidInstance->guidProduct;
|
||||
}
|
||||
CJoystickDevice::CJoystickDevice(DirectInput8Ptr directInputPtr, const DIDEVICEINSTANCE *pdidInstance, QObject *parent) :
|
||||
QObject(parent),
|
||||
m_guidDevice(pdidInstance->guidInstance),
|
||||
m_guidProduct(pdidInstance->guidProduct),
|
||||
m_deviceName(QString::fromWCharArray(pdidInstance->tszInstanceName)),
|
||||
m_productName(QString::fromWCharArray(pdidInstance->tszProductName)),
|
||||
m_directInput(directInputPtr)
|
||||
{}
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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'")
|
||||
|
||||
@@ -25,9 +25,10 @@ namespace XSwiftBus
|
||||
{
|
||||
public:
|
||||
//! 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));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@ namespace XSwiftBus
|
||||
virtual ~CDrawable() { hide(); }
|
||||
|
||||
//! Register the draw callback.
|
||||
virtual void show()
|
||||
void show()
|
||||
{
|
||||
XPLMRegisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
||||
}
|
||||
|
||||
//! Unregister the draw callback.
|
||||
virtual void hide()
|
||||
void hide()
|
||||
{
|
||||
XPLMUnregisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user