1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-20 14:22:26 +02:00

(is_prime): Ansideclify.

(next_prime): Ansideclify.  Add an assertion.
This commit is contained in:
Jim Meyering
1998-05-16 04:39:24 +00:00
parent d649910685
commit 4f75855c2e

View File

@@ -376,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;
@@ -397,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;