pointers. */
unsigned int
-hash_get_entries (const Hash_table *table, void **buffer, unsigned int buffer_size)
+hash_get_entries (const Hash_table *table, void **buffer,
+ unsigned int buffer_size)
{
unsigned int counter = 0;
struct hash_entry *bucket;
/* Return true if CANDIDATE is a prime number. CANDIDATE should be an odd
number at least equal to 11. */
-static bool
-is_prime (candidate)
- unsigned long candidate;
+static int
+is_prime (unsigned long candidate)
{
unsigned long divisor = 3;
unsigned long square = divisor * divisor;
prime. CANDIDATE should be at least equal to 10. */
static unsigned long
-next_prime (candidate)
- unsigned long candidate;
+next_prime (unsigned long candidate)
{
+ assert (candidate >= 10);
+
/* Make it definitely odd. */
candidate |= 1;
}
/* Allocate and return a new hash table, or NULL if an error is met. The
- initial number of buckets would be at least CANDIDATE (which need not be prime).
+ initial number of buckets would be at least CANDIDATE (which need not be
+ prime).
- If DATA_FREER is not NULL, this function may be later called with the data as
- an argument, just before they entry containing the data gets freed. The
+ If DATA_FREER is not NULL, this function may be later called with the data
+ as an argument, just before they entry containing the data gets freed. The
HASHER function should be supplied, and FIXME. The COMPARATOR function
should also be supplied, and FIXME. */