while (<STDIN>) {
chomp;
+ /^#/ && next;
+ /^\s*$/ && next;
+ s/^0x//;
($i,$j) = split/\s+/;
($i =~ /^(..)(..)$/) || die "Syntax error at $i";
$table{$1} = "$name" . "_$1";
+ die if defined $val{$i};
$val{$i} = $j;
}
for($i=0; $i<256; $i++) {
$x = sprintf("%02X", $i);
if (defined($table{$x})) {
- print "static $type $table{$x}\[256\] = \{\n";
+ print "static const $type $table{$x}\[256\] = \{\n";
for($j=0; $j<256; $j++) {
$y = $x . sprintf("%02X", $j);
if ($val{$y}) { print $val{$y}; }
}
}
-print "$type \*$name\[256\] = \{\n";
+print "const $type \*$name\[256\] = \{\n";
for($j=0; $j<256; $j++) {
$y = sprintf("%02X", $j);
if (defined $table{$y}) { print $table{$y}; }