GNOME Bugzilla – Bug 634349
ParamSpec get_default_value() for override and gtype
Last modified: 2010-11-21 20:12:46 UTC
Created attachment 174087 [details] [review] patch and test cases This is a get_default_value() method for the new Glib::Param::Override and Glib::Param::GType, using g_param_value_set_default(). It's done slightly with an eye to replacing the specific get_default_value() methods of the various param types, per other ticket, but to start with it gets override and gtype going.
Created attachment 174357 [details] [review] patch and test cases I see I should conditionalize the g_param_spec_get_redirect_target() bit for glib pre-2.4, and I seem to have accumulated too many unapplied changes to t/e.t, so this one perhaps applies clean against the head :-)
Patch looks good to me. I'm slightly uneasy about the fixed-size stack allocation of the g_unichar_to_utf8 target but that seems to be common enough. Also, instead of newSVpv + SvUTF8_on, you could use newSVGChar. More importantly, though: what prevents us from removing the specialized get_default_value() methods now?
I looked for the glib equiv of MB_LEN_MAX, I mean everything else in the C library has been duplicated, but apparently not that! The specific get_default_value()s would only want the test cases of my other ticket re-diffed, just to make sure the new generic comes out right.
Created attachment 174409 [details] [review] patch and test cases I don't think newSVGChar suits as g_unichar_to_utf8() isn't null terminated, and the default value itself can be nul "\0". I copied from the typemap T_GUNICHAR outputer, so the goodness from there is carried over :-) I added test cases to exercise "0" and "\0" though.
I see. Looks great, committed. Thanks.