ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/math/MersenneTwister.hpp
(Generate patch)

Comparing branches/development/src/math/MersenneTwister.hpp (file contents):
Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC vs.
Revision 1767 by gezelter, Fri Jul 6 22:01:58 2012 UTC

# Line 135 | Line 135 | namespace OpenMD {
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  
# Line 321 | Line 329 | namespace OpenMD {
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        }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines