From 9b7fbcc477eb57caca60904c951bb4104be28fc7 Mon Sep 17 00:00:00 2001 From: jj Date: Thu, 26 Apr 2012 15:37:10 +0200 Subject: [PATCH] ruby: fix warning in codegen with initvalue --- plugins/ruby/codegen.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ruby/codegen.pl b/plugins/ruby/codegen.pl index f0373cd8b..2a0f0b2d6 100755 --- a/plugins/ruby/codegen.pl +++ b/plugins/ruby/codegen.pl @@ -262,7 +262,7 @@ sub render_item_number { $initvalue = 1 if ($initvalue and $initvalue eq 'true'); # XXX needs pre-declaration of the enum... - $initvalue = rb_ucase($item->getAttribute('type-name')) . '::' . $initvalue if ($subtype and $subtype eq 'enum' and $initvalue =~ /[a-zA-Z]/); + $initvalue = rb_ucase($item->getAttribute('type-name')) . '::' . $initvalue if ($initvalue and $subtype and $subtype eq 'enum' and $initvalue =~ /[a-zA-Z]/); $subtype = $item->getAttribute('base-type') if (!$subtype or $subtype eq 'enum' or $subtype eq 'bitfield'); $subtype = 'int32_t' if (!$subtype);