17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-20 08:05:55 +02:00

refactor(sonar): remove redundant casts (cpp:S1905)

This commit is contained in:
jerrrrycho
2026-10-10 15:06:37 +02:00
parent 807d6822a5
commit 07d94806b7
3 changed files with 6 additions and 6 deletions

View File

@@ -467,7 +467,7 @@ void uart_input::poll()
}
if( true == conf.trainenable ) {
// train brake
double const position { (float)( ( (uint16_t)buffer[ 8 ] | (uint16_t)buffer[9] << 8 ) - conf.mainbrakemin ) / ( conf.mainbrakemax - conf.mainbrakemin ) };
double const position { ( ( (uint16_t)buffer[ 8 ] | (uint16_t)buffer[9] << 8 ) - conf.mainbrakemin ) / ( conf.mainbrakemax - conf.mainbrakemin ) };
relay.post(
user_command::trainbrakeset,
position,
@@ -478,7 +478,7 @@ void uart_input::poll()
}
if( true == conf.localenable ) {
// independent brake
double const position { (float)( ( (uint16_t)buffer[ 10 ] | (uint16_t)buffer[11] << 8 ) - conf.localbrakemin ) / ( conf.localbrakemax - conf.localbrakemin ) };
double const position { ( ( (uint16_t)buffer[ 10 ] | (uint16_t)buffer[11] << 8 ) - conf.localbrakemin ) / ( conf.localbrakemax - conf.localbrakemin ) };
relay.post(
user_command::independentbrakeset,
position,
@@ -509,7 +509,7 @@ void uart_input::poll()
if (true == conf.dynamicenable)
{
// dynamic brake 8 bit
double const position{(float)(buffer[13] - conf.dynamicbrakemin) / (conf.dynamicbrakemax - conf.dynamicbrakemin)};
double const position{(buffer[13] - conf.dynamicbrakemin) / (conf.dynamicbrakemax - conf.dynamicbrakemin)};
relay.post(
user_command::dynamicbrakecontrollerset,