diff options
author | Nicholas-Baron <nicholas.baron.ten@gmail.com> | 2021-04-15 00:36:14 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-16 19:01:54 +0200 |
commit | 73dd293ec4ffcfefae9db8e10eaaa84d4a4be4a8 (patch) | |
tree | 835bd47b8c14f8af6b070f1adbeef630db28d5a9 /Userland/Games/Solitaire | |
parent | 6606d70826b21c803742ed2b971d061b7f3497e3 (diff) | |
download | serenity-73dd293ec4ffcfefae9db8e10eaaa84d4a4be4a8.zip |
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.
Diffstat (limited to 'Userland/Games/Solitaire')
-rw-r--r-- | Userland/Games/Solitaire/SolitaireWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Games/Solitaire/SolitaireWidget.cpp b/Userland/Games/Solitaire/SolitaireWidget.cpp index fbf1cc7eb1..0a2e04c643 100644 --- a/Userland/Games/Solitaire/SolitaireWidget.cpp +++ b/Userland/Games/Solitaire/SolitaireWidget.cpp @@ -92,7 +92,7 @@ void SolitaireWidget::create_new_animation_card() card->set_position({ rand() % (SolitaireWidget::width - Card::width), rand() % (SolitaireWidget::height / 8) }); int x_sgn = card->position().x() > (SolitaireWidget::width / 2) ? -1 : 1; - m_animation = Animation(card, rand_float() + .4, x_sgn * ((rand() % 3) + 2), .6 + rand_float() * .4); + m_animation = Animation(card, rand_float() + .4f, x_sgn * ((rand() % 3) + 2), .6f + rand_float() * .4f); } void SolitaireWidget::start_game_over_animation() |