From owner-cvs-all@FreeBSD.ORG Thu Jun 23 17:14:27 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA57F16A41C; Thu, 23 Jun 2005 17:14:27 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F25543D4C; Thu, 23 Jun 2005 17:14:27 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.41.231] (Not Verified[65.202.103.25]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Thu, 23 Jun 2005 13:28:01 -0400 From: John Baldwin To: "Greg 'groggy' Lehey" Date: Thu, 23 Jun 2005 11:02:34 -0400 User-Agent: KMail/1.8 References: <200506221524.j5MFO1V1045648@repoman.freebsd.org> <20050623002734.GE37620@wantadilla.lemis.com> In-Reply-To: <20050623002734.GE37620@wantadilla.lemis.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506231102.36885.jhb@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/games/random random.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 17:14:27 -0000 On Wednesday 22 June 2005 08:27 pm, Greg 'groggy' Lehey wrote: > On Wednesday, 22 June 2005 at 15:24:00 +0000, John Baldwin wrote: > > jhb 2005-06-22 15:24:00 UTC > > > > FreeBSD src repository > > > > Modified files: > > games/random random.c > > Log: > > Correct an error in the previous revision. RAND_MAX is the maximum > > value for rand(3), not random(3). random(3) is defined to return values > > between 0 and 2^31-1, so add a local RANDOM_MAX constant to this file > > that is defined as 2^31-1 and use that in place of RAND_MAX. > > How much effect did this bug have on the results of random(3)? This commit had zero effect as RAND_MAX is actually defined as 2^31-1, it is just a pedantic fixup of the previous revision (1.18) which changed random(6) from using LONG_MAX as the maximum value. Using LONG_MAX mean that random(6) always selected zero lines from an input file on 64-bit archs such as amd64. The previous revision's log has an associated PR with more details. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org