17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-03 06:06:28 +01:00

refactor(sonar): clean up issues reported on PR 209

- remove locals left unused after the dead-store cleanup (cpp:S1481, cpp:S1854)
- unnamed unused parameter (cpp:S1172)
- single-use declarations moved into if init-statements (cpp:S6004)
- auto for casted initialisers (cpp:S5827)
- const references and pointers where nothing is modified (cpp:S5350)
- rename structured bindings shadowed by inner declarations (cpp:S1117)
This commit is contained in:
jerrrrycho
2026-10-11 01:41:01 +02:00
parent 555e5f0aab
commit 2b74c6dba7
17 changed files with 37 additions and 50 deletions

View File

@@ -163,7 +163,7 @@ bool TEventLauncher::check_activation_key() const {
bool result = Console::Pressed(key);
char modifier = static_cast<char>(iKey >> 8);
auto modifier = static_cast<char>(iKey >> 8);
if (modifier & GLFW_MOD_SHIFT)
result &= Global.shiftState;
if (modifier & GLFW_MOD_CONTROL)

View File

@@ -416,7 +416,7 @@ void TTraction::ResistanceCalc(int d, double r, TTractionPowerSource *ps)
if (d >= 0)
{ // podążanie we wskazanym kierunku
TTraction *t = hvNext[d];
TTraction *p;
TTraction const *p;
if (ps)
psPower[d ^ 1] = ps; // podłączenie podanego
else

View File

@@ -227,7 +227,7 @@ void TTrainParameters::NewName(std::string_view NewTrainName)
LocLoad = 0;
}
void TTrainParameters::UpdateVelocity(int Stationcount, double vActual)
void TTrainParameters::UpdateVelocity(int /*Stationcount*/, double vActual)
// zapisywanie prędkości maksymalnej do wcześniejszych odcinków
// wywoływane z numerem ostatniego przetworzonego przystanku
{