mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-18 18:29:40 +02: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:
@@ -210,7 +210,7 @@ drivermouse_input::recall_bindings() {
|
||||
}
|
||||
// TODO: binding targets for mouse buttons
|
||||
|
||||
for( auto &bindingtarget : bindingtargets ) {
|
||||
for( auto const &bindingtarget : bindingtargets ) {
|
||||
// grab command(s) associated with the input pin
|
||||
auto const bindingcommandname{ entryparser.getToken<std::string>() };
|
||||
if( true == bindingcommandname.empty() ) {
|
||||
|
||||
@@ -126,7 +126,7 @@ gamepad_input::poll() {
|
||||
void
|
||||
gamepad_input::bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) const {
|
||||
|
||||
for( auto &bindingtarget : Targets ) {
|
||||
for( auto const &bindingtarget : Targets ) {
|
||||
// grab command(s) associated with the input pin
|
||||
auto const bindingcommandname{ Input.getToken<std::string>() };
|
||||
if( true == bindingcommandname.empty() ) {
|
||||
|
||||
@@ -62,7 +62,7 @@ OnCommandGet(multiplayer::DaneRozkaz *pRozkaz)
|
||||
std::string( pRozkaz->cString + 1, (unsigned)pRozkaz->cString[0] ) + " rcvd" );
|
||||
|
||||
if( Global.iMultiplayer ) {
|
||||
auto *foundevent = simulation::Events.FindEvent( std::string( pRozkaz->cString + 1, (unsigned)pRozkaz->cString[0] ) );
|
||||
auto const *foundevent = simulation::Events.FindEvent( std::string( pRozkaz->cString + 1, (unsigned)pRozkaz->cString[0] ) );
|
||||
if (foundevent != nullptr && (typeid(*foundevent) == typeid(multi_event)
|
||||
|| typeid(*foundevent) == typeid(lights_event)
|
||||
|| foundevent->m_sibling != nullptr)) {
|
||||
@@ -136,7 +136,7 @@ OnCommandGet(multiplayer::DaneRozkaz *pRozkaz)
|
||||
+ " rcvd" );
|
||||
if (pRozkaz->cString[0]) {
|
||||
// jeśli długość nazwy jest niezerowa szukamy pierwszego pojazdu o takiej nazwie i odsyłamy parametry ramką #7
|
||||
auto *vehicle = pRozkaz->cString[1] == '*' ? simulation::Train->Dynamic() : simulation::Vehicles.find(std::string{pRozkaz->cString + 1, (unsigned)pRozkaz->cString[0]});
|
||||
auto const *vehicle = pRozkaz->cString[1] == '*' ? simulation::Train->Dynamic() : simulation::Vehicles.find(std::string{pRozkaz->cString + 1, (unsigned)pRozkaz->cString[0]});
|
||||
if( vehicle != nullptr ) {
|
||||
WyslijNamiary( vehicle ); // wysłanie informacji o pojeździe
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user