fix random.cpp build errors on non C99 compilers

This commit is contained in:
Arvid Norberg 2011-02-26 18:15:31 +00:00
parent 3b68fb2a03
commit 12caf7ff2e
1 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ namespace libtorrent
namespace
{
uint32_t x = 123456789;
boost::uint32_t x = 123456789;
}
void random_seed(boost::uint32_t v)
@ -17,10 +17,10 @@ namespace libtorrent
// see: http://en.wikipedia.org/wiki/Xorshift
boost::uint32_t random()
{
static uint32_t y = 362436069;
static uint32_t z = 521288629;
static uint32_t w = 88675123;
uint32_t t;
static boost::uint32_t y = 362436069;
static boost::uint32_t z = 521288629;
static boost::uint32_t w = 88675123;
boost::uint32_t t;
t = x ^ (x << 11);
x = y; y = z; z = w;