OSDN Git Service

2009-04-06 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Apr 2009 14:50:06 +0000 (14:50 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Apr 2009 14:50:06 +0000 (14:50 +0000)
* include/bits/random.tcc (linear_congruential_engine<>::
seed(seed_seq&)): Fix typo in last fix for __m == 0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145605 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/random.tcc

index 62c7411..d2b1cd6 100644 (file)
@@ -1,5 +1,10 @@
 2009-04-06  Paolo Carlini  <paolo.carlini@oracle.com>
 
+       * include/bits/random.tcc (linear_congruential_engine<>::
+       seed(seed_seq&)): Fix typo in last fix for __m == 0.
+
+2009-04-06  Paolo Carlini  <paolo.carlini@oracle.com>
+
        * include/bits/random.h (operator==): Mark all inline.
        (mersenne_twister_engine): Enable #if 0 checks.
 
index b6a2543..ee2b71c 100644 (file)
@@ -119,8 +119,8 @@ namespace std
     seed(seed_seq& __q)
     {
       const _UIntType __k0 = __m == 0 ? std::numeric_limits<_UIntType>::digits
-                                     : (std::__lg(__m) + 31);
-      const _UIntType __k = __k0 / 32;
+                                     : std::__lg(__m);
+      const _UIntType __k = (__k0 + 31) / 32;
       _UIntType __arr[__k + 3];
       __q.generate(__arr + 0, __arr + 3);
       _UIntType __factor = 1U;