1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +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:
Nicholas-Baron 2021-04-15 00:36:14 -07:00 committed by Andreas Kling
parent 6606d70826
commit 73dd293ec4
26 changed files with 105 additions and 98 deletions

View file

@ -70,7 +70,7 @@ void SprayTool::paint_it()
m_editor->update();
const double minimal_radius = 2;
const double base_radius = minimal_radius * m_thickness;
for (int i = 0; i < M_PI * base_radius * base_radius * (m_density / 100.0f); i++) {
for (int i = 0; i < M_PI * base_radius * base_radius * (m_density / 100.0); i++) {
double radius = base_radius * nrand();
double angle = 2 * M_PI * nrand();
const int xpos = m_last_pos.x() + radius * cos(angle);