diff options
author | Bruno Haible <bruno@clisp.org> | 2009-01-19 09:50:07 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-01-19 09:50:07 +0000 |
commit | 57745086ac72e67c33a8535b4916963b10777842 (patch) | |
tree | cf51eb86e28ff19fd72919425a552ac10cfdee3b /tests/permutc2.exp | |
parent | 7fac4aa2b6eecf2cc47acffb2d9beebb8c2c2066 (diff) | |
download | gperf-57745086ac72e67c33a8535b4916963b10777842.tar.gz |
Don't include the length in the hash function if all keywords have the same
length.
Diffstat (limited to 'tests/permutc2.exp')
-rw-r--r-- | tests/permutc2.exp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/tests/permutc2.exp b/tests/permutc2.exp index 1fcdbbc..ea51805 100644 --- a/tests/permutc2.exp +++ b/tests/permutc2.exp @@ -37,8 +37,8 @@ error "gperf generated tables don't work with this execution character set. Plea #define TOTAL_KEYWORDS 8 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 2 -#define MIN_HASH_VALUE 2 -#define MAX_HASH_VALUE 9 +#define MIN_HASH_VALUE 0 +#define MAX_HASH_VALUE 7 /* maximum key range = 8, duplicates = 0 */ #ifndef GPERF_DOWNCASE @@ -91,6 +91,7 @@ __inline inline #endif #endif +/*ARGSUSED*/ static unsigned int hash (str, len) register const char *str; @@ -98,34 +99,34 @@ hash (str, len) { static unsigned char asso_values[] = { - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10, 1,10,10, 3,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10, 3, 1, - 0, 7, 1, 0, 3,10,10, 1,10,10, - 3,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 3, 1, 0, 0, 1, 0, 2,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10,10, - 10,10,10,10,10,10,10,10,10 + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 1, 8, 8, 3, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 3, 1, + 0, 7, 1, 0, 3, 8, 8, 1, 8, 8, + 3, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 3, 1, 0, 0, 1, 0, 2, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8 }; - return len + asso_values[(unsigned char)str[1]+3] + asso_values[(unsigned char)str[0]]; + return asso_values[(unsigned char)str[1]+3] + asso_values[(unsigned char)str[0]]; } #ifdef __GNUC__ @@ -141,7 +142,6 @@ in_word_set (str, len) { static const char * wordlist[] = { - "", "", "{w", "az", "ay", |