[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] RANDOM_MAX
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] RANDOM_MAX |
Date: |
Sat, 15 Mar 2008 18:09:24 -0700 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
On Sat, Mar 15, 2008 at 11:55:58AM -0400, Greg Troxel wrote:
> In gnuradio-core/src/lib/general/random.h, RNADOM_MAX is defined
> unconditionally:
>
> Recently NetBSD-current has added RANDOM_MAX, for essentially the same
> reason, to parallel with RAND_MAX. (random(3)'s definition is 0 to
> 2**31-1, so this shouldn't be different).
>
>
> So, is it ok to commit this patch?
Please do, and feel free to update the comment.
Eric
> I would also update the comment (it's not a bug that Solaris RAND_MAX is
> 32767 if rand(3) on Solaris returns from 0 to 2**15-1 - standards don't
> require 2**31-1 that I know of)?
>
>
> $NetBSD: patch-ag,v 1.3 2008/03/15 15:09:54 joerg Exp $
>
> --- gnuradio-core/src/lib/general/random.h.orig 2008-03-15 15:34:46.000000000
> +0
> 100
> +++ gnuradio-core/src/lib/general/random.h
> @@ -24,8 +24,9 @@
> #define _RANDOM_H_
>
> // we use this because some systems (solaris) define RAND_MAX as 32767
> -
> +#ifndef RANDOM_MAX
> static const int RANDOM_MAX = 2147483647;
> +#endif
>
> #include <stdlib.h>