Re: gparamspecs.c param_double_validate() doesn't support NaN/Inf?

On Thu, 2009-01-08 at 16:46 -0500, Andrew Paprocki wrote:
> I have a GObject with a double property that I need to be able to set
> NaN to in certain circumstances. Right now, GObject prints out a
> warning when this is done because param_double_validate does not
> handle NaN/Inf explicitly.
>  ** WARNING **: value "NaN" of type `gdouble' is invalid or out of
> range for property `foo' of type `gdouble'
> Should I patch GParamSpecDouble to have two :1 fields for 'allow_nan',
> 'allow_inf' and make param_double_validate do the correct thing with
> isnan()/isinf()?

I think you have a very good point here and that use case is entirely

Would you please file this as enhancement request against GObject?

An attached patch that follows the coding style nicely plus some
code to test the feature in gobject/tests will increase the
probability of this becoming committed significantly ;)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]