mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-01 03:16:38 +02:00
gparamspecs: Fix loss of precision when validating a double-typed pspec
As spotted by `-Wfloat-conversion`. Doubles which could not be accurately represented as floats may have erroneously failed bounds validation. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3405
This commit is contained in:
@@ -691,7 +691,7 @@ param_double_is_valid (GParamSpec *pspec,
|
||||
const GValue *value)
|
||||
{
|
||||
GParamSpecDouble *dspec = G_PARAM_SPEC_DOUBLE (pspec);
|
||||
gfloat oval = value->data[0].v_double;
|
||||
gdouble oval = value->data[0].v_double;
|
||||
|
||||
return dspec->minimum <= oval && oval <= dspec->maximum;
|
||||
}
|
||||
|
Reference in New Issue
Block a user