17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-04 08:02:20 +01:00

fix(sonar): addressing reliability/security issues

This commit is contained in:
jerrrrycho
2026-10-03 20:21:28 +02:00
parent 51521a135a
commit d88fa5d8e2
32 changed files with 189 additions and 162 deletions

View File

@@ -542,7 +542,7 @@ private:
double fLastVel = 0.0; // prędkość na poprzednio sprawdzonym torze
TTrack *tLast = nullptr; // ostatni analizowany tor
basic_event *eSignSkip = nullptr; // można pominąć ten SBL po zatrzymaniu
static constexpr std::size_t npos{ std::size_t( -1 ) };
static constexpr std::size_t npos{ std::numeric_limits<std::size_t>::max() };
std::size_t SemNextIndex{ npos };
std::size_t SemNextStopIndex{ npos };
double dMoveLen = 0.0; // odległość przejechana od ostatniego sprawdzenia tabelki
@@ -645,9 +645,16 @@ private:
};
inline TOrders TController::OrderCurrentGet() const {
if( OrderPos < 0 || OrderPos >= maxorders ) {
return Wait_for_orders;
}
return OrderList[ OrderPos ];
}
inline TOrders TController::OrderNextGet() const {
return OrderList[ OrderPos + 1 ];
if( OrderPos < 0 || OrderPos >= maxorders ) {
return Wait_for_orders;
}
// the order list wraps around, same as in JumpToNextOrder()
return OrderList[ ( OrderPos + 1 ) % maxorders ];
}