aboutsummaryrefslogtreecommitdiff
path: root/games/primes/primes.h
diff options
context:
space:
mode:
authorTony Finch <fanf@FreeBSD.org>2002-10-09 19:38:55 +0000
committerTony Finch <fanf@FreeBSD.org>2002-10-09 19:38:55 +0000
commit9a171f4fc4f19a41e3b1e75d0e67cd206de59537 (patch)
tree3550a410f691d5a377d315fc6ddf06ffb9cd04cd /games/primes/primes.h
parent5715307f74621e9e2dcde38412eb6dc54b79d8ad (diff)
downloadsrc-9a171f4fc4f19a41e3b1e75d0e67cd206de59537.tar.gz
src-9a171f4fc4f19a41e3b1e75d0e67cd206de59537.zip
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
Notes
Notes: svn path=/head/; revision=104720
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 611c86d4fc79..f4a90fa1fd85 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 */