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



On Fri, 2009-01-09 at 13:03 -0500, Andrew Paprocki wrote:
> On Fri, Jan 9, 2009 at 7:11 AM, Michael Natterer <mitch gimp org> wrote:
> >> 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
> > reasonable.
> >
> > 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 ;)
> 
> Well, it brings up a few issues.. If someone defined a param spec with
> a minimum/maximum value, Nan/Inf/-Inf are separate values that were
> previously disallowed by the current code. So in my mind, making every
> double param suddenly accept these values is a bit awkward. I'm not
> sure how easily GParamSpecDouble can be changed to add new fields so
> that params can specify whether they want to accept nan/inf
> explicitly. That part was more of a RFC.. making the patch is easy but
> I'm not sure what is an acceptable change.

Of course the default would be to not accept these values. We can't
change the behavior of existing code in such a way.

ciao,
--mitch




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