17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-01 13:44:49 +01:00

refactor(sonar): reduce enum qualification with using enum (cpp:S6177)

Applied only where no unqualified name in the block could be captured by
the introduced enumerators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 16:49:01 +02:00
parent a47c2a6ea0
commit 8afb232f2a
14 changed files with 887 additions and 846 deletions

View File

@@ -240,13 +240,14 @@ TGauge::Load_mapping( cParser &Input, TGauge::scratch_data &Scratchpad ) {
if( true == key.empty() || key == "}" ) { return false; }
// if not block end then the key is followed by assigned value or sub-block
if( key == "type:" ) {
using enum TGaugeType;
auto const gaugetype { Input.getToken<std::string>( true, "\n\r\t ,;" ) };
m_type = gaugetype == "push" ? TGaugeType::push :
gaugetype == "impulse" ? TGaugeType::push :
gaugetype == "return" ? TGaugeType::push :
gaugetype == "delayed" ? TGaugeType::push_delayed :
gaugetype == "pushtoggle" ? TGaugeType::pushtoggle :
TGaugeType::toggle; // "toggle" and default
m_type = gaugetype == "push" ? push :
gaugetype == "impulse" ? push :
gaugetype == "return" ? push :
gaugetype == "delayed" ? push_delayed :
gaugetype == "pushtoggle" ? pushtoggle :
toggle; // "toggle" and default
}
else if( key == "soundinc:" ) {
m_soundfxincrease.deserialize( Input, sound_type::single );