Compile with -Wfloat-conversion
This means we'll get warnings whenever a floating point value looses precision, e.g. gets implicitly casted to an integer. It also warns when implicitly casting double's to float's, which arguably is less of a problem, but there are no warning for just float/double to int. This would have caught https://gitlab.gnome.org/GNOME/mutter/-/issues/3530. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3822>
This commit is contained in:

committed by
Sebastian Wick

parent
d5bc883712
commit
422ee4515d
@ -110,7 +110,7 @@ cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite,
|
||||
float texture_scale;
|
||||
|
||||
if (meta_backend_is_stage_views_scaled (backend))
|
||||
texture_scale = 1.0 / surface_scale;
|
||||
texture_scale = 1.0f / surface_scale;
|
||||
else
|
||||
texture_scale = (meta_logical_monitor_get_scale (logical_monitor) /
|
||||
surface_scale);
|
||||
|
Reference in New Issue
Block a user