From: Paolo Carlini Date: Mon, 6 Apr 2009 14:50:06 +0000 (+0000) Subject: random.tcc (linear_congruential_engine<>:: seed(seed_seq&)): Fix typo in last fix... X-Git-Tag: releases/gcc-4.5.0~6872 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ae3576fa412634f1a4d8dcfe949531b8e7990da;p=thirdparty%2Fgcc.git random.tcc (linear_congruential_engine<>:: seed(seed_seq&)): Fix typo in last fix for __m == 0. 2009-04-06 Paolo Carlini * include/bits/random.tcc (linear_congruential_engine<>:: seed(seed_seq&)): Fix typo in last fix for __m == 0. From-SVN: r145605 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 62c741154ba0..d2b1cd656c59 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2009-04-06 Paolo Carlini + + * include/bits/random.tcc (linear_congruential_engine<>:: + seed(seed_seq&)): Fix typo in last fix for __m == 0. + 2009-04-06 Paolo Carlini * include/bits/random.h (operator==): Mark all inline. diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc index b6a25434bf30..ee2b71c6f332 100644 --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -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;