diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-09-11 22:14:18 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-11 22:14:18 +0000 |
commit | b79f0d0cc336662d16a22e07ad429e8deb71c956 (patch) | |
tree | c3bd6f6f1808ca5d62a0554ac6f62c1acd405ca3 /regs.pl | |
parent | 2ba7ed7122eea2e594f2f67ea9427b7e702692cc (diff) | |
download | nasm-b79f0d0cc336662d16a22e07ad429e8deb71c956.tar.gz nasm-b79f0d0cc336662d16a22e07ad429e8deb71c956.tar.bz2 nasm-b79f0d0cc336662d16a22e07ad429e8deb71c956.zip |
Use enums to make debugging easier
When we're dealing with a field which is guaranteed to have an enum type,
then declare it as such so it shows up in debuggers.
Diffstat (limited to 'regs.pl')
-rwxr-xr-x | regs.pl | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -99,7 +99,7 @@ if ( $fmt eq 'h' ) { } elsif ( $fmt eq 'c' ) { # Output regs.c print "/* automatically generated from $file - do not edit */\n"; - print "static const char *reg_names[] = "; $ch = '{'; + print "static const char * const reg_names[] = "; $ch = '{'; # This one has no dummy entry for 0 foreach $reg ( sort(keys(%regs)) ) { print "$ch\n \"${reg}\""; @@ -128,7 +128,7 @@ if ( $fmt eq 'h' ) { # Output regdis.c print "/* automatically generated from $file - do not edit */\n"; foreach $class ( sort(keys(%disclass)) ) { - printf "static const int rd_%-8s[] = {", $class; + printf "static const enum reg_enum rd_%-8s[] = {", $class; @foo = @{$disclass{$class}}; @bar = (); for ( $i = 0 ; $i < scalar(@foo) ; $i++ ) { |