[XP driver] Using unsigned for timer call counters, to avoid UB on overflow

This commit is contained in:
Mat Sutcliffe
2020-01-12 17:35:50 +00:00
parent 35cfaebc7d
commit 20a2f3b9e7
2 changed files with 3 additions and 3 deletions

View File

@@ -366,7 +366,7 @@ namespace BlackSimPlugin
}
// FPS
if ((m_slowTimerCalls % 5) == 0)
if ((m_slowTimerCalls % 5u) == 0u)
{
// reading FPS resets average, so we only monitor over some time
m_serviceProxy->getFrameStats(&m_averageFps, &m_simTimeRatio);

View File

@@ -250,8 +250,8 @@ namespace BlackSimPlugin
QTimer m_slowTimer;
QTimer m_airportUpdater;
QTimer m_pendingAddedTimer;
int m_fastTimerCalls = 0; //!< how often called
int m_slowTimerCalls = 0; //!< how often called
unsigned int m_fastTimerCalls = 0; //!< how often called
unsigned int m_slowTimerCalls = 0; //!< how often called
BlackMisc::Aviation::CAirportList m_airportsInRange; //!< aiports in range of own aircraft
BlackMisc::Simulation::CSimulatedAircraftList m_pendingToBeAddedAircraft; //!< aircraft to be added