This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

[Patch] Qualify min(), max() and distance() in v3.


Hi,

this long but (very) boring patch fully qualifies all the
occurrences of max(), min() and distance(). Unfortunately
this is only the beginning since many other functions are
not qualified...

Tested x86-linux, ok with you, Gaby?

Ciao, Paolo.

////////////
2002-12-03  Paolo Carlini  <pcarlini@unitus.it>

	* config/locale/generic/codecvt_members.cc (codecvt::do_out
	(state_type&, const intern_type*, const intern_type*,
	const intern_type*&, extern_type*, extern_type*, extern_type*&),
	codecvt::do_in(state_type&, const extern_type*, const extern_type*,
	const extern_type*&, intern_type*, intern_type*, intern_type*&)):
	Fully qualify min() with std::.
	* config/locale/gnu/codecvt_members.cc: Ditto.
	* locale/ieee_1003.1-2001/codecvt_specializations.h
	(codecvt::do_length(const state_type&, const extern_type*,
	const extern_type*, size_t): Ditto.
	* include/bits/deque.tcc
	(_M_range_initialize(_ForwardIterator, _ForwardIterator,
	forward_iterator_tag), deque::_M_range_insert_aux(iterator,
	_ForwardIterator, _ForwardIterator, forward_iterator_tag), 
	deque::_M_reallocate_map(size_type, bool)): Fully qualify
	distance() and max() with std::.
	* include/bits/fstream.tcc (basic_filebuf::seekoff(off_type,
	ios_base::seekdir, ios_base::openmode)): Fully qualify max()
	with std::.
	* include/bits/istream.tcc (basic_istream::ignore(streamsize,
	int_type), basic_istream::readsome(char_type*, streamsize)):
	Fully qualify min() with std::.
	* include/bits/locale_facets.tcc (time_get::_M_extract_name
	(iter_type&, iter_type&, int&, const _CharT**, size_t,
	ios_base::iostate&)): Ditto.
	* include/bits/sstream.tcc (basic_stringbuf::overflow(int_type)):
	Fully qualify max() with std::.
	* include/bits/stl_algo.h (__inplace_stable_partition(_ForwardIter
	__first, _ForwardIter, _Predicate, _Distance),
	__stable_partition_adaptive(_ForwardIter, _ForwardIter, _Predicate,
	_Distance, _Pointer, _Distance), __merge_sort_loop(_RandomAccessIter1,
	_RandomAccessIter1, _RandomAccessIter2, _Distance),
	__merge_sort_loop(_RandomAccessIter1, _RandomAccessIter1,
	_RandomAccessIter2, _Distance, _Compare), lower_bound(_ForwardIter,
	_ForwardIter, const _Tp&), lower_bound(_ForwardIter, _ForwardIter,
	const _Tp&, _Compare), upper_bound(_ForwardIter, _ForwardIter,
	const _Tp&), upper_bound(_ForwardIter, _ForwardIter, const _Tp&,
	_Compare), equal_range(_ForwardIter, _ForwardIter, const _Tp&),
	equal_range(_ForwardIter, _ForwardIter, const _Tp&, _Compare),
	__merge_without_buffer(_BidirectionalIter, _BidirectionalIter,
	_BidirectionalIter, _Distance, _Distance), __merge_without_buffer
	(_BidirectionalIter, _BidirectionalIter, _BidirectionalIter,
	_Distance, _Distance, _Compare), __rotate_adaptive(_BidirectionalIter1,
	_BidirectionalIter1, _BidirectionalIter1, _Distance, _Distance,
	_BidirectionalIter2, _Distance), __merge_adaptive(_BidirectionalIter,
	_BidirectionalIter, _BidirectionalIter, _Distance, _Distance,
	_Pointer, _Distance), __merge_adaptive(_BidirectionalIter,
	_BidirectionalIter, _BidirectionalIter, _Distance, _Distance,
	_Pointer, _Distance, _Compare), inplace_merge(_BidirectionalIter,
	_BidirectionalIter, _BidirectionalIter), inplace_merge
	(_BidirectionalIter, _BidirectionalIter, _BidirectionalIter,
	_Compare), __find_end(_BidirectionalIter1, _BidirectionalIter1,
	_BidirectionalIter2, _BidirectionalIter2, bidirectional_iterator_tag,
	bidirectional_iterator_tag), __find_end(_BidirectionalIter1,
	_BidirectionalIter1, _BidirectionalIter2, _BidirectionalIter2,
	bidirectional_iterator_tag, bidirectional_iterator_tag,
	_BinaryPredicate)): Fully qualify distance() and min() with std::.
	* include/bits/stl_algobase.h (lexicographical_compare
	(const unsigned char*, const unsigned char*, const unsigned char*,
	const unsigned char*)): Fully qualify min() with std::.
	* include/bits/stl_bvector.h (_M_insert_range(iterator,
	_ForwardIterator, _ForwardIterator, forward_iterator_tag),
	_M_assign_aux(_ForwardIterator, _ForwardIterator, forward_iterator_tag),
	_M_initialize_range(_ForwardIterator, _ForwardIterator,
	forward_iterator_tag), _M_fill_insert(iterator, size_type, bool)):
	Fully qualify distance() and max() with std::.
	* include/bits/stl_deque.h (_Deque_base::_M_initialize_map(size_t),
	_M_assign_aux(_ForwardIterator, _ForwardIterator, forward_iterator_tag)):
	Ditto.
	* include/bits/stl_list.h (size()): Fully qualify distance() with std::.
	* include/bits/stl_tempbuf.h (_Temporary_buffer::_Temporary_buffer
	(_ForwardIterator, _ForwardIterator)): Ditto.
	* include/bits/stl_tree.h (_Rb_tree::erase(const _Key&),
	_Rb_tree::count(const _Key&)): Ditto.
	* include/bits/stl_vector.h (_M_range_initialize(_ForwardIterator,
	_ForwardIterator, forward_iterator_tag)): Ditto.
	* include/bits/streambuf.tcc (basic_streambuf::xsgetn(char_type*,
	streamsize), basic_streambuf::xsputn(const char_type*, streamsize)):
	Fully qualify min() with std::.
	* include/bits/vector.tcc (_M_assign_aux(_ForwardIter, _ForwardIter,
	forward_iterator_tag), _M_fill_insert(iterator, size_type,
	const value_type&), _M_range_insert(iterator, _ForwardIterator,
	_ForwardIterator, forward_iterator_tag)): Fully qualify max() and
	distance() with std::.
	* include/std/std_bitset.h (bitset::_M_copy_from_string
	(const basic_string&, size_t, size_t)): Fully qualify min() with std::.
	* include/std/std_streambuf.h (_M_pback_create()): Ditto.
	* include/std/std_complex.h (abs(const complex<_Tp>&)):
	Fully qualify max() with std::.
	* include/std/std_sstream.h (str()): Ditto.
	* src/codecvt.cc (codecvt::do_out(state_type&, const intern_type*,
	const intern_type*, const intern_type*&, extern_type*, extern_type*, 
	 extern_type*&), codecvt::do_in(state_type&, const extern_type*,
	const extern_type*, const extern_type*&, intern_type*, intern_type*,
	intern_type*&), codecvt::do_length(const state_type&,
	const extern_type*, const extern_type*, size_t), do_length
	(const state_type&, const extern_type*, const extern_type*,
	size_t)): Fully qualify min() with std::.
	* src/strstream.cc (strstreambuf::strstreambuf(streamsize),
	strstreambuf::overflow(int_type)): Fully qualify max() with std::.
diff -urN libstdc++-v3-orig/config/locale/generic/codecvt_members.cc libstdc++-v3/config/locale/generic/codecvt_members.cc
--- libstdc++-v3-orig/config/locale/generic/codecvt_members.cc	2002-09-11 05:36:44.000000000 +0200
+++ libstdc++-v3/config/locale/generic/codecvt_members.cc	2002-12-03 22:27:08.000000000 +0100
@@ -48,7 +48,7 @@
 	 extern_type*& __to_next) const
   {
     result __ret = error;
-    size_t __len = min(__from_end - __from, __to_end - __to);
+    size_t __len = std::min(__from_end - __from, __to_end - __to);
     size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
 
     if (__conv == __len)
@@ -77,7 +77,7 @@
 	intern_type*& __to_next) const
   {
     result __ret = error;
-    size_t __len = min(__from_end - __from, __to_end - __to);
+    size_t __len = std::min(__from_end - __from, __to_end - __to);
     size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
 
     if (__conv == __len)
diff -urN libstdc++-v3-orig/config/locale/gnu/codecvt_members.cc libstdc++-v3/config/locale/gnu/codecvt_members.cc
--- libstdc++-v3-orig/config/locale/gnu/codecvt_members.cc	2002-09-11 05:36:44.000000000 +0200
+++ libstdc++-v3/config/locale/gnu/codecvt_members.cc	2002-12-03 22:28:17.000000000 +0100
@@ -48,7 +48,7 @@
 	 extern_type*& __to_next) const
   {
     result __ret = error;
-    size_t __len = min(__from_end - __from, __to_end - __to);
+    size_t __len = std::min(__from_end - __from, __to_end - __to);
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
     __c_locale __old = __uselocale(_M_c_locale_codecvt);
 #endif
@@ -83,7 +83,7 @@
 	intern_type*& __to_next) const
   {
     result __ret = error;
-    size_t __len = min(__from_end - __from, __to_end - __to);
+    size_t __len = std::min(__from_end - __from, __to_end - __to);
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
     __c_locale __old = __uselocale(_M_c_locale_codecvt);
 #endif
diff -urN libstdc++-v3-orig/config/locale/ieee_1003.1-2001/codecvt_specializations.h libstdc++-v3/config/locale/ieee_1003.1-2001/codecvt_specializations.h
--- libstdc++-v3-orig/config/locale/ieee_1003.1-2001/codecvt_specializations.h	2002-05-26 16:35:04.000000000 +0200
+++ libstdc++-v3/config/locale/ieee_1003.1-2001/codecvt_specializations.h	2002-12-03 22:29:26.000000000 +0100
@@ -449,7 +449,7 @@
     codecvt<_InternT, _ExternT, __enc_traits>::
     do_length(const state_type&, const extern_type* __from, 
 	      const extern_type* __end, size_t __max) const
-    { return min(__max, static_cast<size_t>(__end - __from)); }
+    { return std::min(__max, static_cast<size_t>(__end - __from)); }
 
 #ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
 // 74.  Garbled text for codecvt::do_max_length
diff -urN libstdc++-v3-orig/include/bits/deque.tcc libstdc++-v3/include/bits/deque.tcc
--- libstdc++-v3-orig/include/bits/deque.tcc	2002-08-09 18:51:15.000000000 +0200
+++ libstdc++-v3/include/bits/deque.tcc	2002-12-03 21:10:16.000000000 +0100
@@ -282,7 +282,7 @@
       _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
                           forward_iterator_tag)
       {
-        size_type __n = distance(__first, __last);
+        size_type __n = std::distance(__first, __last);
         _M_initialize_map(__n);
       
         _Map_pointer __cur_node;
@@ -442,7 +442,7 @@
                           _ForwardIterator __first, _ForwardIterator __last,
                           forward_iterator_tag)
       {
-        size_type __n = distance(__first, __last);
+        size_type __n = std::distance(__first, __last);
         if (__pos._M_cur == _M_start._M_cur)
         {
           iterator __new_start = _M_reserve_elements_at_front(__n);
@@ -758,7 +758,7 @@
       else
       {
         size_type __new_map_size = 
-          _M_map_size + max(_M_map_size, __nodes_to_add) + 2;
+          _M_map_size + std::max(_M_map_size, __nodes_to_add) + 2;
     
         _Map_pointer __new_map = _M_allocate_map(__new_map_size);
         __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
diff -urN libstdc++-v3-orig/include/bits/fstream.tcc libstdc++-v3/include/bits/fstream.tcc
--- libstdc++-v3-orig/include/bits/fstream.tcc	2002-11-12 00:18:04.000000000 +0100
+++ libstdc++-v3/include/bits/fstream.tcc	2002-12-03 21:12:55.000000000 +0100
@@ -439,7 +439,7 @@
 	  else
 	    {
 	      __ret = _M_file.seekoff(__off, ios_base::cur, __mode);
-	      __ret += max(_M_out_cur, _M_in_cur) - _M_filepos;
+	      __ret += std::max(_M_out_cur, _M_in_cur) - _M_filepos;
 	    }
 	}
       _M_last_overflowed = false;	
diff -urN libstdc++-v3-orig/include/bits/istream.tcc libstdc++-v3/include/bits/istream.tcc
--- libstdc++-v3-orig/include/bits/istream.tcc	2002-11-06 00:46:22.000000000 +0100
+++ libstdc++-v3/include/bits/istream.tcc	2002-12-03 21:16:37.000000000 +0100
@@ -724,7 +724,7 @@
 	      __streambuf_type* __sb = this->rdbuf();
 	      int_type __c;
 	      
-	      __n = min(__n, numeric_limits<streamsize>::max());
+	      __n = std::min(__n, numeric_limits<streamsize>::max());
 	      while (_M_gcount < __n  
 		     && !traits_type::eq_int_type(__c = __sb->sbumpc(), __eof))
 		{
@@ -815,7 +815,7 @@
 	      streamsize __num = this->rdbuf()->in_avail();
 	      if (__num >= 0)
 		{
-		  __num = min(__num, __n);
+		  __num = std::min(__num, __n);
 		  if (__num)
 		    _M_gcount = this->rdbuf()->sgetn(__s, __num);
 		}
diff -urN libstdc++-v3-orig/include/bits/locale_facets.tcc libstdc++-v3/include/bits/locale_facets.tcc
--- libstdc++-v3-orig/include/bits/locale_facets.tcc	2002-11-01 18:30:35.000000000 +0100
+++ libstdc++-v3/include/bits/locale_facets.tcc	2002-12-03 21:17:33.000000000 +0100
@@ -1628,8 +1628,8 @@
 	  // Find smallest matching string.
 	  size_t __minlen = 10;
 	  for (size_t __i2 = 0; __i2 < __nmatches; ++__i2)
-	    __minlen = min(__minlen, 
-			   __traits_type::length(__names[__matches[__i2]]));
+	    __minlen = std::min(__minlen, 
+				__traits_type::length(__names[__matches[__i2]]));
 	  
 	  if (__pos < __minlen && __beg != __end)
 	    {
diff -urN libstdc++-v3-orig/include/bits/sstream.tcc libstdc++-v3/include/bits/sstream.tcc
--- libstdc++-v3-orig/include/bits/sstream.tcc	2002-11-01 18:30:35.000000000 +0100
+++ libstdc++-v3/include/bits/sstream.tcc	2002-12-03 21:19:38.000000000 +0100
@@ -91,7 +91,7 @@
 	{
 	  if (!__testeof)
 	    {
-	      __size_type __len = max(_M_buf_size, _M_buf_size_opt);
+	      __size_type __len = std::max(_M_buf_size, _M_buf_size_opt);
 	      __len *= 2;
 
 	      if (__testwrite)
diff -urN libstdc++-v3-orig/include/bits/stl_algo.h libstdc++-v3/include/bits/stl_algo.h
--- libstdc++-v3-orig/include/bits/stl_algo.h	2002-04-18 04:55:50.000000000 +0200
+++ libstdc++-v3/include/bits/stl_algo.h	2002-12-03 21:38:31.000000000 +0100
@@ -1780,7 +1780,7 @@
 						      __pred,
 						      __len - __len / 2);
       rotate(__begin, __middle, __end);
-      advance(__begin, distance(__middle, __end));
+      advance(__begin, std::distance(__middle, __end));
       return __begin;
     }
 
@@ -1824,7 +1824,7 @@
 							  __len - __len / 2,
 							  __buffer, __buffer_size);
 	rotate(__begin, __middle, __end);
-	advance(__begin, distance(__middle, __end));
+	advance(__begin, std::distance(__middle, __end));
 	return __begin;
       }
     }
@@ -2271,7 +2271,7 @@
 	__first += __two_step;
       }
 
-      __step_size = min(_Distance(__last - __first), __step_size);
+      __step_size = std::min(_Distance(__last - __first), __step_size);
       merge(__first, __first + __step_size, __first + __step_size, __last,
 	    __result);
     }
@@ -2292,7 +2292,7 @@
 			 __comp);
 	__first += __two_step;
       }
-      __step_size = min(_Distance(__last - __first), __step_size);
+      __step_size = std::min(_Distance(__last - __first), __step_size);
 
       merge(__first, __first + __step_size,
 	    __first + __step_size, __last,
@@ -2781,7 +2781,7 @@
       __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>)
       __glibcpp_function_requires(_LessThanComparableConcept<_Tp>)
 
-      _DistanceType __len = distance(__first, __last);
+      _DistanceType __len = std::distance(__first, __last);
       _DistanceType __half;
       _ForwardIter __middle;
 
@@ -2825,7 +2825,7 @@
       __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
       __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _Tp>)
 
-      _DistanceType __len = distance(__first, __last);
+      _DistanceType __len = std::distance(__first, __last);
       _DistanceType __half;
       _ForwardIter __middle;
 
@@ -2866,7 +2866,7 @@
       __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>)
       __glibcpp_function_requires(_LessThanComparableConcept<_Tp>)
 
-      _DistanceType __len = distance(__first, __last);
+      _DistanceType __len = std::distance(__first, __last);
       _DistanceType __half;
       _ForwardIter __middle;
 
@@ -2910,7 +2910,7 @@
       __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>)
       __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>)
 
-      _DistanceType __len = distance(__first, __last);
+      _DistanceType __len = std::distance(__first, __last);
       _DistanceType __half;
       _ForwardIter __middle;
 
@@ -2958,7 +2958,7 @@
       __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>)
       __glibcpp_function_requires(_LessThanComparableConcept<_Tp>)
 
-      _DistanceType __len = distance(__first, __last);
+      _DistanceType __len = std::distance(__first, __last);
       _DistanceType __half;
       _ForwardIter __middle, __left, __right;
 
@@ -3013,7 +3013,7 @@
       __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _Tp>)
       __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>)
 
-      _DistanceType __len = distance(__first, __last);
+      _DistanceType __len = std::distance(__first, __last);
       _DistanceType __half;
       _ForwardIter __middle, __left, __right;
 
@@ -3223,17 +3223,17 @@
 	__len11 = __len1 / 2;
 	advance(__first_cut, __len11);
 	__second_cut = lower_bound(__middle, __last, *__first_cut);
-	__len22 = distance(__middle, __second_cut);
+	__len22 = std::distance(__middle, __second_cut);
       }
       else {
 	__len22 = __len2 / 2;
 	advance(__second_cut, __len22);
 	__first_cut = upper_bound(__first, __middle, *__second_cut);
-	__len11 = distance(__first, __first_cut);
+	__len11 = std::distance(__first, __first_cut);
       }
       rotate(__first_cut, __middle, __second_cut);
       _BidirectionalIter __new_middle = __first_cut;
-      advance(__new_middle, distance(__middle, __second_cut));
+      advance(__new_middle, std::distance(__middle, __second_cut));
       __merge_without_buffer(__first, __first_cut, __new_middle,
 			     __len11, __len22);
       __merge_without_buffer(__new_middle, __second_cut, __last,
@@ -3268,17 +3268,17 @@
 	__len11 = __len1 / 2;
 	advance(__first_cut, __len11);
 	__second_cut = lower_bound(__middle, __last, *__first_cut, __comp);
-	__len22 = distance(__middle, __second_cut);
+	__len22 = std::distance(__middle, __second_cut);
       }
       else {
 	__len22 = __len2 / 2;
 	advance(__second_cut, __len22);
 	__first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
-	__len11 = distance(__first, __first_cut);
+	__len11 = std::distance(__first, __first_cut);
       }
       rotate(__first_cut, __middle, __second_cut);
       _BidirectionalIter __new_middle = __first_cut;
-      advance(__new_middle, distance(__middle, __second_cut));
+      advance(__new_middle, std::distance(__middle, __second_cut));
       __merge_without_buffer(__first, __first_cut, __new_middle,
 			     __len11, __len22, __comp);
       __merge_without_buffer(__new_middle, __second_cut, __last,
@@ -3313,7 +3313,7 @@
       }
       else {
 	rotate(__first, __middle, __last);
-	advance(__first, distance(__middle, __last));
+	advance(__first, std::distance(__middle, __last));
 	return __first;
       }
     }
@@ -3417,13 +3417,13 @@
 		  __len11 = __len1 / 2;
 		  advance(__first_cut, __len11);
 		  __second_cut = lower_bound(__middle, __last, *__first_cut);
-		  __len22 = distance(__middle, __second_cut);
+		  __len22 = std::distance(__middle, __second_cut);
 	    }
 	    else {
 		  __len22 = __len2 / 2;
 		  advance(__second_cut, __len22);
 		  __first_cut = upper_bound(__first, __middle, *__second_cut);
-		  __len11 = distance(__first, __first_cut);
+		  __len11 = std::distance(__first, __first_cut);
 	    }
 	    _BidirectionalIter __new_middle =
 		  __rotate_adaptive(__first_cut, __middle, __second_cut,
@@ -3469,13 +3469,13 @@
 		  __len11 = __len1 / 2;
 		  advance(__first_cut, __len11);
 		  __second_cut = lower_bound(__middle, __last, *__first_cut, __comp);
-		  __len22 = distance(__middle, __second_cut);
+		  __len22 = std::distance(__middle, __second_cut);
 	    }
 	    else {
 		  __len22 = __len2 / 2;
 		  advance(__second_cut, __len22);
 		  __first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
-		  __len11 = distance(__first, __first_cut);
+		  __len11 = std::distance(__first, __first_cut);
 	    }
 	    _BidirectionalIter __new_middle =
 		  __rotate_adaptive(__first_cut, __middle, __second_cut,
@@ -3524,8 +3524,8 @@
       if (__first == __middle || __middle == __last)
 	return;
 
-      _DistanceType __len1 = distance(__first, __middle);
-      _DistanceType __len2 = distance(__middle, __last);
+      _DistanceType __len1 = std::distance(__first, __middle);
+      _DistanceType __len2 = std::distance(__middle, __last);
 
       _Temporary_buffer<_BidirectionalIter, _ValueType> __buf(__first, __last);
       if (__buf.begin() == 0)
@@ -3577,8 +3577,8 @@
       if (__first == __middle || __middle == __last)
 	return;
 
-      _DistanceType __len1 = distance(__first, __middle);
-      _DistanceType __len2 = distance(__middle, __last);
+      _DistanceType __len1 = std::distance(__first, __middle);
+      _DistanceType __len2 = std::distance(__middle, __last);
 
       _Temporary_buffer<_BidirectionalIter, _ValueType> __buf(__first, __last);
       if (__buf.begin() == 0)
@@ -4271,7 +4271,7 @@
 	return __last1;
       else {
 	_BidirectionalIter1 __result = __rresult.base();
-	advance(__result, -distance(__first2, __last2));
+	advance(__result, -std::distance(__first2, __last2));
 	return __result;
       }
     }
@@ -4301,7 +4301,7 @@
 	return __last1;
       else {
 	_BidirectionalIter1 __result = __rresult.base();
-	advance(__result, -distance(__first2, __last2));
+	advance(__result, -std::distance(__first2, __last2));
 	return __result;
       }
     }
diff -urN libstdc++-v3-orig/include/bits/stl_algobase.h libstdc++-v3/include/bits/stl_algobase.h
--- libstdc++-v3-orig/include/bits/stl_algobase.h	2002-01-04 22:27:32.000000000 +0100
+++ libstdc++-v3/include/bits/stl_algobase.h	2002-12-03 21:40:27.000000000 +0100
@@ -790,7 +790,7 @@
   {
     const size_t __len1 = __last1 - __first1;
     const size_t __len2 = __last2 - __first2;
-    const int __result = memcmp(__first1, __first2, min(__len1, __len2));
+    const int __result = memcmp(__first1, __first2, std::min(__len1, __len2));
     return __result != 0 ? __result < 0 : __len1 < __len2;
   }
 
diff -urN libstdc++-v3-orig/include/bits/stl_bvector.h libstdc++-v3/include/bits/stl_bvector.h
--- libstdc++-v3-orig/include/bits/stl_bvector.h	2002-11-13 23:15:16.000000000 +0100
+++ libstdc++-v3/include/bits/stl_bvector.h	2002-12-03 21:46:37.000000000 +0100
@@ -410,7 +410,7 @@
     template <class _ForwardIterator>
     void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
                              forward_iterator_tag) {
-      size_type __n = distance(__first, __last);
+      size_type __n = std::distance(__first, __last);
       _M_initialize(__n);
       copy(__first, __last, _M_start);
     }
@@ -430,14 +430,14 @@
                          _ForwardIterator __first, _ForwardIterator __last,
                          forward_iterator_tag) {
       if (__first != __last) {
-        size_type __n = distance(__first, __last);
+        size_type __n = std::distance(__first, __last);
         if (capacity() - size() >= __n) {
           copy_backward(__position, end(), _M_finish + difference_type(__n));
           copy(__first, __last, __position);
           _M_finish += difference_type(__n);
         }
         else {
-          size_type __len = size() + max(size(), __n);
+          size_type __len = size() + std::max(size(), __n);
           _Bit_type * __q = _M_bit_alloc(__len);
           iterator __i = copy(begin(), __position, iterator(__q, 0));
           __i = copy(__first, __last, __i);
@@ -592,7 +592,7 @@
     template <class _ForwardIterator>
     void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
                        forward_iterator_tag) {
-      size_type __len = distance(__first, __last);
+      size_type __len = std::distance(__first, __last);
       if (__len < size())
         erase(copy(__first, __last, begin()), end());
       else {
@@ -677,7 +677,7 @@
         _M_finish += difference_type(__n);
       }
       else {
-        size_type __len = size() + max(size(), __n);
+        size_type __len = size() + std::max(size(), __n);
         _Bit_type * __q = _M_bit_alloc(__len);
         iterator __i = copy(begin(), __position, iterator(__q, 0));
         fill_n(__i, __n, __x);
diff -urN libstdc++-v3-orig/include/bits/stl_deque.h libstdc++-v3/include/bits/stl_deque.h
--- libstdc++-v3-orig/include/bits/stl_deque.h	2002-11-22 05:14:13.000000000 +0100
+++ libstdc++-v3/include/bits/stl_deque.h	2002-12-03 21:49:16.000000000 +0100
@@ -497,7 +497,7 @@
     size_t __num_nodes = 
       __num_elements / __deque_buf_size(sizeof(_Tp)) + 1;
   
-    _M_map_size = max((size_t) _S_initial_map_size, __num_nodes + 2);
+    _M_map_size = std::max((size_t) _S_initial_map_size, __num_nodes + 2);
     _M_map = _M_allocate_map(_M_map_size);
   
     // For "small" maps (needing less than _M_map_size nodes), allocation
@@ -1355,7 +1355,7 @@
       _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
                     forward_iterator_tag)
       {
-        size_type __len = distance(__first, __last);
+        size_type __len = std::distance(__first, __last);
         if (__len > size()) {
           _ForwardIterator __mid = __first;
           advance(__mid, size());
diff -urN libstdc++-v3-orig/include/bits/stl_list.h libstdc++-v3/include/bits/stl_list.h
--- libstdc++-v3-orig/include/bits/stl_list.h	2002-09-11 01:19:10.000000000 +0200
+++ libstdc++-v3/include/bits/stl_list.h	2002-12-03 21:50:48.000000000 +0100
@@ -629,7 +629,7 @@
   
     /**  Returns the number of elements in the %list.  */
     size_type
-    size() const { return distance(begin(), end()); }
+    size() const { return std::distance(begin(), end()); }
   
     /**  Returns the size() of the largest possible %list.  */
     size_type
diff -urN libstdc++-v3-orig/include/bits/stl_tempbuf.h libstdc++-v3/include/bits/stl_tempbuf.h
--- libstdc++-v3-orig/include/bits/stl_tempbuf.h	2002-03-27 22:41:34.000000000 +0100
+++ libstdc++-v3/include/bits/stl_tempbuf.h	2002-12-03 21:53:06.000000000 +0100
@@ -118,7 +118,7 @@
             _Trivial;
 
     try {
-      _M_len = distance(__first, __last);
+      _M_len = std::distance(__first, __last);
       _M_allocate_buffer();
       if (_M_len > 0)
         _M_initialize_buffer(*__first, _Trivial());
diff -urN libstdc++-v3-orig/include/bits/stl_tree.h libstdc++-v3/include/bits/stl_tree.h
--- libstdc++-v3-orig/include/bits/stl_tree.h	2002-11-22 14:42:13.000000000 +0100
+++ libstdc++-v3/include/bits/stl_tree.h	2002-12-03 21:55:04.000000000 +0100
@@ -1181,7 +1181,7 @@
     _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::erase(const _Key& __x)
     {
       pair<iterator,iterator> __p = equal_range(__x);
-      size_type __n = distance(__p.first, __p.second);
+      size_type __n = std::distance(__p.first, __p.second);
       erase(__p.first, __p.second);
       return __n;
     }
@@ -1306,7 +1306,7 @@
     count(const _Key& __k) const
     {
       pair<const_iterator, const_iterator> __p = equal_range(__k);
-      size_type __n = distance(__p.first, __p.second);
+      size_type __n = std::distance(__p.first, __p.second);
       return __n;
     }
 
diff -urN libstdc++-v3-orig/include/bits/stl_vector.h libstdc++-v3/include/bits/stl_vector.h
--- libstdc++-v3-orig/include/bits/stl_vector.h	2002-11-17 09:22:50.000000000 +0100
+++ libstdc++-v3/include/bits/stl_vector.h	2002-12-03 21:56:21.000000000 +0100
@@ -823,7 +823,7 @@
         _M_range_initialize(_ForwardIterator __first,
 			    _ForwardIterator __last, forward_iterator_tag)
         {
-	  size_type __n = distance(__first, __last);
+	  size_type __n = std::distance(__first, __last);
 	  _M_start = _M_allocate(__n);
 	  _M_end_of_storage = _M_start + __n;
 	  _M_finish = uninitialized_copy(__first, __last, _M_start);
diff -urN libstdc++-v3-orig/include/bits/streambuf.tcc libstdc++-v3/include/bits/streambuf.tcc
--- libstdc++-v3-orig/include/bits/streambuf.tcc	2002-11-22 05:14:13.000000000 +0100
+++ libstdc++-v3/include/bits/streambuf.tcc	2002-12-03 21:58:40.000000000 +0100
@@ -128,7 +128,7 @@
 	  if (__buf_len > 0)
 	    {
 	      size_t __remaining = __n - __ret;
-	      size_t __len = min(__buf_len, __remaining);
+	      size_t __len = std::min(__buf_len, __remaining);
 	      traits_type::copy(__s, _M_in_cur, __len);
 	      __ret += __len;
 	      __s += __len;
@@ -167,7 +167,7 @@
 	  if (__buf_len > 0)
 	    {
 	      off_type __remaining = __n - __ret;
-	      off_type __len = min(__buf_len, __remaining);
+	      off_type __len = std::min(__buf_len, __remaining);
 	      traits_type::copy(_M_out_cur, __s, __len);
 	      __ret += __len;
 	      __s += __len;
diff -urN libstdc++-v3-orig/include/bits/vector.tcc libstdc++-v3/include/bits/vector.tcc
--- libstdc++-v3-orig/include/bits/vector.tcc	2002-11-17 09:22:50.000000000 +0100
+++ libstdc++-v3/include/bits/vector.tcc	2002-12-03 22:01:20.000000000 +0100
@@ -191,7 +191,7 @@
     _M_assign_aux(_ForwardIter __first, _ForwardIter __last,
                   forward_iterator_tag)
     {
-      size_type __len = distance(__first, __last);
+      size_type __len = std::distance(__first, __last);
   
       if (__len > capacity())
       {
@@ -333,7 +333,7 @@
         else
 	  {
 	    const size_type __old_size = size();
-	    const size_type __len = __old_size + max(__old_size, __n);
+	    const size_type __len = __old_size + std::max(__old_size, __n);
 	    iterator __new_start(_M_allocate(__len));
 	    iterator __new_finish(__new_start);
 	    try
@@ -381,7 +381,7 @@
     {
       if (__first != __last)
       {
-        size_type __n = distance(__first, __last);
+        size_type __n = std::distance(__first, __last);
         if (size_type(_M_end_of_storage - _M_finish) >= __n)
         {
           const size_type __elems_after = end() - __position;
@@ -407,7 +407,7 @@
         else
         {
           const size_type __old_size = size();
-          const size_type __len = __old_size + max(__old_size, __n);
+          const size_type __len = __old_size + std::max(__old_size, __n);
           iterator __new_start(_M_allocate(__len));
           iterator __new_finish(__new_start);
           try
diff -urN libstdc++-v3-orig/include/std/std_bitset.h libstdc++-v3/include/std/std_bitset.h
--- libstdc++-v3-orig/include/std/std_bitset.h	2002-06-03 06:45:03.000000000 +0200
+++ libstdc++-v3/include/std/std_bitset.h	2002-12-03 22:15:17.000000000 +0100
@@ -1096,7 +1096,7 @@
     bitset<_Nb>::_M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, size_t __pos, size_t __n)
     {
       reset();
-      const size_t __nbits = min(_Nb, min(__n, __s.size() - __pos));
+      const size_t __nbits = std::min(_Nb, std::min(__n, __s.size() - __pos));
       for (size_t __i = 0; __i < __nbits; ++__i)
 	{
 	  switch(__s[__pos + __nbits - __i - 1])
diff -urN libstdc++-v3-orig/include/std/std_complex.h libstdc++-v3/include/std/std_complex.h
--- libstdc++-v3-orig/include/std/std_complex.h	2002-11-25 19:32:24.000000000 +0100
+++ libstdc++-v3/include/std/std_complex.h	2002-12-03 22:16:44.000000000 +0100
@@ -411,7 +411,7 @@
     {
       _Tp __x = __z.real();
       _Tp __y = __z.imag();
-      const _Tp __s = max(abs(__x), abs(__y));
+      const _Tp __s = std::max(abs(__x), abs(__y));
       if (__s == _Tp())  // well ...
         return __s;
       __x /= __s; 
diff -urN libstdc++-v3-orig/include/std/std_sstream.h libstdc++-v3/include/std/std_sstream.h
--- libstdc++-v3-orig/include/std/std_sstream.h	2002-11-22 05:14:13.000000000 +0100
+++ libstdc++-v3/include/std/std_sstream.h	2002-12-03 22:17:52.000000000 +0100
@@ -141,7 +141,7 @@
 	    // current stringbuf internal buffer.
 	    __size_type __len = _M_string.size();
 	    if (_M_out_cur > _M_out_beg)
-	      __len = max(__size_type(_M_out_end - _M_out_beg), __len);
+	      __len = std::max(__size_type(_M_out_end - _M_out_beg), __len);
 	    return __string_type(_M_out_beg, _M_out_beg + __len);
 	  }
 	else
diff -urN libstdc++-v3-orig/include/std/std_streambuf.h libstdc++-v3/include/std/std_streambuf.h
--- libstdc++-v3-orig/include/std/std_streambuf.h	2002-11-22 05:14:14.000000000 +0100
+++ libstdc++-v3/include/std/std_streambuf.h	2002-12-03 22:15:57.000000000 +0100
@@ -265,7 +265,7 @@
 	if (!_M_pback_init)
 	  {
 	    size_t __dist = _M_in_end - _M_in_cur;
-	    size_t __len = min(_S_pback_size, __dist);
+	    size_t __len = std::min(_S_pback_size, __dist);
 	    traits_type::copy(_M_pback, _M_in_cur, __len);
 	    _M_pback_cur_save = _M_in_cur;
 	    _M_pback_end_save = _M_in_end;
diff -urN libstdc++-v3-orig/src/codecvt.cc libstdc++-v3/src/codecvt.cc
--- libstdc++-v3-orig/src/codecvt.cc	2002-10-09 01:32:23.000000000 +0200
+++ libstdc++-v3/src/codecvt.cc	2002-12-03 22:08:01.000000000 +0100
@@ -64,7 +64,7 @@
 	 extern_type* __to, extern_type* __to_end, 
 	 extern_type*& __to_next) const
   { 
-    size_t __len = min(__from_end - __from, __to_end - __to);
+    size_t __len = std::min(__from_end - __from, __to_end - __to);
     memcpy(__to, __from, __len);
     __from_next = __from; 
     __to_next = __to;
@@ -87,7 +87,7 @@
 	intern_type* __to, intern_type* __to_end, 
 	intern_type*& __to_next) const
   { 
-    size_t __len = min(__from_end - __from, __to_end - __to);
+    size_t __len = std::min(__from_end - __from, __to_end - __to);
     memcpy(__to, __from, __len);
     __from_next = __from; 
     __to_next = __to;
@@ -108,7 +108,7 @@
   codecvt<char, char, mbstate_t>::
   do_length (const state_type&, const extern_type* __from,
 	     const extern_type* __end, size_t __max) const
-  { return min(__max, static_cast<size_t>(__end - __from)); }
+  { return std::min(__max, static_cast<size_t>(__end - __from)); }
   
   int 
   codecvt<char, char, mbstate_t>::
@@ -154,7 +154,7 @@
   codecvt<wchar_t, char, mbstate_t>::
   do_length(const state_type&, const extern_type* __from,
 	    const extern_type* __end, size_t __max) const
-  { return min(__max, static_cast<size_t>(__end - __from)); }
+  { return std::min(__max, static_cast<size_t>(__end - __from)); }
 
   int 
   codecvt<wchar_t, char, mbstate_t>::
diff -urN libstdc++-v3-orig/src/strstream.cc libstdc++-v3/src/strstream.cc
--- libstdc++-v3-orig/src/strstream.cc	2002-09-11 05:36:45.000000000 +0200
+++ libstdc++-v3/src/strstream.cc	2002-12-03 22:10:13.000000000 +0100
@@ -59,7 +59,7 @@
   : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(true), 
     _M_frozen(false), _M_constant(false)
   {
-    streamsize n = max(initial_capacity, streamsize(16));
+    streamsize n = std::max(initial_capacity, streamsize(16));
     
     char* buf = _M_alloc(n);
     if (buf) 
@@ -148,7 +148,7 @@
     if (pptr() == epptr() && _M_dynamic && !_M_frozen && !_M_constant) 
       {
 	ptrdiff_t old_size = epptr() - pbase();
-	ptrdiff_t new_size = max(2 * old_size, ptrdiff_t(1));
+	ptrdiff_t new_size = std::max(2 * old_size, ptrdiff_t(1));
 	
 	char* buf = _M_alloc(new_size);
 	if (buf) 
@@ -168,7 +168,7 @@
 
 	    if (reposition_get)
 	      setg(buf, buf + old_get_offset, buf + 
-		   max(old_get_offset, old_size));
+		   std::max(old_get_offset, old_size));
 
 	    _M_free(old_buffer);
 	  }

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