From b90ca5481dbb828f39cc94ef9e5309f7a0486d71 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 1 Mar 2007 11:40:48 +0000 Subject: [PATCH] Fixed warning. --- src/utility/random.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/utility/random.cpp b/src/utility/random.cpp index 7a7161af..15b13ee2 100644 --- a/src/utility/random.cpp +++ b/src/utility/random.cpp @@ -35,10 +35,7 @@ const unsigned int random::getNext() // Park and Miller's minimal standard generator: // xn+1 = (a * xn + b) mod c // xn+1 = (16807 * xn) mod (2^31 - 1) - static const unsigned long a = 16807; - static const unsigned long c = (1 << ((sizeof(int) << 3) - 1)); - - m_next = static_cast((a * m_next) % c); + m_next = static_cast((16807 * m_next) % 2147483647ul); return (m_next); }