From: Paolo Carlini Date: Fri, 8 Sep 2006 14:40:47 +0000 (+0000) Subject: random.tcc (poisson_distribution<>::operator()): Avoid potential warnings when _IntTy... X-Git-Tag: releases/gcc-4.2.0~1484 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96b9f9a4d84511ca59ebd763dc7128ab9013a9d0;p=thirdparty%2Fgcc.git random.tcc (poisson_distribution<>::operator()): Avoid potential warnings when _IntType is unsigned. 2006-09-08 Paolo Carlini * include/tr1/random.tcc (poisson_distribution<>::operator()): Avoid potential warnings when _IntType is unsigned. From-SVN: r116779 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 103f75d50e63..c2145be7ae3b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2006-09-08 Paolo Carlini + + * include/tr1/random.tcc (poisson_distribution<>::operator()): + Avoid potential warnings when _IntType is unsigned. + 2006-09-08 Benjamin Kosnik * include/debug/debug.h (_GLIBCXX_DEBUG_ONLY): New. diff --git a/libstdc++-v3/include/tr1/random.tcc b/libstdc++-v3/include/tr1/random.tcc index e6d4d941d596..a7322605f685 100644 --- a/libstdc++-v3/include/tr1/random.tcc +++ b/libstdc++-v3/include/tr1/random.tcc @@ -906,7 +906,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) else #endif { - _IntType __x = -1; + _IntType __x = 0; _RealType __prod = 1.0; do @@ -916,7 +916,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) } while (__prod > _M_lm_thr); - return __x; + return __x - 1; } }