Fix double-promotion warnings

Make it an error.
This commit is contained in:
Behdad Esfahbod 2019-05-07 23:13:38 -07:00
parent 2c7093ed01
commit c2c9d204fa
2 changed files with 7 additions and 6 deletions

View File

@ -120,10 +120,10 @@ struct fvar
const AxisRecord &axis = get_axes ()[axis_index]; const AxisRecord &axis = get_axes ()[axis_index];
info->tag = axis.axisTag; info->tag = axis.axisTag;
info->name_id = axis.axisNameID; info->name_id = axis.axisNameID;
info->default_value = axis.defaultValue / 65536.; info->default_value = axis.defaultValue / 65536.f;
/* Ensure order, to simplify client math. */ /* Ensure order, to simplify client math. */
info->min_value = hb_min (info->default_value, axis.minValue / 65536.); info->min_value = hb_min (info->default_value, axis.minValue / 65536.f);
info->max_value = hb_max (info->default_value, axis.maxValue / 65536.); info->max_value = hb_max (info->default_value, axis.maxValue / 65536.f);
} }
void get_axis_info (unsigned int axis_index, void get_axis_info (unsigned int axis_index,
@ -134,10 +134,10 @@ struct fvar
info->tag = axis.axisTag; info->tag = axis.axisTag;
info->name_id = axis.axisNameID; info->name_id = axis.axisNameID;
info->flags = (hb_ot_var_axis_flags_t) (unsigned int) axis.flags; info->flags = (hb_ot_var_axis_flags_t) (unsigned int) axis.flags;
info->default_value = axis.defaultValue / 65536.; info->default_value = axis.defaultValue / 65536.f;
/* Ensure order, to simplify client math. */ /* Ensure order, to simplify client math. */
info->min_value = hb_min (info->default_value, axis.minValue / 65536.); info->min_value = hb_min (info->default_value, axis.minValue / 65536.f);
info->max_value = hb_max (info->default_value, axis.maxValue / 65536.); info->max_value = hb_max (info->default_value, axis.maxValue / 65536.f);
info->reserved = 0; info->reserved = 0;
} }

View File

@ -65,6 +65,7 @@
#pragma GCC diagnostic error "-Wcast-align" #pragma GCC diagnostic error "-Wcast-align"
#pragma GCC diagnostic error "-Wcast-function-type" #pragma GCC diagnostic error "-Wcast-function-type"
#pragma GCC diagnostic error "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic error "-Wdelete-non-virtual-dtor"
#pragma GCC diagnostic error "-Wdouble-promotion"
#pragma GCC diagnostic error "-Wformat-security" #pragma GCC diagnostic error "-Wformat-security"
#pragma GCC diagnostic error "-Wimplicit-function-declaration" #pragma GCC diagnostic error "-Wimplicit-function-declaration"
#pragma GCC diagnostic error "-Winit-self" #pragma GCC diagnostic error "-Winit-self"