random.tcc (mersenne_twister<>::operator()): Revert last change (per gcc-patches...
authorPaolo Carlini <pcarlini@suse.de>
Tue, 15 Aug 2006 09:08:31 +0000 (09:08 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 15 Aug 2006 09:08:31 +0000 (09:08 +0000)
2006-08-15  Paolo Carlini  <pcarlini@suse.de>

* include/tr1/random.tcc (mersenne_twister<>::operator()): Revert
last change (per gcc-patches/2006-08/msg00484.html).

From-SVN: r116151

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

index bf29f8185957b38f8b326386cd218fcc44862a02..3998b7e1b4039504a8ce48e43347b7267be8be5c 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-15  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/tr1/random.tcc (mersenne_twister<>::operator()): Revert
+       last change (per gcc-patches/2006-08/msg00484.html).
+
 2006-08-14  Paolo Carlini  <pcarlini@suse.de>
 
        * include/tr1/random (class poisson_distribution<>): Add.
index 42b53a0d9920805c6f830e49df9aa1e4f90f6ec1..5051a96a14ff3344ea8437aa2c6295de366e9515 100644 (file)
@@ -285,13 +285,13 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
        {
          const _UIntType __upper_mask = (~_UIntType()) << __r;
          const _UIntType __lower_mask = ~__upper_mask;
-         const _UIntType __fx[2] = { 0, __a };
 
          for (int __k = 0; __k < (__n - __m); ++__k)
            {
              _UIntType __y = ((_M_x[__k] & __upper_mask)
                               | (_M_x[__k + 1] & __lower_mask));
-             _M_x[__k] = _M_x[__k + __m] ^ (__y >> 1) ^ __fx[__y & 0x01];
+             _M_x[__k] = (_M_x[__k + __m] ^ (__y >> 1)
+                          ^ ((__y & 0x01) ? __a : 0));
            }
 
          for (int __k = (__n - __m); __k < (__n - 1); ++__k)
@@ -299,12 +299,13 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
              _UIntType __y = ((_M_x[__k] & __upper_mask)
                               | (_M_x[__k + 1] & __lower_mask));
              _M_x[__k] = (_M_x[__k + (__m - __n)] ^ (__y >> 1)
-                          ^ __fx[__y & 0x01]);
+                          ^ ((__y & 0x01) ? __a : 0));
            }
 
          _UIntType __y = ((_M_x[__n - 1] & __upper_mask)
                           | (_M_x[0] & __lower_mask));
-         _M_x[__n - 1] = _M_x[__m - 1] ^ (__y >> 1) ^ __fx[__y & 0x01];
+         _M_x[__n - 1] = (_M_x[__m - 1] ^ (__y >> 1)
+                          ^ ((__y & 0x01) ? __a : 0));
          _M_p = 0;
        }