GNOME Bugzilla – Bug 706404
Minor bug in gtkdoc-mkdb
Last modified: 2014-02-08 18:37:42 UTC
I think I just spotted a minor bug in gtkdoc-mkdb. It needs brackets around the return expression or it doesn't seem to evaluate the "$root ne 'GEnum' and $root ne 'GFlags'" bit. diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in index eb11093..91de12d 100755 --- a/gtkdoc-mkdb.in +++ b/gtkdoc-mkdb.in @@ -5305,7 +5305,7 @@ sub CheckIsObject { my $root = $ObjectRoots{$name}; # Let GBoxed pass as an object here to get -struct appended to the id # and prevent conflicts with sections. - return defined($root) and $root ne 'GEnum' and $root ne 'GFlags'; + return (defined($root) and $root ne 'GEnum' and $root ne 'GFlags'); }
> perl -e "print 'yes' if defined(\$root) and \$root ne 'GEnum';" > perl -e "\$root='abc'; print 'yes' if defined(\$root) and \$root ne 'GEnum';" yes > perl -e "\$root='GEnum'; print 'yes' if defined(\$root) and \$root ne 'GEnum';" How did you notice? or what is not working?
I was getting lots of duplicate IDs for enums and flags in GooCanvas. (These are just wrappers for cairo types so I've had to hack them a bit to get them working and documented OK. So ignore my particular case!) It turned out that CheckIsObject was returning TRUE for enums and flags when it should be returning FALSE. "return" has higher precedence than "and" (which has a very low precedence) so you need the brackets. That ID stuff in gtk-doc has got a bit over-complicated so I don't know if this will break something else.
commit 6a64e762db543e8a04138dcbb37de4817db95e0a Author: Stefan Sauer <ensonic@users.sf.net> Date: Sat Feb 8 19:33:22 2014 +0100 mkdb: fix CheckIsObject return value It needs brackets around the return expression or it doesn't seem to evaluate the "$root ne 'GEnum' and $root ne 'GFlags'" bit. Spotted by Damon Chaplin Fixes #706404