17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 04:37:30 +01:00

refactor(sonar): make read-only local references and pointers const (cpp:S5350)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 17:05:09 +02:00
parent 3a6f21eb2d
commit d7edea6fac
16 changed files with 38 additions and 38 deletions

View File

@@ -2116,7 +2116,7 @@ void TTrain::OnCommand_trainbrakeoperationtoggle(TTrain *Train, command_data con
}
}
void TTrain::OnCommand_trainbrakeoperationtoggle(TTrain *Train, command_data const &Command)
void TTrain::OnCommand_trainbrakeoperationtoggle(TTrain *Train, command_data const &Command)
{
if (Command.action == GLFW_PRESS)
@@ -3464,7 +3464,7 @@ void TTrain::update_pantograph_valves()
OnCommand_pantographtoggleselected(Train, Command);
}
}
void TTrain::update_pantograph_valves()
{
using enum operation_t;
@@ -8743,7 +8743,7 @@ bool TTrain::Update(double const Deltatime)
}
}
else
fConverterTimer = 0;
fConverterTimer = 0;
//------------------
auto const lowvoltagepower{mvOccupied->Power24vIsAvailable || mvOccupied->Power110vIsAvailable};
@@ -9169,7 +9169,7 @@ bool TTrain::Update(double const Deltatime)
btLampkaDistanceCounter.Turn(false);
// universal devices state indicators
for (auto &universal : btUniversals)
{
{
universal.Turn(false);
}
}
@@ -10120,7 +10120,7 @@ void TTrain::update_sounds_radio()
radio_message_played = false;
if (false == m_radiomessages.empty())
{
{
// erase completed radio messages from the list
std::erase_if(m_radiomessages, [](auto const &source) { return false == source.second->is_playing(); });
}
@@ -10347,7 +10347,7 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
m_controlmapper.clear();
// clear python screens
m_screens.clear();
// reset sound positions
// reset sound positions
auto const nullvector{glm::vec3()};
std::vector<std::reference_wrapper<std::optional<sound_source>>> sounds = {
dsbReverserKey, dsbNastawnikJazdy, dsbNastawnikBocz, dsbSwitch, dsbPneumaticSwitch, rsHiss, rsHissU, rsHissE, rsHissX, rsHissT, rsSBHiss,
@@ -10355,7 +10355,7 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
m_rainsound, m_radiostop};
for (auto const &sound : sounds)
{
if (sound.get())
if (sound.get())
{
sound.get()->offset(nullvector);
}
@@ -10650,7 +10650,7 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
{rsHuntingNoise, caboffset},
{dsbHasler, caboffset},
{dsbBuzzer, btLampkaCzuwaka.model_offset()},
{dsbBuzzerShp, btLampkaCzuwaka.model_offset()},
{dsbBuzzerShp, btLampkaCzuwaka.model_offset()},
{dsbSlipAlarm, caboffset},
{m_distancecounterclear, btLampkaCzuwaka.model_offset()},
{m_rainsound, caboffset},
@@ -10658,7 +10658,7 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
};
for (auto const &[soundsource, soundoffset] : soundlocations)
{
if (soundsource.get() && soundsource.get()->offset() == nullvector)
if (soundsource.get() && soundsource.get()->offset() == nullvector)
{
soundsource.get()->offset(soundoffset);
}
@@ -11464,7 +11464,7 @@ void TTrain::set_cab_controls(int const Cab)
ggAutoSandButton.PutValue(mvControlled->SandDoseAutoAllow ? 1.f : 0.f);
}
// radio
ggRadioVolumeSelector.PutValue(m_radiovolume);
ggRadioVolumeSelector.PutValue(m_radiovolume);
// finding each inverter - not so optimal, but action ins performed only during changing cabin
bool kier = DynamicObject->DirectionGet() * mvOccupied->CabOccupied > 0;