*** empty log message ***
[gnulib.git] / lib / hash.c
index 200d3c0..5899f57 100644 (file)
@@ -264,7 +264,8 @@ hash_get_next (const Hash_table *table, const void *entry)
    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;
@@ -375,9 +376,8 @@ hash_string (const char *string, unsigned int n_buckets)
 /* 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;
@@ -396,9 +396,10 @@ is_prime (candidate)
    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;
 
@@ -409,10 +410,11 @@ next_prime (candidate)
 }
 
 /* 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.  */