summaryrefslogtreecommitdiff
path: root/regs.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-11 22:14:18 +0000
committerH. Peter Anvin <hpa@zytor.com>2007-09-11 22:14:18 +0000
commitb79f0d0cc336662d16a22e07ad429e8deb71c956 (patch)
treec3bd6f6f1808ca5d62a0554ac6f62c1acd405ca3 /regs.pl
parent2ba7ed7122eea2e594f2f67ea9427b7e702692cc (diff)
downloadnasm-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-xregs.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/regs.pl b/regs.pl
index cf27ce7..be37c7c 100755
--- a/regs.pl
+++ b/regs.pl
@@ -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++ ) {