ruby: fix codegen enum base-types

develop
jj 2012-06-15 21:02:04 +02:00
parent cfdf941c52
commit 0bdae68294
1 changed files with 2 additions and 0 deletions

@ -687,6 +687,7 @@ sub render_item_number {
my $initvalue = $item->getAttribute('init-value');
my $typename = $item->getAttribute('type-name');
undef $typename if ($meta and $meta eq 'bitfield-type');
my $g = $global_types{$typename} if ($typename);
$typename = rb_ucase($typename) if $typename;
$typename = $classname if (!$typename and $subtype and $subtype eq 'enum'); # compound enum
@ -695,6 +696,7 @@ sub render_item_number {
$initvalue ||= 'nil' if $typename;
$subtype = $item->getAttribute('base-type') if (!$subtype or $subtype eq 'bitfield' or $subtype eq 'enum');
$subtype = $g->getAttribute('base-type') if ($g);
$subtype = 'int32_t' if (!$subtype);
if ($subtype eq 'int64_t') {