17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 18:39:14 +01:00

refactor(sonar): rename locals that shadow outer declarations (cpp:S1117)

Only local variables and definition parameters are renamed; shadowing
struct fields and enumerators in headers are left for a separate change.
This commit is contained in:
jerrrrycho
2026-10-10 16:45:39 +02:00
parent 846cb12430
commit e524d38128
17 changed files with 297 additions and 297 deletions

View File

@@ -157,11 +157,11 @@ bool TMemCell::Compare( std::string const &szTestText, double const fTestValue1,
if( TestFlag( CheckMask, basic_event::flags::text ) ) {
// porównać teksty
auto range = szTestText.find( '*' );
auto wildcardpos = szTestText.find( '*' );
auto const result { (
range == std::string::npos ?
wildcardpos == std::string::npos ?
compare( szText, szTestText, TextOperator ) :
compare( szText.substr( 0, range ), szTestText.substr( 0, range ), TextOperator ) ) };
compare( szText.substr( 0, wildcardpos ), szTestText.substr( 0, wildcardpos ), TextOperator ) ) };
checkpassed |= result;
checkfailed |= !result;
}

View File

@@ -163,7 +163,7 @@ TTraction::endpoints() const {
}
std::size_t
TTraction::create_geometry( gfx::geometrybank_handle const &Bank ) {
TTraction::create_geometry( gfx::geometrybank_handle const &Geometrybank ) {
if( m_geometry != null_handle ) {
return GfxRenderer->Vertices( m_geometry ).size() / 2;
}
@@ -343,7 +343,7 @@ TTraction::create_geometry( gfx::geometrybank_handle const &Bank ) {
auto const elementcount = vertices.size() / 2;
gfx::userdata_array empty_userdata{};
m_geometry = GfxRenderer->Insert( vertices, empty_userdata, Bank, GL_LINES );
m_geometry = GfxRenderer->Insert( vertices, empty_userdata, Geometrybank, GL_LINES );
return elementcount;
}

View File

@@ -227,7 +227,7 @@ void TTrainParameters::NewName(std::string const &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
{
@@ -254,7 +254,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
bool EndTable;
double vActual;
int ConversionError = 0;
int conversionerror = 0;
EndTable = false;
if (TrainName == "")
{ // jeśli pusty rozkład
@@ -277,15 +277,15 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
{
TTVmax = vmax; // Ra 2014-07: zamiast rozkładu można podać Vmax
UpdateVelocity(StationCount, vmax); // ograniczenie do prędkości startowej
ConversionError = 0;
conversionerror = 0;
}
else
ConversionError = -8; /*Ra: ten błąd jest niepotrzebny*/
conversionerror = -8; /*Ra: ten błąd jest niepotrzebny*/
}
else
{ /*analiza rozkładu jazdy*/
ConversionError = 0;
while (fin.good() && !(ConversionError != 0 || EndTable))
conversionerror = 0;
while (fin.good() && !(conversionerror != 0 || EndTable))
{
std::getline(fin, lines); /*wczytanie linii*/
if (contains( lines, "___________________") ) /*linia pozioma górna*/
@@ -353,7 +353,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
win1250_to_ascii( Relation1 );
}
else
ConversionError = -5;
conversionerror = -5;
while (fin >> s || !fin.bad())
{
if (s == "Relacja")
@@ -408,7 +408,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
if (s == "[")
fin >> s;
else
ConversionError = -4;
conversionerror = -4;
if (false == contains( s,"|") )
{
record->km = static_cast<float>(atof(s.c_str()));
@@ -565,7 +565,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
}
}
// jeśli nazwa pierwszego zgodna z relacją
if (ConversionError == 0 && TimeTable[1].StationName == Relation1 && TimeTable[1].Ah < 0) // a nie podany czas przyjazdu
if (conversionerror == 0 && TimeTable[1].StationName == Relation1 && TimeTable[1].Ah < 0) // a nie podany czas przyjazdu
{ // to mamy zatrzymanie na pierwszym, a nie przelot
TimeTable[1].Ah = TimeTable[1].Dh;
TimeTable[1].Am = TimeTable[1].Dm;
@@ -593,7 +593,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
}
}
}
return ConversionError == 0;
return conversionerror == 0;
}
void