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
@ -676,10 +676,10 @@ meta_input_settings_native_set_tablet_area (MetaInputSettings *settings,
|
||||
gfloat offset_x;
|
||||
gfloat offset_y;
|
||||
|
||||
scale_x = 1. / (1. - (padding_left + padding_right));
|
||||
scale_y = 1. / (1. - (padding_top + padding_bottom));
|
||||
offset_x = -padding_left * scale_x;
|
||||
offset_y = -padding_top * scale_y;
|
||||
scale_x = (float) (1.0 / (1.0 - (padding_left + padding_right)));
|
||||
scale_y = (float) (1.0 / (1.0 - (padding_top + padding_bottom)));
|
||||
offset_x = (float) (-padding_left * scale_x);
|
||||
offset_y = (float) (-padding_top * scale_y);
|
||||
|
||||
gfloat matrix[6] = { scale_x, 0., offset_x,
|
||||
0., scale_y, offset_y };
|
||||
|
Reference in New Issue
Block a user