]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
random.tcc (poisson_distribution<>::operator()): Avoid potential warnings when _IntTy...
authorPaolo Carlini <pcarlini@suse.de>
Fri, 8 Sep 2006 14:40:47 +0000 (14:40 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 8 Sep 2006 14:40:47 +0000 (14:40 +0000)
2006-09-08  Paolo Carlini  <pcarlini@suse.de>

* include/tr1/random.tcc (poisson_distribution<>::operator()):
Avoid potential warnings when _IntType is unsigned.

From-SVN: r116779

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

index 103f75d50e635913c1482d7af1bbde77adc42a7b..c2145be7ae3bc82d010124caaebf5b58e1f1093e 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-08  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/tr1/random.tcc (poisson_distribution<>::operator()):
+       Avoid potential warnings when _IntType is unsigned.
+
 2006-09-08  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/debug/debug.h (_GLIBCXX_DEBUG_ONLY): New.
index e6d4d941d5967fa3d72464f7b289c7741c45cf08..a7322605f68597add25241fe5c1ada7fe01966f6 100644 (file)
@@ -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;
          }
       }