From owner-svn-src-head@FreeBSD.ORG Mon Sep 29 15:27:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E175EBA; Mon, 29 Sep 2014 15:27:55 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26B4EAA4; Mon, 29 Sep 2014 15:27:55 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2433AB939; Mon, 29 Sep 2014 11:27:54 -0400 (EDT) From: John Baldwin To: Colin Percival Subject: Re: svn commit: r272207 - in head/games: factor primes Date: Mon, 29 Sep 2014 10:30:14 -0400 Message-ID: <5561525.GofWoxIbJB@ralph.baldwin.cx> User-Agent: KMail/4.12.5 (FreeBSD/10.1-BETA2; KDE/4.12.5; amd64; ; ) In-Reply-To: <5426B4EC.9040102@freebsd.org> References: <201409270900.s8R90dWl029070@svn.freebsd.org> <1576403.4iOOFWFkUs@ralph.baldwin.cx> <5426B4EC.9040102@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 29 Sep 2014 11:27:54 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2014 15:27:55 -0000 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