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
Notes: sideshowbarker 2024-07-18 20:16:18 +09:00
26 changed files with 105 additions and 98 deletions

View file

@ -616,7 +616,7 @@ void ClientConnection::handle(const Messages::WindowServer::DidFinishPainting& m
auto& window = *(*it).value;
for (auto& rect : message.rects())
window.invalidate(rect);
if (window.has_alpha_channel() && window.alpha_hit_threshold() > 0.0)
if (window.has_alpha_channel() && window.alpha_hit_threshold() > 0.0f)
WindowManager::the().reevaluate_hovered_window(&window);
WindowSwitcher::the().refresh_if_needed();
@ -940,11 +940,12 @@ OwnPtr<Messages::WindowServer::GetGlobalCursorPositionResponse> ClientConnection
OwnPtr<Messages::WindowServer::SetMouseAccelerationResponse> ClientConnection::handle(const Messages::WindowServer::SetMouseAcceleration& message)
{
if (message.factor() < mouse_accel_min || message.factor() > mouse_accel_max) {
double factor = message.factor();
if (factor < mouse_accel_min || factor > mouse_accel_max) {
did_misbehave("SetMouseAcceleration with bad acceleration factor");
return {};
}
WindowManager::the().set_acceleration_factor(message.factor());
WindowManager::the().set_acceleration_factor(factor);
return make<Messages::WindowServer::SetMouseAccelerationResponse>();
}