Boost logo

Boost :

From: Stefan Slapeta (stefan_nospam__at_[hidden])
Date: 2004-07-28 10:11:40


in rand48::operator ()

[...]\linear_congruential.hpp(218) : warning C4244: 'return' :
conversion from 'boost::uint64_t' to 'boost::int32_t', possible loss of data

Patch attached.

Stefan

RCS file: /cvsroot/boost/boost/boost/random/linear_congruential.hpp,v
retrieving revision 1.18
diff -u -r1.18 linear_congruential.hpp
--- linear_congruential.hpp 27 Jul 2004 03:43:32 -0000 1.18
+++ linear_congruential.hpp 28 Jul 2004 15:09:10 -0000
@@ -215,7 +215,7 @@
   void seed(uint64_t x0) { lcf.seed(x0); }
   template<class It> void seed(It& first, It last) { lcf.seed(first,last); }
 
- int32_t operator()() { return lcf() >> 17; }
+ int32_t operator()() { return static_cast<int32_t>(lcf() >> 17); }
   // by experiment from lrand48()
   static bool validation(int32_t x) { return x == 1993516219; }
 


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk