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/permut3.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/permut3.exp')
-rw-r--r-- | tests/permut3.exp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/tests/permut3.exp b/tests/permut3.exp index 94d0b1d..51045cf 100644 --- a/tests/permut3.exp +++ b/tests/permut3.exp @@ -33,8 +33,8 @@ error "gperf generated tables don't work with this execution character set. Plea #define TOTAL_KEYWORDS 4 #define MIN_WORD_LENGTH 3 #define MAX_WORD_LENGTH 3 -#define MIN_HASH_VALUE 3 -#define MAX_HASH_VALUE 6 +#define MIN_HASH_VALUE 0 +#define MAX_HASH_VALUE 3 /* maximum key range = 4, duplicates = 0 */ #ifdef __GNUC__ @@ -44,6 +44,7 @@ __inline inline #endif #endif +/*ARGSUSED*/ static unsigned int hash (str, len) register const char *str; @@ -51,34 +52,34 @@ hash (str, len) { static unsigned char asso_values[] = { - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 2, 0, 1, - 0, 7, 7, 7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 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4 }; - return len + asso_values[(unsigned char)str[1]+1] + asso_values[(unsigned char)str[0]]; + return asso_values[(unsigned char)str[1]+1] + asso_values[(unsigned char)str[0]]; } #ifdef __GNUC__ @@ -94,7 +95,6 @@ in_word_set (str, len) { static const char * wordlist[] = { - "", "", "", "bca", "cab", "acb", |