31 |
# include <stdlib.h> |
# include <stdlib.h> |
32 |
#endif |
#endif |
33 |
|
|
34 |
|
#include <limits.h> |
35 |
#include <stdbool.h> |
#include <stdbool.h> |
36 |
#include <stdio.h> |
#include <stdio.h> |
37 |
|
|
404 |
unsigned |
unsigned |
405 |
hash_string (const char *string, unsigned n_buckets) |
hash_string (const char *string, unsigned n_buckets) |
406 |
{ |
{ |
|
# ifndef CHAR_BIT |
|
|
# define CHAR_BIT 8 |
|
|
# endif |
|
407 |
# define ROTATE_LEFT(Value, Shift) \ |
# define ROTATE_LEFT(Value, Shift) \ |
408 |
((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift))) |
((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift))) |
409 |
# define HASH_ONE_CHAR(Value, Byte) \ |
# define HASH_ONE_CHAR(Value, Byte) \ |