Ref T189, DWORD is unsigned

This commit is contained in:
Klaus Basan
2017-11-17 00:07:07 +01:00
parent bce79a424d
commit f9c7ce0ea8
2 changed files with 10 additions and 6 deletions

View File

@@ -1584,9 +1584,9 @@ namespace BlackSimPlugin
{
if (!m_traceSendId) { return; }
if (MaxSendIdTraces < 1) { return; }
DWORD dwLastId = -1;
DWORD dwLastId = 0;
const HRESULT hr = SimConnect_GetLastSentPacketID(m_hSimConnect, &dwLastId);
if (hr != S_OK || dwLastId < 0) { return; }
if (hr != S_OK) { return; }
if (m_sendIdTraces.size() > MaxSendIdTraces) { m_sendIdTraces.removeFirst(); }
const TraceFsxSendId trace(dwLastId, simObjectId,
details.isEmpty() ? function : details + ", " + function);

View File

@@ -88,11 +88,15 @@ namespace BlackSimPlugin
//! Ctor
TraceFsxSendId(DWORD sendId, DWORD simObjectId, const QString &comment) :
sendId(sendId), simObjectId(simObjectId), comment(comment)
{ }
{
Q_ASSERT_X(sendId >= 0, Q_FUNC_INFO, "DWORD is unsigned");
Q_ASSERT_X(simObjectId >= 0, Q_FUNC_INFO, "DWORD is unsigned");
}
DWORD sendId = -1; //!< the send id
DWORD simObjectId = -1; //!< corresponding CSimConnectObject
QString comment; //!< where sent
// DWORD is unsigned
DWORD sendId = 0; //!< the send id
DWORD simObjectId = 0; //!< corresponding CSimConnectObject
QString comment; //!< where sent
};
//! FSX Simulator Implementation