From 72141a3c9b189dc081ab9302a142edca3c3fa337 Mon Sep 17 00:00:00 2001 From: jj Date: Fri, 14 Sep 2012 21:45:01 +0200 Subject: [PATCH] ruby: use implicit init-value -1 for ref-target/refers-to in codegen --- plugins/ruby/codegen.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/ruby/codegen.pl b/plugins/ruby/codegen.pl index 593216d71..8cd06b366 100755 --- a/plugins/ruby/codegen.pl +++ b/plugins/ruby/codegen.pl @@ -788,6 +788,7 @@ sub render_item_number { my $subtype = $item->getAttribute('ld:subtype'); my $meta = $item->getAttribute('ld:meta'); my $initvalue = $item->getAttribute('init-value'); + $initvalue ||= -1 if $item->getAttribute('refers-to') or $item->getAttribute('ref-target'); my $typename = $item->getAttribute('type-name'); undef $typename if ($meta and $meta eq 'bitfield-type'); my $g = $global_types{$typename} if ($typename);