[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] RANDOM_MAX

From: Greg Troxel
Subject: [Discuss-gnuradio] RANDOM_MAX
Date: Sat, 15 Mar 2008 11:55:58 -0400
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (berkeley-unix)

In gnuradio-core/src/lib/general/random.h, RNADOM_MAX is defined 

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?

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
+++ 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;
 #include <stdlib.h>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]