Date: Mon, 29 Sep 2014 10:30:14 -0400 From: John Baldwin <jhb@freebsd.org> To: Colin Percival <cperciva@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r272207 - in head/games: factor primes Message-ID: <5561525.GofWoxIbJB@ralph.baldwin.cx> In-Reply-To: <5426B4EC.9040102@freebsd.org> References: <201409270900.s8R90dWl029070@svn.freebsd.org> <1576403.4iOOFWFkUs@ralph.baldwin.cx> <5426B4EC.9040102@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, September 27, 2014 06:00:28 AM Colin Percival wrote:
> On 09/27/14 05:52, John Baldwin wrote:
> > On Saturday, September 27, 2014 09:00:39 AM Colin Percival wrote:
> >> #define BIG ULONG_MAX /* largest value will sieve */
> >
> > Should this be UINT64_MAX (or however that is spelled) instead of
> > ULONG_MAX
> > now? (or is it even still used? I know your change removed its use in at
> > least one place.)
>
> It's not used any more. I was resisting the urge to spend time going
> through and removing ancient history (which is why I kept ubig instead of
> changing it to uint64_t everywhere).
It's kind of misleading though as the value is wrong and the comment for it no
longer applies. How about this:
Index: primes.c
===================================================================
--- primes.c (revision 272281)
+++ primes.c (working copy)
@@ -169,7 +169,7 @@
/*
* read_num_buf --
- * This routine returns a number n, where 0 <= n && n <= BIG.
+ * This routine returns a non-negative number n
*/
static ubig
read_num_buf(void)
@@ -214,7 +214,7 @@
/*
* A number of systems can not convert double values into unsigned
* longs when the values are larger than the largest signed value.
- * We don't have this problem, so we can go all the way to BIG.
+ * We don't have this problem, so we can go all the way.
*/
if (start < 3) {
start = (ubig)2;
Index: primes.h
===================================================================
--- primes.h (revision 272281)
+++ primes.h (working copy)
@@ -45,7 +45,6 @@
/* ubig is the type that holds a large unsigned value */
typedef uint64_t ubig; /* must be >=32 bit unsigned value */
-#define BIG ULONG_MAX /* largest value will sieve */
/* bytes in sieve table (must be > 3*5*7*11) */
#define TABSIZE 256*1024
--
John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5561525.GofWoxIbJB>
