This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
 	  }
       }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]