After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 567668 - default GET_PROPERTY method on unichar ParamSpec
default GET_PROPERTY method on unichar ParamSpec
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Glib
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-13 22:19 UTC by Kevin Ryde
Modified: 2010-11-24 20:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch and test case (4.40 KB, patch)
2010-11-23 20:57 UTC, Kevin Ryde
committed Details | Review

Description Kevin Ryde 2009-01-13 22:19:04 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;
Comment 1 Kevin Ryde 2010-11-23 20:57:28 UTC
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.
Comment 2 Torsten Schoenfeld 2010-11-24 20:37:52 UTC
Fixing bugs by removing code, terrific!  Committed, thanks.