summaryrefslogtreecommitdiffstats
path: root/games/primes/primes.h
diff options
context:
space:
mode:
authorfanf <fanf@FreeBSD.org>2002-10-09 19:38:55 +0000
committerfanf <fanf@FreeBSD.org>2002-10-09 19:38:55 +0000
commitb5ea937ee8abc00f218c186759abaf13273b43a8 (patch)
tree3550a410f691d5a377d315fc6ddf06ffb9cd04cd /games/primes/primes.h
parent7cc0ed53c23287ab506f8f86ebbadb958fab6ec7 (diff)
downloadFreeBSD-src-b5ea937ee8abc00f218c186759abaf13273b43a8.zip
FreeBSD-src-b5ea937ee8abc00f218c186759abaf13273b43a8.tar.gz
Style fixes to: #include ordering; use const and static; ANSI functions;
various usage synopses; bogus and/or unnecessary casting; exit values; use LINE_MAX instead of magic numbers; declare extern variables in a header; add $FreeBSD$ where missing. Reviewed by: markm, obrien Obtained from: NetBSD | fanf
Diffstat (limited to 'games/primes/primes.h')
-rw-r--r--games/primes/primes.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/games/primes/primes.h b/games/primes/primes.h
index 611c86d..f4a90fa 100644
--- a/games/primes/primes.h
+++ b/games/primes/primes.h
@@ -34,6 +34,7 @@
* SUCH DAMAGE.
*
* @(#)primes.h 8.2 (Berkeley) 3/1/94
+ * $FreeBSD$
*/
/*
@@ -50,3 +51,20 @@ typedef unsigned long ubig; /* must be >=32 bit unsigned value */
/* bytes in sieve table (must be > 3*5*7*11) */
#define TABSIZE 256*1024
+
+/*
+ * prime[i] is the (i-1)th prime.
+ *
+ * We are able to sieve 2^32-1 because this byte table yields all primes
+ * up to 65537 and 65537^2 > 2^32-1.
+ */
+extern const ubig prime[];
+extern const ubig *const pr_limit; /* largest prime in the prime array */
+
+/*
+ * To avoid excessive sieves for small factors, we use the table below to
+ * setup our sieve blocks. Each element represents a odd number starting
+ * with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13.
+ */
+extern const char pattern[];
+extern const size_t pattern_size; /* length of pattern array */
OpenPOWER on IntegriCloud