| 135 |
|
uint32 loBits( const uint32& u ) const { return u & 0x7fffffffUL; } |
| 136 |
|
uint32 mixBits( const uint32& u, const uint32& v ) const |
| 137 |
|
{ return hiBit(u) | loBits(v); } |
| 138 |
+ |
#ifdef _MSC_VER |
| 139 |
+ |
#pragma warning( push ) // save current warning settings |
| 140 |
+ |
#pragma warning( disable : 4146 ) // warning C4146: unary minus operator applied to unsigned type, result still unsigned |
| 141 |
+ |
#endif |
| 142 |
|
uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const |
| 143 |
|
{ return m ^ (mixBits(s0,s1)>>1) ^ (-loBit(s1) & 0x9908b0dfUL); } |
| 144 |
+ |
#ifdef _MSC_VER |
| 145 |
+ |
#pragma warning( pop ) // return warning settings to what they were |
| 146 |
+ |
#endif |
| 147 |
+ |
|
| 148 |
|
static uint32 hash( time_t t, clock_t c ); |
| 149 |
|
}; |
| 150 |
|
|
| 329 |
|
register int i = N; |
| 330 |
|
register bool success = true; |
| 331 |
|
while( success && i-- ) |
| 332 |
< |
success = fread( s++, sizeof(uint32), 1, urandom ); |
| 332 |
> |
success = (fread( s++, sizeof(uint32), 1, urandom ) == 0); |
| 333 |
|
fclose(urandom); |
| 334 |
|
if( success ) { return bigSeed; } |
| 335 |
|
} |