mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 12:09:19 +02:00
refactor(sonar): make narrowing conversions explicit (cpp:S5276)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,8 +16,8 @@ TTranscripts::AddLine( std::string const &txt, float show, float hide, bool it )
|
||||
if( show == hide ) { return; } // komentarz jest ignorowany
|
||||
|
||||
// TODO: replace the timeangledeg mess with regular time points math
|
||||
show = Global.fTimeAngleDeg + show / 240.0; // jeśli doba to 360, to 1s będzie równe 1/240
|
||||
hide = Global.fTimeAngleDeg + hide / 240.0;
|
||||
show = static_cast<float>(Global.fTimeAngleDeg + show / 240.0); // jeśli doba to 360, to 1s będzie równe 1/240
|
||||
hide = static_cast<float>(Global.fTimeAngleDeg + hide / 240.0);
|
||||
|
||||
TTranscript transcript;
|
||||
transcript.asText = txt;
|
||||
@@ -49,14 +49,14 @@ TTranscripts::Add( std::string const &txt, bool backgorund ) {
|
||||
>> begin
|
||||
>> end
|
||||
>> transcript;
|
||||
AddLine( transcript, 0.10 * begin, 0.12 * end, false );
|
||||
AddLine( transcript, static_cast<float>(0.10 * begin), static_cast<float>(0.12 * end), false );
|
||||
}
|
||||
// try to handle malformed(?) cases with no show/hide times
|
||||
std::string transcript; parser >> transcript;
|
||||
while( false == transcript.empty() ) {
|
||||
|
||||
// WriteLog( "Transcript text with no display/hide times: \"" + transcript + "\"" );
|
||||
AddLine( transcript, 0.0, 0.12 * transcript.size(), false );
|
||||
AddLine( transcript, 0.0, static_cast<float>(0.12 * static_cast<double>(transcript.size())), false );
|
||||
transcript = ""; parser >> transcript;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user