Random_max

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?

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 215-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>

On Sat, Mar 15, 2008 at 11:55:58AM -0400, Greg T. 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs