stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r370009 - /incubator/stdcxx/trunk/include/algorithm.cc
Date Wed, 18 Jan 2006 02:15:57 GMT
Author: sebor
Date: Tue Jan 17 18:15:54 2006
New Revision: 370009

URL: http://svn.apache.org/viewcvs?rev=370009&view=rev
Log:
2006-01-17  Martin Sebor  <sebor@roguewave.com>

	STDCXX-121
	* algorithm.cc (__search_n): Converted the Size argument
        to ptrdiff_t before doing any math on it.

Modified:
    incubator/stdcxx/trunk/include/algorithm.cc

Modified: incubator/stdcxx/trunk/include/algorithm.cc
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/algorithm.cc?rev=370009&r1=370008&r2=370009&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/algorithm.cc (original)
+++ incubator/stdcxx/trunk/include/algorithm.cc Tue Jan 17 18:15:54 2006
@@ -2,7 +2,7 @@
  *
  * algorithm.cc - Non-inline definitions for the Standard Library algorithms
  *
- * $Id: //stdlib/dev/include/algorithm.cc#42 $
+ * $Id$
  *
  ***************************************************************************
  *
@@ -296,12 +296,14 @@
 
     const _Dist __dist = _DISTANCE (__first, __last, _Dist);
 
-    if (__dist < __count || __count <= 0)
+    const _RWSTD_PTRDIFF_T __int_count = __count;
+
+    if (__dist < __int_count || __int_count <= 0)
         return __last;
 
-    _Dist __span    = __dist - __count;
-    _Size     __matches = 0;
-    _FwdIter  __current = __first;
+    _Dist __span       = __dist - __int_count;
+    _Dist __matches    = 0;
+    _FwdIter __current = __first;
 
     while (!(__current == __last)) {
         if (__pred (*__current, __val) == false) {



Mime
View raw message