mirror of
https://github.com/ashaduri/gsmartcontrol.git
synced 2026-09-25 13:25:37 +00:00
Fix narrowing conversion: use int instead of int8_t for remaining_segments
Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
This commit is contained in:
co-authored by
ashaduri
parent
dd0b9fe8ea
commit
b1ccfd43e0
@@ -101,7 +101,7 @@ std::chrono::seconds SelfTest::get_remaining_seconds() const
|
||||
|
||||
// Estimate remaining time based on observed average and remaining segments
|
||||
// remaining_percent_ goes from 100 (start) to 0 (end), in 10% decrements
|
||||
const int8_t remaining_segments = (remaining_percent_ + 9) / 10; // round up
|
||||
const int remaining_segments = (remaining_percent_ + 9) / 10; // round up
|
||||
const double estimated_remaining = avg_segment_duration * remaining_segments - timer_.elapsed();
|
||||
|
||||
const auto rem_rounded = static_cast<int64_t>(std::round(estimated_remaining));
|
||||
|
||||
Reference in New Issue
Block a user