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

2009-01-12 Thread Andrew Paprocki
On Fri, Jan 9, 2009 at 7:11 AM, Michael Natterer mi...@gimp.org wrote: 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

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

2009-01-12 Thread Owen Taylor
On Sat, 2009-01-10 at 14:30 +0200, Andrew W. Nosenko wrote: On Sat, Jan 10, 2009 at 2:06 PM, Brian J. Tarricone bj...@cornell.edu wrote: On Sat, 10 Jan 2009 13:42:31 +0200 Andrew W. Nosenko wrote: First at all, could you provide any real-world example, where min/max restriction on

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

2009-01-10 Thread Andrew W. Nosenko
On Fri, Jan 9, 2009 at 9:23 PM, Michael Natterer mi...@gimp.org wrote: On Fri, 2009-01-09 at 13:03 -0500, Andrew Paprocki wrote: On Fri, Jan 9, 2009 at 7:11 AM, Michael Natterer mi...@gimp.org wrote: Should I patch GParamSpecDouble to have two :1 fields for 'allow_nan', 'allow_inf' and make

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

2009-01-10 Thread Andrew W. Nosenko
On Fri, Jan 9, 2009 at 8:03 PM, Andrew Paprocki and...@ishiboo.com wrote: 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

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

2009-01-10 Thread Andrew W. Nosenko
On Sat, Jan 10, 2009 at 1:29 PM, Andrew W. Nosenko andrew.w.nose...@gmail.com wrote: Excuse me, but you indeed think that anyone, who uses 'double' (as C Sorry, mistyping. but why you think instead of but you indeed think, of course. -- Andrew W. Nosenko andrew.w.nose...@gmail.com

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

2009-01-10 Thread Brian J. Tarricone
On Sat, 10 Jan 2009 13:42:31 +0200 Andrew W. Nosenko wrote: First at all, could you provide any real-world example, where min/max restriction on GParamSpec could be usefull? The reason is simple: when validation fails, the application has no way to know about it and, therefore, to do

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

2009-01-10 Thread Nicola Fontana
On Sat, 10 Jan 2009 13:42:31 +0200 Andrew W. Nosenko andrew.w.nose...@gmail.com wrote: First at all, could you provide any real-world example, where min/max restriction on GParamSpec could be usefull? The reason is simple: when validation fails, the application has no way to know about it

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

2009-01-10 Thread Andrew W. Nosenko
On Sat, Jan 10, 2009 at 2:06 PM, Brian J. Tarricone bj...@cornell.edu wrote: On Sat, 10 Jan 2009 13:42:31 +0200 Andrew W. Nosenko wrote: First at all, could you provide any real-world example, where min/max restriction on GParamSpec could be usefull? The reason is simple: when validation

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

2009-01-10 Thread Andrew W. Nosenko
On Sat, Jan 10, 2009 at 2:06 PM, Brian J. Tarricone bj...@cornell.edu wrote: On Sat, 10 Jan 2009 13:42:31 +0200 Andrew W. Nosenko wrote: First at all, could you provide any real-world example, where min/max restriction on GParamSpec could be usefull? The reason is simple: when validation

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

2009-01-10 Thread Andrew Paprocki
On Sat, Jan 10, 2009 at 7:06 AM, Brian J. Tarricone bj...@cornell.edu wrote: But I don't disagree that NaN or +/- inf should be allowed, assuming a restriction such as the above isn't in place for the particular instance of GParamSpecDouble. This brings up an interesting question.. if the

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

2009-01-10 Thread Yu Feng
Logically this doesn't work, because G_MAXDOUBLE is smaller than Inf and NaN is not part of the ordered double numbers. Why can't one use -Inf and Inf to create GParamSpec? Yu On Sat, 2009-01-10 at 12:17 -0500, Andrew Paprocki wrote: On Sat, Jan 10, 2009 at 7:06 AM, Brian J. Tarricone

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

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 14:30 +0200, Andrew W. Nosenko wrote: On Sat, Jan 10, 2009 at 2:06 PM, Brian J. Tarricone bj...@cornell.edu wrote: On Sat, 10 Jan 2009 13:42:31 +0200 Andrew W. Nosenko wrote: First at all, could you provide any real-world example, where min/max restriction on

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

2009-01-09 Thread Michael Natterer
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. **

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

2009-01-09 Thread Andrew Paprocki
On Fri, Jan 9, 2009 at 7:11 AM, Michael Natterer mi...@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

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

2009-01-09 Thread Michael Natterer
On Fri, 2009-01-09 at 13:03 -0500, Andrew Paprocki wrote: On Fri, Jan 9, 2009 at 7:11 AM, Michael Natterer mi...@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

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

2009-01-08 Thread Andrew Paprocki
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