[nasm:master] pphash: change UNUSED_HASH_ENTRY to INVALID_HASH_ENTRY

nasm-bot for H. Peter Anvin (Intel) hpa at zytor.com
Fri Jul 10 01:27:04 PDT 2020


Commit-ID:  1cc58533f2f6a08f5ee702babbfee80ae895ed0b
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=1cc58533f2f6a08f5ee702babbfee80ae895ed0b
Author:     H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Fri, 10 Jul 2020 01:25:22 -0700
Committer:  H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Fri, 10 Jul 2020 01:25:22 -0700

pphash: change UNUSED_HASH_ENTRY to INVALID_HASH_ENTRY

INVALID_HASH_ENTRY is far more expressive...

Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>


---
 asm/pptok.pl        | 10 +++++-----
 asm/tokhash.pl      |  6 +++---
 macros/macros.pl    |  6 +++---
 nasmlib/perfhash.pl |  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/asm/pptok.pl b/asm/pptok.pl
index aa56921f..2e763b31 100755
--- a/asm/pptok.pl
+++ b/asm/pptok.pl
@@ -224,7 +224,7 @@ if ($what eq 'c') {
     # Put a large value in unused slots.  This makes it extremely unlikely
     # that any combination that involves unused slot will pass the range test.
     # This speeds up rejection of unrecognized tokens, i.e. identifiers.
-    print OUT "\n#define UNUSED_HASH_ENTRY (65535/3)\n";
+    print OUT "\n#define INVALID_HASH_ENTRY (65535/3)\n";
 
     print OUT "\n\n/* Primary preprocessor token hash */\n\n";
 
@@ -233,14 +233,14 @@ if ($what eq 'c') {
     print OUT "    static const int16_t hash1[$n] = {\n";
     for ($i = 0; $i < $n; $i++) {
 	my $h = ${$g}[$i*2+0];
-	print OUT "        ", defined($h) ? $h : 'UNUSED_HASH_ENTRY', ",\n";
+	print OUT "        ", defined($h) ? $h : 'INVALID_HASH_ENTRY', ",\n";
     }
     print OUT "    };\n";
 
     print OUT "    static const int16_t hash2[$n] = {\n";
     for ($i = 0; $i < $n; $i++) {
 	my $h = ${$g}[$i*2+1];
-	print OUT "        ", defined($h) ? $h : 'UNUSED_HASH_ENTRY', ",\n";
+	print OUT "        ", defined($h) ? $h : 'INVALID_HASH_ENTRY', ",\n";
     }
     print OUT "    };\n";
 
@@ -296,14 +296,14 @@ if ($what eq 'c') {
     print OUT "    static const int16_t hash1[$n] = {\n";
     for ($i = 0; $i < $n; $i++) {
 	my $h = ${$g}[$i*2+0];
-	print OUT "        ", defined($h) ? $h : 'UNUSED_HASH_ENTRY', ",\n";
+	print OUT "        ", defined($h) ? $h : 'INVALID_HASH_ENTRY', ",\n";
     }
     print OUT "    };\n";
 
     print OUT "    static const int16_t hash2[$n] = {\n";
     for ($i = 0; $i < $n; $i++) {
 	my $h = ${$g}[$i*2+1];
-	print OUT "        ", defined($h) ? $h : 'UNUSED_HASH_ENTRY', ",\n";
+	print OUT "        ", defined($h) ? $h : 'INVALID_HASH_ENTRY', ",\n";
     }
     print OUT "    };\n";
 
diff --git a/asm/tokhash.pl b/asm/tokhash.pl
index 9303157b..2d6538fe 100755
--- a/asm/tokhash.pl
+++ b/asm/tokhash.pl
@@ -234,19 +234,19 @@ if ($output eq 'h') {
     # Put a large value in unused slots.  This makes it extremely unlikely
     # that any combination that involves unused slot will pass the range test.
     # This speeds up rejection of unrecognized tokens, i.e. identifiers.
-    print "#define UNUSED_HASH_ENTRY (65535/3)\n";
+    print "#define INVALID_HASH_ENTRY (65535/3)\n";
 
     print "    static const int16_t hash1[$n] = {\n";
     for ($i = 0; $i < $n; $i++) {
 	my $h = ${$g}[$i*2+0];
-	print "        ", defined($h) ? $h : 'UNUSED_HASH_ENTRY', ",\n";
+	print "        ", defined($h) ? $h : 'INVALID_HASH_ENTRY', ",\n";
     }
     print "    };\n";
 
     print "    static const int16_t hash2[$n] = {\n";
     for ($i = 0; $i < $n; $i++) {
 	my $h = ${$g}[$i*2+1];
-	print "        ", defined($h) ? $h : 'UNUSED_HASH_ENTRY', ",\n";
+	print "        ", defined($h) ? $h : 'INVALID_HASH_ENTRY', ",\n";
     }
     print "    };\n";
 
diff --git a/macros/macros.pl b/macros/macros.pl
index 517a9e6f..1e9cc110 100755
--- a/macros/macros.pl
+++ b/macros/macros.pl
@@ -276,19 +276,19 @@ print OUT "    };\n";
 # Put a large value in unused slots.  This makes it extremely unlikely
 # that any combination that involves unused slot will pass the range test.
 # This speeds up rejection of unrecognized tokens, i.e. identifiers.
-print OUT "#define UNUSED_HASH_ENTRY (65535/3)\n";
+print OUT "#define INVALID_HASH_ENTRY (65535/3)\n";
 
 print OUT "    static const int16_t hash1[$n] = {\n";
 for ($i = 0; $i < $n; $i++) {
     my $h = ${$g}[$i*2+0];
-    print OUT "        ", defined($h) ? $h : 'UNUSED_HASH_ENTRY', ",\n";
+    print OUT "        ", defined($h) ? $h : 'INVALID_HASH_ENTRY', ",\n";
 }
 print OUT "    };\n";
 
 print OUT "    static const int16_t hash2[$n] = {\n";
 for ($i = 0; $i < $n; $i++) {
     my $h = ${$g}[$i*2+1];
-    print OUT "        ", defined($h) ? $h : 'UNUSED_HASH_ENTRY', ",\n";
+    print OUT "        ", defined($h) ? $h : 'INVALID_HASH_ENTRY', ",\n";
 }
 print OUT "    };\n";
 
diff --git a/nasmlib/perfhash.pl b/nasmlib/perfhash.pl
index 9236bfec..036fdf1a 100755
--- a/nasmlib/perfhash.pl
+++ b/nasmlib/perfhash.pl
@@ -334,18 +334,18 @@ if ($output eq 'h') {
     }
     print F "\n};\n\n";
 
-    print F "#define UNUSED_HASH_ENTRY (65536/3)\n\n";
+    print F "#define INVALID_HASH_ENTRY (65536/3)\n\n";
 
     printf F "static const int16_t %s_hashvals[%d] = ", $name, $n*2;
     $c = '{';
     for (my $i = 0; $i < $n; $i++) {
 	my $h = ${$g}[$i*2+0];
-	print F "$c\n    ", defined($h) ? $h : 'UNUSED_HASH_ENTRY';
+	print F "$c\n    ", defined($h) ? $h : 'INVALID_HASH_ENTRY';
 	$c = ',';
     }
     for (my $i = 0; $i < $n; $i++) {
 	my $h = ${$g}[$i*2+1];
-	print F "$c\n    ", defined($h) ? $h : 'UNUSED_HASH_ENTRY';
+	print F "$c\n    ", defined($h) ? $h : 'INVALID_HASH_ENTRY';
 	$c = ',';
     }
     print F "\n};\n\n";


More information about the Nasm-commits mailing list