diff options
author | Keith Kanios <spook@dynatos.net> | 2007-04-15 01:37:13 +0000 |
---|---|---|
committer | Keith Kanios <spook@dynatos.net> | 2007-04-15 01:37:13 +0000 |
commit | b7314d83f1464055f3f36e71b8aecb135db8e4ce (patch) | |
tree | 80638fd92c0f41bfca55d914911e437d462cb9d6 /regs.pl | |
parent | 61ff53c80d3aa89dc8fe091427aceafe0ff9cc28 (diff) | |
download | nasm-b7314d83f1464055f3f36e71b8aecb135db8e4ce.tar.gz nasm-b7314d83f1464055f3f36e71b8aecb135db8e4ce.tar.bz2 nasm-b7314d83f1464055f3f36e71b8aecb135db8e4ce.zip |
Fixed regdis.c generation.
Diffstat (limited to 'regs.pl')
-rwxr-xr-x | regs.pl | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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"; |