summaryrefslogtreecommitdiff
path: root/games/primes
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>2001-08-19 17:12:44 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>2001-08-19 17:12:44 +0000
commit39265ff3fd8cc671e910126e6378f443f2c99a70 (patch)
tree37a9760bd588a704d35a869e9f282542ddc9da8d /games/primes
parentca597fff3d881e3a9b40b28415b35aceb766e1bb (diff)
Use u_int32_t rather than unsigned long, both for platform invariance and
because the primes generation table really depends on there not being more than 32 bits.
Diffstat (limited to 'games/primes')
-rw-r--r--games/primes/pr_tbl.c7
-rw-r--r--games/primes/primes.h6
2 files changed, 7 insertions, 6 deletions
diff --git a/games/primes/pr_tbl.c b/games/primes/pr_tbl.c
index 51ee1033a9d..cac95e399c8 100644
--- a/games/primes/pr_tbl.c
+++ b/games/primes/pr_tbl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pr_tbl.c,v 1.2 1999/09/25 15:52:20 pjanzen Exp $ */
+/* $OpenBSD: pr_tbl.c,v 1.3 2001/08/19 17:12:43 pjanzen Exp $ */
/* $NetBSD: pr_tbl.c,v 1.3 1995/03/23 08:35:52 cgd Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)pr_tbl.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: pr_tbl.c,v 1.2 1999/09/25 15:52:20 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: pr_tbl.c,v 1.3 2001/08/19 17:12:43 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -56,6 +56,7 @@ static char rcsid[] = "$OpenBSD: pr_tbl.c,v 1.2 1999/09/25 15:52:20 pjanzen Exp
* and 65537^2 > 2^32-1.
*/
+#include <sys/types.h>
#include "primes.h"
const ubig prime[] = {
@@ -550,4 +551,4 @@ const ubig prime[] = {
};
/* pr_limit - largest prime in the prime table */
-const unsigned long *pr_limit = &prime[(sizeof(prime)/sizeof(prime[0]))-1];
+const ubig *pr_limit = &prime[(sizeof(prime)/sizeof(prime[0]))-1];
diff --git a/games/primes/primes.h b/games/primes/primes.h
index ae993d6240d..42b321ba089 100644
--- a/games/primes/primes.h
+++ b/games/primes/primes.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: primes.h,v 1.2 1999/09/25 15:52:20 pjanzen Exp $ */
+/* $OpenBSD: primes.h,v 1.3 2001/08/19 17:12:43 pjanzen Exp $ */
/* $NetBSD: primes.h,v 1.4 1995/03/23 08:35:58 cgd Exp $ */
/*
@@ -48,8 +48,8 @@
*/
/* ubig is the type that holds a large unsigned value */
-typedef unsigned long ubig; /* must be >=32 bit unsigned value */
-#define BIG ULONG_MAX /* largest value will sieve */
+typedef u_int32_t ubig; /* must be 32 bit unsigned value */
+#define BIG 0xffffffffU /* largest value will sieve */
/* bytes in sieve table (must be > 3*5*7*11) */
#define TABSIZE 256*1024