1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +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

@ -40,7 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
auto loader = maybe_loader.release_value();
Core::ElapsedTimer sample_timer { true };
u64 total_loader_time = 0;
i64 total_loader_time = 0;
int remaining_samples = sample_count > 0 ? sample_count : NumericLimits<int>::max();
unsigned total_loaded_samples = 0;
@ -48,8 +48,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
if (remaining_samples > 0) {
sample_timer = sample_timer.start_new();
auto samples = loader->get_more_samples(min(MAX_CHUNK_SIZE, remaining_samples));
auto elapsed = static_cast<u64>(sample_timer.elapsed());
total_loader_time += static_cast<u64>(elapsed);
total_loader_time += sample_timer.elapsed();
if (!samples.is_error()) {
remaining_samples -= samples.value().size();
total_loaded_samples += samples.value().size();