Re: fetching unset GParamSpec property



Torsten Schoenfeld wrote:

Looking at Kevin's recent test patch prompted me to think about this again.  I
now think that what you write above applies to SvFoo converters, but not to
newSVFoo.  SvFoo does SV*->Foo* in which case it is important that the result is
not NULL unless an _ornull variant was used, for the reasons you describe.  But
newSVFoo does Foo*->SV* and returning undef for NULL here is not a big problem.
 In fact, I'm unable to find any Foo*->SV* converter in Glib that chokes on
NULL.  Most simply return undef.

So I think newSVGParamSpec should do the same: return undef for NULL.  In that
case the change to gperl_sv_from_value can be reverted, and the various
Glib::ParamSpec constructors will also automatically start returning undef for
invalid input.

I just committed this change, for the reasons described above.  newSVGParamSpec
now returns undef for NULL, and gperl_sv_from_value doesn't special-case NULL
GParamSpecs.

-Torsten



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