Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Sep 2014 08:52:33 -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:  <1576403.4iOOFWFkUs@ralph.baldwin.cx>
In-Reply-To: <201409270900.s8R90dWl029070@svn.freebsd.org>
References:  <201409270900.s8R90dWl029070@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, September 27, 2014 09:00:39 AM Colin Percival wrote:
> Author: cperciva
> Date: Sat Sep 27 09:00:38 2014
> New Revision: 272207
> URL: http://svnweb.freebsd.org/changeset/base/272207
> 
> Log:
>   Switch primes(6) from using unsigned long to using uint64_t.  This fixes
>   'limited range of type' warnings about comparisons on 32-bit systems, and
>   allows 32-bit systems to compute the full range of primes.
> 
> Modified:
>   head/games/factor/factor.6
>   head/games/primes/primes.c
>   head/games/primes/primes.h
> 
> Modified: head/games/primes/primes.h
> ============================================================================
> == --- head/games/primes/primes.h	Sat Sep 27 08:59:43 2014	(r272206)
> +++ head/games/primes/primes.h	Sat Sep 27 09:00:38 2014	(r272207)
> @@ -41,8 +41,10 @@
>   * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
>   */
> 
> +#include <stdint.h>
> +
>  /* ubig is the type that holds a large unsigned value */
> -typedef unsigned long ubig;		/* must be >=32 bit unsigned value */
> +typedef uint64_t ubig;			/* must be >=32 bit unsigned value */
>  #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.)

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1576403.4iOOFWFkUs>