aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2007-03-01 11:40:48 +0000
committerVincent Richard <[email protected]>2007-03-01 11:40:48 +0000
commitb90ca5481dbb828f39cc94ef9e5309f7a0486d71 (patch)
tree7cb73510568bd7386b4d5b8cca2fd488c2c8bc50
parentFixed bad parsing of RFC-2047 quoting. (diff)
downloadvmime-b90ca5481dbb828f39cc94ef9e5309f7a0486d71.tar.gz
vmime-b90ca5481dbb828f39cc94ef9e5309f7a0486d71.zip
Fixed warning.
-rw-r--r--src/utility/random.cpp5
1 files changed, 1 insertions, 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<unsigned int>((a * m_next) % c);
+ m_next = static_cast<unsigned int>((16807 * m_next) % 2147483647ul);
return (m_next);
}