From b7314d83f1464055f3f36e71b8aecb135db8e4ce Mon Sep 17 00:00:00 2001 From: Keith Kanios Date: Sun, 15 Apr 2007 01:37:13 +0000 Subject: [PATCH] Fixed regdis.c generation. --- regs.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/regs.pl b/regs.pl index ee2e640e..58354932 100755 --- a/regs.pl +++ b/regs.pl @@ -102,10 +102,15 @@ if ( $fmt eq 'h' ) { foreach $class ( sort(keys(%disclass)) ) { printf "static const int %-8s[] = {", $class; @foo = @{$disclass{$class}}; + @bar = 0; + $counter = 0; for ( $i = 0 ; $i < scalar(@foo) ; $i++ ) { - $foo[$i] = defined($foo[$i]) ? "R_\U$foo[$i]\E" : '0'; + if (defined($foo[$i])) { + $bar[$counter] = "R_\U$foo[$i]\E"; + $counter ++; + } } - print join(',', @foo), "};\n"; + print join(',', @bar), "};\n"; } } else { die "$0: Unknown output format\n"; -- 2.11.4.GIT