This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Very minor tweak to tr1::poisson_distribution
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 08 Sep 2006 16:43:26 +0200
- Subject: [v3] Very minor tweak to tr1::poisson_distribution
Hi,
committed to mainline.
Paolo.
//////////////////
2006-09-08 Paolo Carlini <pcarlini@suse.de>
* include/tr1/random.tcc (poisson_distribution<>::operator()):
Avoid potential warnings when _IntType is unsigned.
Index: include/tr1/random.tcc
===================================================================
--- include/tr1/random.tcc (revision 116719)
+++ include/tr1/random.tcc (working copy)
@@ -906,7 +906,7 @@
else
#endif
{
- _IntType __x = -1;
+ _IntType __x = 0;
_RealType __prod = 1.0;
do
@@ -916,7 +916,7 @@
}
while (__prod > _M_lm_thr);
- return __x;
+ return __x - 1;
}
}