GNOME Bugzilla – Bug 567668
default GET_PROPERTY method on unichar ParamSpec
Last modified: 2010-11-24 20:37:55 UTC
In perl-glib 1.200 the program below gets a warning Argument "\x{78}" isn't numeric in subroutine entry at foo.pl line 19. and prints 0 where I hoped it would print 120. I suspect the default GET_PROPERTY func for a subclass doesn't pick out the char default from the paramspec the right way. package Foo; use strict; use warnings; use Glib; use Glib::Object::Subclass Glib::Object::, properties => [Glib::ParamSpec->unichar ('uniprop', 'uniprop', 'Blurb.', 'x', # default Glib::G_PARAM_READWRITE) ]; use strict; use warnings; use Glib; my $foo = Foo->new; print $foo->get('uniprop'), "\n"; exit 0;
Created attachment 175132 [details] [review] patch and test case I believe this can be addressed by using g_param_value_set_default() in the default GET_PROPERTY stuff. I think I proposed this change before just for "less code" (on the mailing list maybe), but it also fixes this actual bug.
Fixing bugs by removing code, terrific! Committed, thanks.