mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 09:04:30 +00:00
Everywhere: Add -Wdouble-promotion warning
This warning informs of float-to-double conversions. The best solution seems to be to do math *either* in 32-bit *or* in 64-bit, and only to cross over when absolutely necessary.
This commit is contained in:
committed by
Andreas Kling
parent
6606d70826
commit
73dd293ec4
@@ -74,7 +74,7 @@ private:
|
||||
m_last_cpu_idle = idle;
|
||||
float cpu = (float)busy_diff / (float)(busy_diff + idle_diff);
|
||||
m_history.enqueue(cpu);
|
||||
m_tooltip = String::format("CPU usage: %.1f%%", 100 * cpu);
|
||||
m_tooltip = String::formatted("CPU usage: {:.1}%", 100 * cpu);
|
||||
} else {
|
||||
m_history.enqueue(-1);
|
||||
m_tooltip = StringView("Unable to determine CPU usage");
|
||||
@@ -87,7 +87,7 @@ private:
|
||||
double total_memory = allocated + available;
|
||||
double memory = (double)allocated / total_memory;
|
||||
m_history.enqueue(memory);
|
||||
m_tooltip = String::format("Memory: %.1f MiB of %.1f MiB in use", (float)(allocated / MiB), (float)(total_memory / MiB));
|
||||
m_tooltip = String::formatted("Memory: {} MiB of {:.1} MiB in use", allocated / MiB, total_memory / MiB);
|
||||
} else {
|
||||
m_history.enqueue(-1);
|
||||
m_tooltip = StringView("Unable to determine memory usage");
|
||||
|
||||
Reference in New Issue
Block a user