1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

Userland: Silence warnings from ElapsedTimer::elapsed() type change

We changed elapsed() to return i64 instead of int as that's what
AK::Time::to_milliseconds() returns, causing a bunch of implicit lossy
conversions in callers. Clean those up with a mix of type changes and
casts.
This commit is contained in:
Andrew Kaster 2023-01-01 22:50:49 -07:00 committed by Linus Groh
parent 48bf0b1408
commit a492e2018d
7 changed files with 9 additions and 10 deletions

View file

@ -327,7 +327,7 @@ static bool prompt_to_stop_profiling(pid_t pid, DeprecatedString const& process_
Core::ElapsedTimer clock;
clock.start();
auto update_timer = Core::Timer::construct(100, [&] {
timer_label.set_text(DeprecatedString::formatted("{:.1} seconds", clock.elapsed() / 1000.0f));
timer_label.set_text(DeprecatedString::formatted("{:.1} seconds", static_cast<float>(clock.elapsed()) / 1000.0f));
});
auto& stop_button = widget->add<GUI::Button>("Stop");