mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-26 02:48:54 +02:00
gvalue: Add explicit casts in numeric transform functions
Compiling with `-Wfloat-conversion` warns about a few implicit conversions from `double`/`float` to other numeric types in the `GValue` transform functions. These warnings are correct: value transformations can result in loss of precision. That loss of precision is understood and expected, so add some explicit casts to squash the warnings. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3405
This commit is contained in:
@@ -190,7 +190,8 @@ value_collect_float (GValue *value,
|
||||
GTypeCValue *collect_values,
|
||||
guint collect_flags)
|
||||
{
|
||||
value->data[0].v_float = collect_values[0].v_double;
|
||||
/* This necessarily loses precision */
|
||||
value->data[0].v_float = (gfloat) collect_values[0].v_double;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user