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] enum consistency, __num_base cleanups


Removes some unused functions I noticed from the __locale_cache work
last week. Also, tripped over enum issue, as some used _S_* style as
suggested in C++STYLE, others not, convert to all using
C++STYLE. Others, mostly minor, but wanted to get these in before I
forgot about them.

tested x86/linux

2003-05-06  Benjamin Kosnik  <bkoz@redhat.com>
	
	* include/bits/stl_algo.h: Enums as _S_.
	* include/bits/stl_tree.h: Same.
	* include/bits/stl_bvector.h: Same.
	* include/bits/ios_base.h: Same.
	* include/bits/stl_alloc.h: Same.
	* include/ext/stl_hashtable.h: Same.
	* src/ios.cc: And here.
	
	* include/std/std_sstream.h: Replace _M_really_sync to _M_sync. 
	* include/bits/sstream.tcc: Same.

        * include/bits/basic_ios.h: Correct spacing for '< ctype'.
 
	* include/bits/locale_facets.tcc: Replace __temp to __tmp.

	* include/bits/locale_facets.h (__num_base): Remove protected.
	Use _S_[io]* names for enumerations.
	(_S_format_int): Remove.
	* include/bits/locale_facets.tcc: Same.
	* src/locale.cc: Same.
	
	* include/std/std_sstream.h (stringbuf::str): Tweak formatting.

Index: include/bits/basic_ios.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/basic_ios.h,v
retrieving revision 1.19
diff -c -p -r1.19 basic_ios.h
*** include/bits/basic_ios.h	28 Mar 2003 19:45:44 -0000	1.19
--- include/bits/basic_ios.h	7 May 2003 04:29:31 -0000
*************** namespace std 
*** 384,390 ****
         *
         *  Returns the result of
         *  @code
!        *    std::use_facet< ctype<char_type> >(getloc()).narrow(c,dfault)
         *  @endcode
         *
         *  Additional l10n notes are at
--- 384,390 ----
         *
         *  Returns the result of
         *  @code
!        *    std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)
         *  @endcode
         *
         *  Additional l10n notes are at
*************** namespace std 
*** 402,408 ****
         *
         *  Returns the result of
         *  @code
!        *    std::use_facet< ctype<char_type> >(getloc()).widen(c)
         *  @endcode
         *
         *  Additional l10n notes are at
--- 402,408 ----
         *
         *  Returns the result of
         *  @code
!        *    std::use_facet<ctype<char_type> >(getloc()).widen(c)
         *  @endcode
         *
         *  Additional l10n notes are at
Index: include/bits/ios_base.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/ios_base.h,v
retrieving revision 1.26
diff -c -p -r1.26 ios_base.h
*** include/bits/ios_base.h	28 Apr 2003 17:14:58 -0000	1.26
--- include/bits/ios_base.h	7 May 2003 04:29:32 -0000
*************** namespace std
*** 52,58 ****
    // as permitted (but not required) in the standard, in order to provide
    // better type safety in iostream calls.  A side effect is that
    // expressions involving them are no longer compile-time constants.
!   enum _Ios_Fmtflags { _M_ios_fmtflags_end = 1L << 16 };
  
    inline _Ios_Fmtflags 
    operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
--- 52,58 ----
    // as permitted (but not required) in the standard, in order to provide
    // better type safety in iostream calls.  A side effect is that
    // expressions involving them are no longer compile-time constants.
!   enum _Ios_Fmtflags { _S_ios_fmtflags_end = 1L << 16 };
  
    inline _Ios_Fmtflags 
    operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
*************** namespace std
*** 83,89 ****
    { return _Ios_Fmtflags(~static_cast<int>(__a)); }
  
  
!   enum _Ios_Openmode { _M_ios_openmode_end = 1L << 16 };
  
    inline _Ios_Openmode 
    operator&(_Ios_Openmode __a, _Ios_Openmode __b)
--- 83,89 ----
    { return _Ios_Fmtflags(~static_cast<int>(__a)); }
  
  
!   enum _Ios_Openmode { _S_ios_openmode_end = 1L << 16 };
  
    inline _Ios_Openmode 
    operator&(_Ios_Openmode __a, _Ios_Openmode __b)
*************** namespace std
*** 114,120 ****
    { return _Ios_Openmode(~static_cast<int>(__a)); }
  
  
!   enum _Ios_Iostate { _M_ios_iostate_end = 1L << 16 };
  
    inline _Ios_Iostate 
    operator&(_Ios_Iostate __a, _Ios_Iostate __b)
--- 114,120 ----
    { return _Ios_Openmode(~static_cast<int>(__a)); }
  
  
!   enum _Ios_Iostate { _S_ios_iostate_end = 1L << 16 };
  
    inline _Ios_Iostate 
    operator&(_Ios_Iostate __a, _Ios_Iostate __b)
*************** namespace std
*** 144,150 ****
    operator~(_Ios_Iostate __a)
    { return _Ios_Iostate(~static_cast<int>(__a)); }
  
!   enum _Ios_Seekdir { _M_ios_seekdir_end = 1L << 16 };
  
    class __locale_cache_base;
  
--- 144,150 ----
    operator~(_Ios_Iostate __a)
    { return _Ios_Iostate(~static_cast<int>(__a)); }
  
!   enum _Ios_Seekdir { _S_ios_seekdir_end = 1L << 16 };
  
    class __locale_cache_base;
  
*************** namespace std
*** 180,187 ****
        what() const throw();
        
      private:
!       enum { _M_bufsize = 256 };
!       char _M_name[_M_bufsize];
  #endif
      };
  
--- 180,187 ----
        what() const throw();
        
      private:
!       enum { _S_bufsize = 256 };
!       char _M_name[_S_bufsize];
  #endif
      };
  
Index: include/bits/locale_facets.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.h,v
retrieving revision 1.56
diff -c -p -r1.56 locale_facets.h
*** include/bits/locale_facets.h	18 Feb 2003 05:45:06 -0000	1.56
--- include/bits/locale_facets.h	7 May 2003 04:29:35 -0000
*************** namespace std
*** 536,552 ****
      // Below are the indices into _S_atoms_out.
      enum 
        {  
!         _S_minus, 
!         _S_plus, 
!         _S_x, 
!         _S_X, 
!         _S_digits,
!         _S_digits_end = _S_digits + 16,
!         _S_udigits = _S_digits_end,  
!         _S_udigits_end = _S_udigits + 16,
!         _S_e = _S_digits + 14,  // For scientific notation, 'e'
!         _S_E = _S_udigits + 14, // For scientific notation, 'E'
! 	_S_end = _S_udigits_end
        };
      
      // A list of valid numeric literals for output.  This array
--- 536,552 ----
      // Below are the indices into _S_atoms_out.
      enum 
        {  
!         _S_ominus, 
!         _S_oplus, 
!         _S_ox, 
!         _S_oX, 
!         _S_odigits,
!         _S_odigits_end = _S_odigits + 16,
!         _S_oudigits = _S_odigits_end,  
!         _S_oudigits_end = _S_oudigits + 16,
!         _S_oe = _S_odigits + 14,  // For scientific notation, 'e'
!         _S_oE = _S_oudigits + 14, // For scientific notation, 'E'
! 	_S_oend = _S_oudigits_end
        };
      
      // A list of valid numeric literals for output.  This array
*************** namespace std
*** 556,582 ****
      // "-+xX0123456789abcdef0123456789ABCDEF".
      static const char* _S_atoms_out;
  
-   protected:
      // String literal of acceptable (narrow) input, for num_get.
      // "0123456789eEabcdfABCDF"
      static const char* _S_atoms_in;
  
      enum 
      {  
!       _M_zero,
!       _M_e = _M_zero + 10,
!       _M_E = _M_zero + 11,
!       _M_size = 21 + 1
      };
  
      // num_put
      // Construct and return valid scanf format for floating point types.
      static void
      _S_format_float(const ios_base& __io, char* __fptr, char __mod);
-     
-     // Construct and return valid scanf format for integer types.
-     static void
-     _S_format_int(const ios_base& __io, char* __fptr, char __mod, char __modl);
    };
  
  
--- 556,577 ----
      // "-+xX0123456789abcdef0123456789ABCDEF".
      static const char* _S_atoms_out;
  
      // String literal of acceptable (narrow) input, for num_get.
      // "0123456789eEabcdfABCDF"
      static const char* _S_atoms_in;
  
      enum 
      {  
!       _S_izero,
!       _S_ie = _S_izero + 10,
!       _S_iE = _S_izero + 11,
!       _S_iend = 21 + 1
      };
  
      // num_put
      // Construct and return valid scanf format for floating point types.
      static void
      _S_format_float(const ios_base& __io, char* __fptr, char __mod);
    };
  
  
*************** namespace std
*** 1966,1972 ****
        // locale, this is "-+xX0123456789abcdef0123456789ABCDEF".  This
        // array contains the chars after having been passed through the
        // current locale's ctype<_CharT>.widen().
!       _CharT                    _M_literals[__num_base::_S_end];
  
        // The sign used to separate decimal values: for standard US
        // locales, this would usually be: "."  Abstracted from
--- 1961,1967 ----
        // locale, this is "-+xX0123456789abcdef0123456789ABCDEF".  This
        // array contains the chars after having been passed through the
        // current locale's ctype<_CharT>.widen().
!       _CharT                    _M_literals[__num_base::_S_oend];
  
        // The sign used to separate decimal values: for standard US
        // locales, this would usually be: "."  Abstracted from
Index: include/bits/locale_facets.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.96
diff -c -p -r1.96 locale_facets.tcc
*** include/bits/locale_facets.tcc	28 Apr 2003 03:41:49 -0000	1.96
--- include/bits/locale_facets.tcc	7 May 2003 04:29:37 -0000
*************** namespace std
*** 113,119 ****
  	}
  
        // Next, strip leading zeros.
!       const char_type __zero = __ctype.widen(_S_atoms_in[_M_zero]);
        bool __found_zero = false;
        while (__traits_type::eq(__c, __zero) && __beg != __end)
  	{
--- 113,119 ----
  	}
  
        // Next, strip leading zeros.
!       const char_type __zero = __ctype.widen(_S_atoms_in[_S_izero]);
        bool __found_zero = false;
        while (__traits_type::eq(__c, __zero) && __beg != __end)
  	{
*************** namespace std
*** 122,133 ****
  	}
        if (__found_zero)
  	{
! 	  __xtrc += _S_atoms_in[_M_zero];
  	  ++__pos;
  	}
  
        // Only need acceptable digits for floating point numbers.
!       const size_t __len = _M_E - _M_zero + 1;
        char_type  __watoms[__len];
        __ctype.widen(_S_atoms_in, _S_atoms_in + __len, __watoms);
        bool __found_dec = false;
--- 122,133 ----
  	}
        if (__found_zero)
  	{
! 	  __xtrc += _S_atoms_in[_S_izero];
  	  ++__pos;
  	}
  
        // Only need acceptable digits for floating point numbers.
!       const size_t __len = _S_iE - _S_izero + 1;
        char_type  __watoms[__len];
        __ctype.widen(_S_atoms_in, _S_atoms_in + __len, __watoms);
        bool __found_dec = false;
*************** namespace std
*** 183,190 ****
  	      __c = *(++__beg);
  	      __found_dec = true;
  	    }
! 	  else if ((__traits_type::eq(__c, __watoms[_M_e]) 
! 		    || __traits_type::eq(__c, __watoms[_M_E])) 
  		   && !__found_sci && __pos)
  	    {
  	      // Scientific notation.
--- 183,190 ----
  	      __c = *(++__beg);
  	      __found_dec = true;
  	    }
! 	  else if ((__traits_type::eq(__c, __watoms[_S_ie]) 
! 		    || __traits_type::eq(__c, __watoms[_S_iE])) 
  		   && !__found_sci && __pos)
  	    {
  	      // Scientific notation.
*************** namespace std
*** 261,267 ****
  	}
  
        // Next, strip leading zeros and check required digits for base formats.
!       const char_type __zero = __ctype.widen(_S_atoms_in[_M_zero]);
        const char_type __x = __ctype.widen('x');
        const char_type __X = __ctype.widen('X');
        if (__base == 10)
--- 261,267 ----
  	}
  
        // Next, strip leading zeros and check required digits for base formats.
!       const char_type __zero = __ctype.widen(_S_atoms_in[_S_izero]);
        const char_type __x = __ctype.widen('x');
        const char_type __X = __ctype.widen('X');
        if (__base == 10)
*************** namespace std
*** 274,280 ****
  	    }
  	  if (__found_zero)
  	    {
! 	      __xtrc += _S_atoms_in[_M_zero];
  	      ++__pos;
  	      if (__basefield == 0)
  		{	      
--- 274,280 ----
  	    }
  	  if (__found_zero)
  	    {
! 	      __xtrc += _S_atoms_in[_S_izero];
  	      ++__pos;
  	      if (__basefield == 0)
  		{	      
*************** namespace std
*** 296,302 ****
  	{
  	  if (__traits_type::eq(__c, __zero) && __beg != __end)
  	    {
! 	      __xtrc += _S_atoms_in[_M_zero];
  	      ++__pos;
  	      __c = *(++__beg); 
  	      if ((__traits_type::eq(__c, __x) || __traits_type::eq(__c, __X))
--- 296,302 ----
  	{
  	  if (__traits_type::eq(__c, __zero) && __beg != __end)
  	    {
! 	      __xtrc += _S_atoms_in[_S_izero];
  	      ++__pos;
  	      __c = *(++__beg); 
  	      if ((__traits_type::eq(__c, __x) || __traits_type::eq(__c, __X))
*************** namespace std
*** 313,324 ****
        // base digits as valid input.
        size_t __len;
        if (__base == 16)
! 	__len = _M_size;
        else
  	__len = __base;
  
        // Extract.
!       char_type __watoms[_M_size];
        __ctype.widen(_S_atoms_in, _S_atoms_in + __len, __watoms);
        string __found_grouping;
        const string __grouping = __np.grouping();
--- 313,324 ----
        // base digits as valid input.
        size_t __len;
        if (__base == 16)
! 	__len = _S_iend;
        else
  	__len = __base;
  
        // Extract.
!       char_type __watoms[_S_iend];
        __ctype.widen(_S_atoms_in, _S_atoms_in + __len, __watoms);
        string __found_grouping;
        const string __grouping = __np.grouping();
*************** namespace std
*** 682,700 ****
  	  // Octal.
  	  do 
  	    {
! 	      *__buf-- = __lit[(__v & 0x7) + __num_base::_S_digits];
  	      __v >>= 3;
  	    } 
  	  while (__v != 0);
  	  if (__showbase)
! 	    *__buf-- = __lit[__num_base::_S_digits];
  	}
        else if (__builtin_expect(__basefield == ios_base::hex, false))
  	{
  	  // Hex.
  	  const bool __uppercase = __flags & ios_base::uppercase;
! 	  int __case_offset = __uppercase
! 	                      ? __num_base::_S_udigits : __num_base::_S_digits;
  	  do 
  	    {
  	      *__buf-- = __lit[(__v & 0xf) + __case_offset];
--- 682,700 ----
  	  // Octal.
  	  do 
  	    {
! 	      *__buf-- = __lit[(__v & 0x7) + __num_base::_S_odigits];
  	      __v >>= 3;
  	    } 
  	  while (__v != 0);
  	  if (__showbase)
! 	    *__buf-- = __lit[__num_base::_S_odigits];
  	}
        else if (__builtin_expect(__basefield == ios_base::hex, false))
  	{
  	  // Hex.
  	  const bool __uppercase = __flags & ios_base::uppercase;
! 	  int __case_offset = __uppercase ? __num_base::_S_oudigits 
! 	                                  : __num_base::_S_odigits;
  	  do 
  	    {
  	      *__buf-- = __lit[(__v & 0xf) + __case_offset];
*************** namespace std
*** 704,712 ****
  	  if (__showbase)
  	    {
  	      // 'x' or 'X'
! 	      *__buf-- = __lit[__num_base::_S_x + __uppercase];
  	      // '0'
! 	      *__buf-- = __lit[__num_base::_S_digits];
  	    }
  	}
        else
--- 704,712 ----
  	  if (__showbase)
  	    {
  	      // 'x' or 'X'
! 	      *__buf-- = __lit[__num_base::_S_ox + __uppercase];
  	      // '0'
! 	      *__buf-- = __lit[__num_base::_S_odigits];
  	    }
  	}
        else
*************** namespace std
*** 714,727 ****
  	  // Decimal.
  	  do 
  	    {
! 	      *__buf-- = __lit[(__v % 10) + __num_base::_S_digits];
  	      __v /= 10;
  	    } 
  	  while (__v != 0);
  	  if (__neg)
! 	    *__buf-- = __lit[__num_base::_S_minus];
  	  else if (__flags & ios_base::showpos)
! 	    *__buf-- = __lit[__num_base::_S_plus];
  	}
        int __ret = __bufend - __buf - 1;
        return __ret;
--- 714,727 ----
  	  // Decimal.
  	  do 
  	    {
! 	      *__buf-- = __lit[(__v % 10) + __num_base::_S_odigits];
  	      __v /= 10;
  	    } 
  	  while (__v != 0);
  	  if (__neg)
! 	    *__buf-- = __lit[__num_base::_S_ominus];
  	  else if (__flags & ios_base::showpos)
! 	    *__buf-- = __lit[__num_base::_S_oplus];
  	}
        int __ret = __bufend - __buf - 1;
        return __ret;
*************** namespace std
*** 1128,1134 ****
        bool __testdecfound = false; 
  
        // The tentative returned string is stored here.
!       string_type __temp_units;
  
        char_type __c = *__beg;
        char_type __eof = static_cast<char_type>(char_traits<char_type>::eof());
--- 1128,1134 ----
        bool __testdecfound = false; 
  
        // The tentative returned string is stored here.
!       string_type __tmp_units;
  
        char_type __c = *__beg;
        char_type __eof = static_cast<char_type>(char_traits<char_type>::eof());
*************** namespace std
*** 1223,1229 ****
  			}
  		      else
  			{
! 			  __temp_units += __c;
  			  ++__sep_pos;
  			}
  		      __c = *(++__beg);
--- 1223,1229 ----
  			}
  		      else
  			{
! 			  __tmp_units += __c;
  			  ++__sep_pos;
  			}
  		      __c = *(++__beg);
*************** namespace std
*** 1254,1264 ****
  	}
  
        // Strip leading zeros.
!       while (__temp_units[0] == __ctype.widen('0'))
! 	__temp_units.erase(__temp_units.begin());
  
        if (__sign.size() && __sign == __neg_sign)
! 	__temp_units.insert(__temp_units.begin(), __ctype.widen('-'));
  
        // Test for grouping fidelity.
        if (__grouping.size() && __grouping_tmp.size())
--- 1254,1264 ----
  	}
  
        // Strip leading zeros.
!       while (__tmp_units[0] == __ctype.widen('0'))
! 	__tmp_units.erase(__tmp_units.begin());
  
        if (__sign.size() && __sign == __neg_sign)
! 	__tmp_units.insert(__tmp_units.begin(), __ctype.widen('-'));
  
        // Test for grouping fidelity.
        if (__grouping.size() && __grouping_tmp.size())
*************** namespace std
*** 1272,1282 ****
  	__err |= ios_base::eofbit;
  
        // Iff valid sequence is not recognized.
!       if (!__testvalid || !__temp_units.size())
  	__err |= ios_base::failbit;
        else
! 	// Use the "swap trick" to copy __temp_units into __units.
! 	__temp_units.swap(__units);
  
        return __beg; 
      }
--- 1272,1282 ----
  	__err |= ios_base::eofbit;
  
        // Iff valid sequence is not recognized.
!       if (!__testvalid || !__tmp_units.size())
  	__err |= ios_base::failbit;
        else
! 	// Use the "swap trick" to copy __tmp_units into __units.
! 	__tmp_units.swap(__units);
  
        return __beg; 
      }
*************** namespace std
*** 2281,2287 ****
  	{
  	  const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
  	  __ct.widen(__num_base::_S_atoms_out,
! 		     __num_base::_S_atoms_out + __num_base::_S_end, 
  		     _M_literals);
  	}
      }
--- 2281,2287 ----
  	{
  	  const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
  	  __ct.widen(__num_base::_S_atoms_out,
! 		     __num_base::_S_atoms_out + __num_base::_S_oend, 
  		     _M_literals);
  	}
      }
Index: include/bits/sstream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/sstream.tcc,v
retrieving revision 1.28
diff -c -p -r1.28 sstream.tcc
*** include/bits/sstream.tcc	2 May 2003 00:14:49 -0000	1.28
--- include/bits/sstream.tcc	7 May 2003 04:29:37 -0000
*************** namespace std
*** 110,118 ****
  	  _M_string.swap(__tmp);
  	  // Just to be sure...
  	  _M_string.reserve(__len);
! 	  _M_really_sync(const_cast<char_type*>(_M_string.data()),
! 			 this->_M_in_cur - this->_M_in_beg, 
! 			 this->_M_out_cur - this->_M_out_beg);
  	}
        return this->sputc(traits_type::to_char_type(__c));
      }
--- 110,118 ----
  	  _M_string.swap(__tmp);
  	  // Just to be sure...
  	  _M_string.reserve(__len);
! 	  _M_sync(const_cast<char_type*>(_M_string.data()),
! 		  this->_M_in_cur - this->_M_in_beg, 
! 		  this->_M_out_cur - this->_M_out_beg);
  	}
        return this->sputc(traits_type::to_char_type(__c));
      }
Index: include/bits/stl_algo.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_algo.h,v
retrieving revision 1.28
diff -c -p -r1.28 stl_algo.h
*** include/bits/stl_algo.h	16 Dec 2002 18:22:58 -0000	1.28
--- include/bits/stl_algo.h	7 May 2003 04:29:42 -0000
***************
*** 1,6 ****
  // Algorithm implementation -*- C++ -*-
  
! // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
--- 1,6 ----
  // Algorithm implementation -*- C++ -*-
  
! // Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
*************** __result, __binary_pred, _IterType());
*** 1926,1932 ****
     *  This controls some aspect of the sort routines.
     *  @endif
    */
!   enum { _M_threshold = 16 };
  
    /**
     *  @if maint
--- 1926,1932 ----
     *  This controls some aspect of the sort routines.
     *  @endif
    */
!   enum { _S_threshold = 16 };
  
    /**
     *  @if maint
*************** __result, __binary_pred, _IterType());
*** 2053,2061 ****
      void
      __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last)
      {
!       if (__last - __first > _M_threshold) {
! 	__insertion_sort(__first, __first + _M_threshold);
! 	__unguarded_insertion_sort(__first + _M_threshold, __last);
        }
        else
  	__insertion_sort(__first, __last);
--- 2053,2061 ----
      void
      __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last)
      {
!       if (__last - __first > _S_threshold) {
! 	__insertion_sort(__first, __first + _S_threshold);
! 	__unguarded_insertion_sort(__first + _S_threshold, __last);
        }
        else
  	__insertion_sort(__first, __last);
*************** __result, __binary_pred, _IterType());
*** 2071,2079 ****
      __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last,
  			   _Compare __comp)
      {
!       if (__last - __first > _M_threshold) {
! 	__insertion_sort(__first, __first + _M_threshold, __comp);
! 	__unguarded_insertion_sort(__first + _M_threshold, __last, __comp);
        }
        else
  	__insertion_sort(__first, __last, __comp);
--- 2071,2079 ----
      __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last,
  			   _Compare __comp)
      {
!       if (__last - __first > _S_threshold) {
! 	__insertion_sort(__first, __first + _S_threshold, __comp);
! 	__unguarded_insertion_sort(__first + _S_threshold, __last, __comp);
        }
        else
  	__insertion_sort(__first, __last, __comp);
*************** __result, __binary_pred, _IterType());
*** 2105,2111 ****
      {
        typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
  
!       while (__last - __first > _M_threshold) {
  	if (__depth_limit == 0) {
  	  partial_sort(__first, __last, __last);
  	  return;
--- 2105,2111 ----
      {
        typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
  
!       while (__last - __first > _S_threshold) {
  	if (__depth_limit == 0) {
  	  partial_sort(__first, __last, __last);
  	  return;
*************** __result, __binary_pred, _IterType());
*** 2133,2139 ****
      {
        typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
  
!       while (__last - __first > _M_threshold) {
  	if (__depth_limit == 0) {
  	  partial_sort(__first, __last, __last, __comp);
  	  return;
--- 2133,2139 ----
      {
        typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType;
  
!       while (__last - __first > _S_threshold) {
  	if (__depth_limit == 0) {
  	  partial_sort(__first, __last, __last, __comp);
  	  return;
*************** __result, __binary_pred, _IterType());
*** 2300,2306 ****
  	    __comp);
      }
  
!   enum { _M_chunk_size = 7 };
  
    template<typename _RandomAccessIter, typename _Distance>
      void
--- 2300,2306 ----
  	    __comp);
      }
  
!   enum { _S_chunk_size = 7 };
  
    template<typename _RandomAccessIter, typename _Distance>
      void
*************** __result, __binary_pred, _IterType());
*** 2336,2342 ****
        _Distance __len = __last - __first;
        _Pointer __buffer_last = __buffer + __len;
  
!       _Distance __step_size = _M_chunk_size;
        __chunk_insertion_sort(__first, __last, __step_size);
  
        while (__step_size < __len) {
--- 2336,2342 ----
        _Distance __len = __last - __first;
        _Pointer __buffer_last = __buffer + __len;
  
!       _Distance __step_size = _S_chunk_size;
        __chunk_insertion_sort(__first, __last, __step_size);
  
        while (__step_size < __len) {
*************** __result, __binary_pred, _IterType());
*** 2357,2363 ****
        _Distance __len = __last - __first;
        _Pointer __buffer_last = __buffer + __len;
  
!       _Distance __step_size = _M_chunk_size;
        __chunk_insertion_sort(__first, __last, __step_size, __comp);
  
        while (__step_size < __len) {
--- 2357,2363 ----
        _Distance __len = __last - __first;
        _Pointer __buffer_last = __buffer + __len;
  
!       _Distance __step_size = _S_chunk_size;
        __chunk_insertion_sort(__first, __last, __step_size, __comp);
  
        while (__step_size < __len) {
Index: include/bits/stl_alloc.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_alloc.h,v
retrieving revision 1.31
diff -c -p -r1.31 stl_alloc.h
*** include/bits/stl_alloc.h	20 Feb 2003 00:11:43 -0000	1.31
--- include/bits/stl_alloc.h	7 May 2003 04:29:43 -0000
*************** namespace std
*** 260,266 ****
     *
     *  Important implementation properties:
     *  0. If globally mandated, then allocate objects from __new_alloc
!    *  1. If the clients request an object of size > _MAX_BYTES, the resulting
     *     object will be obtained directly from __new_alloc
     *  2. In all other cases, we allocate an object of size exactly
     *     _S_round_up(requested_size).  Thus the client has enough size
--- 260,266 ----
     *
     *  Important implementation properties:
     *  0. If globally mandated, then allocate objects from __new_alloc
!    *  1. If the clients request an object of size > _S_max_bytes, the resulting
     *     object will be obtained directly from __new_alloc
     *  2. In all other cases, we allocate an object of size exactly
     *     _S_round_up(requested_size).  Thus the client has enough size
*************** namespace std
*** 286,294 ****
      class __pool_alloc
      {
      private:
!       enum {_ALIGN = 8};
!       enum {_MAX_BYTES = 128};
!       enum {_NFREELISTS = _MAX_BYTES / _ALIGN};
  
        union _Obj
        {
--- 286,294 ----
      class __pool_alloc
      {
      private:
!       enum {_S_align = 8};
!       enum {_S_max_bytes = 128};
!       enum {_S_freelists = _S_max_bytes / _S_align};
  
        union _Obj
        {
*************** namespace std
*** 296,302 ****
          char        _M_client_data[1];    // The client sees this.
        };
  
!       static _Obj* volatile         _S_free_list[_NFREELISTS];
  
        // Chunk allocation state.
        static char*                  _S_start_free;
--- 296,302 ----
          char        _M_client_data[1];    // The client sees this.
        };
  
!       static _Obj* volatile         _S_free_list[_S_freelists];
  
        // Chunk allocation state.
        static char*                  _S_start_free;
*************** namespace std
*** 308,318 ****
  
        static size_t
        _S_round_up(size_t __bytes)
!       { return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN - 1)); }
  
        static size_t
        _S_freelist_index(size_t __bytes)
!       { return (((__bytes) + (size_t)_ALIGN - 1)/(size_t)_ALIGN - 1); }
  
        // Returns an object of size __n, and optionally adds to size __n
        // free list.
--- 308,318 ----
  
        static size_t
        _S_round_up(size_t __bytes)
!       { return (((__bytes) + (size_t) _S_align-1) & ~((size_t) _S_align - 1)); }
  
        static size_t
        _S_freelist_index(size_t __bytes)
!       { return (((__bytes) + (size_t)_S_align - 1)/(size_t)_S_align - 1); }
  
        // Returns an object of size __n, and optionally adds to size __n
        // free list.
*************** namespace std
*** 351,357 ****
  	      __atomic_add(&_S_force_new, -1);
  	  }
  
! 	if ((__n > (size_t) _MAX_BYTES) || (_S_force_new > 0))
  	  __ret = __new_alloc::allocate(__n);
  	else
  	  {
--- 351,357 ----
  	      __atomic_add(&_S_force_new, -1);
  	  }
  
! 	if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
  	  __ret = __new_alloc::allocate(__n);
  	else
  	  {
*************** namespace std
*** 379,385 ****
        static void
        deallocate(void* __p, size_t __n)
        {
! 	if ((__n > (size_t) _MAX_BYTES) || (_S_force_new > 0))
  	  __new_alloc::deallocate(__p, __n);
  	else
  	  {
--- 379,385 ----
        static void
        deallocate(void* __p, size_t __n)
        {
! 	if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
  	  __new_alloc::deallocate(__p, __n);
  	else
  	  {
*************** namespace std
*** 462,468 ****
                // do not try smaller requests, since that tends to result
                // in disaster on multi-process machines.
                __i = __size;
!               for (; __i <= (size_t) _MAX_BYTES; __i += (size_t) _ALIGN)
                  {
                    __my_free_list = _S_free_list + _S_freelist_index(__i);
                    __p = *__my_free_list;
--- 462,468 ----
                // do not try smaller requests, since that tends to result
                // in disaster on multi-process machines.
                __i = __size;
!               for (; __i <= (size_t) _S_max_bytes; __i += (size_t) _S_align)
                  {
                    __my_free_list = _S_free_list + _S_freelist_index(__i);
                    __p = *__my_free_list;
*************** namespace std
*** 541,547 ****
  
    template<bool __threads, int __inst>
      typename __pool_alloc<__threads,__inst>::_Obj* volatile
!     __pool_alloc<__threads,__inst>::_S_free_list[_NFREELISTS];
  
    typedef __pool_alloc<true,0>    __alloc;
    typedef __pool_alloc<false,0>   __single_client_alloc;
--- 541,547 ----
  
    template<bool __threads, int __inst>
      typename __pool_alloc<__threads,__inst>::_Obj* volatile
!     __pool_alloc<__threads,__inst>::_S_free_list[_S_freelists];
  
    typedef __pool_alloc<true,0>    __alloc;
    typedef __pool_alloc<false,0>   __single_client_alloc;
Index: include/bits/stl_bvector.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_bvector.h,v
retrieving revision 1.22
diff -c -p -r1.22 stl_bvector.h
*** include/bits/stl_bvector.h	28 Apr 2003 23:05:57 -0000	1.22
--- include/bits/stl_bvector.h	7 May 2003 04:29:44 -0000
***************
*** 64,70 ****
  namespace std
  { 
    typedef unsigned long _Bit_type;
!   enum { _M_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) };
  
  struct _Bit_reference {
  
--- 64,70 ----
  namespace std
  { 
    typedef unsigned long _Bit_type;
!   enum { _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) };
  
  struct _Bit_reference {
  
*************** struct _Bit_iterator_base : public itera
*** 100,123 ****
      : _M_p(__x), _M_offset(__y) {}
  
    void _M_bump_up() {
!     if (_M_offset++ == _M_word_bit - 1) {
        _M_offset = 0;
        ++_M_p;
      }
    }
    void _M_bump_down() {
      if (_M_offset-- == 0) {
!       _M_offset = _M_word_bit - 1;
        --_M_p;
      }
    }
  
    void _M_incr(ptrdiff_t __i) {
      difference_type __n = __i + _M_offset;
!     _M_p += __n / _M_word_bit;
!     __n = __n % _M_word_bit;
      if (__n < 0) {
!       _M_offset = (unsigned int) __n + _M_word_bit;
        --_M_p;
      } else
        _M_offset = (unsigned int) __n;
--- 100,123 ----
      : _M_p(__x), _M_offset(__y) {}
  
    void _M_bump_up() {
!     if (_M_offset++ == _S_word_bit - 1) {
        _M_offset = 0;
        ++_M_p;
      }
    }
    void _M_bump_down() {
      if (_M_offset-- == 0) {
!       _M_offset = _S_word_bit - 1;
        --_M_p;
      }
    }
  
    void _M_incr(ptrdiff_t __i) {
      difference_type __n = __i + _M_offset;
!     _M_p += __n / _S_word_bit;
!     __n = __n % _S_word_bit;
      if (__n < 0) {
!       _M_offset = (unsigned int) __n + _S_word_bit;
        --_M_p;
      } else
        _M_offset = (unsigned int) __n;
*************** struct _Bit_iterator_base : public itera
*** 145,151 ****
  
  inline ptrdiff_t
  operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) {
!   return _M_word_bit * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset;
  }
  
  
--- 145,151 ----
  
  inline ptrdiff_t
  operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) {
!   return _S_word_bit * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset;
  }
  
  
*************** public:
*** 277,283 ****
  
  protected:
    _Bit_type * _M_bit_alloc(size_t __n) 
!     { return _M_data_allocator.allocate((__n + _M_word_bit - 1)/_M_word_bit); }
    void _M_deallocate() {
      if (_M_start._M_p)
        _M_data_allocator.deallocate(_M_start._M_p, 
--- 277,283 ----
  
  protected:
    _Bit_type * _M_bit_alloc(size_t __n) 
!     { return _M_data_allocator.allocate((__n + _S_word_bit - 1)/_S_word_bit); }
    void _M_deallocate() {
      if (_M_start._M_p)
        _M_data_allocator.deallocate(_M_start._M_p, 
*************** protected:
*** 307,313 ****
            _Alloc_type;
            
    _Bit_type * _M_bit_alloc(size_t __n) 
!     { return _Alloc_type::allocate((__n + _M_word_bit - 1)/_M_word_bit); }
    void _M_deallocate() {
      if (_M_start._M_p)
        _Alloc_type::deallocate(_M_start._M_p,
--- 307,313 ----
            _Alloc_type;
            
    _Bit_type * _M_bit_alloc(size_t __n) 
!     { return _Alloc_type::allocate((__n + _S_word_bit - 1)/_S_word_bit); }
    void _M_deallocate() {
      if (_M_start._M_p)
        _Alloc_type::deallocate(_M_start._M_p,
*************** template <typename _Alloc> 
*** 374,380 ****
    protected:
      void _M_initialize(size_type __n) {
        _Bit_type * __q = _M_bit_alloc(__n);
!       this->_M_end_of_storage = __q + (__n + _M_word_bit - 1)/_M_word_bit;
        this->_M_start = iterator(__q, 0);
        this->_M_finish = this->_M_start + difference_type(__n);
      }
--- 374,380 ----
    protected:
      void _M_initialize(size_type __n) {
        _Bit_type * __q = _M_bit_alloc(__n);
!       this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit;
        this->_M_start = iterator(__q, 0);
        this->_M_finish = this->_M_start + difference_type(__n);
      }
*************** template <typename _Alloc> 
*** 386,398 ****
        }
        else {
          size_type __len = size() 
! 	                  ? 2 * size() : static_cast<size_type>(_M_word_bit);
          _Bit_type * __q = _M_bit_alloc(__len);
          iterator __i = copy(begin(), __position, iterator(__q, 0));
          *__i++ = __x;
          this->_M_finish = copy(__position, end(), __i);
          _M_deallocate();
!         this->_M_end_of_storage = __q + (__len + _M_word_bit - 1)/_M_word_bit;
          this->_M_start = iterator(__q, 0);
        }
      }
--- 386,398 ----
        }
        else {
          size_type __len = size() 
! 	                  ? 2 * size() : static_cast<size_type>(_S_word_bit);
          _Bit_type * __q = _M_bit_alloc(__len);
          iterator __i = copy(begin(), __position, iterator(__q, 0));
          *__i++ = __x;
          this->_M_finish = copy(__position, end(), __i);
          _M_deallocate();
!         this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit;
          this->_M_start = iterator(__q, 0);
        }
      }
*************** template <typename _Alloc> 
*** 445,451 ****
            this->_M_finish = copy(__position, end(), __i);
            _M_deallocate();
            this->_M_end_of_storage
! 	    = __q + (__len + _M_word_bit - 1)/_M_word_bit;
            this->_M_start = iterator(__q, 0);
          }
        }
--- 445,451 ----
            this->_M_finish = copy(__position, end(), __i);
            _M_deallocate();
            this->_M_end_of_storage
! 	    = __q + (__len + _S_word_bit - 1)/_S_word_bit;
            this->_M_start = iterator(__q, 0);
          }
        }
*************** template <typename _Alloc> 
*** 613,619 ****
          this->_M_finish = copy(begin(), end(), iterator(__q, 0));
          _M_deallocate();
          this->_M_start = iterator(__q, 0);
!         this->_M_end_of_storage = __q + (__n + _M_word_bit - 1)/_M_word_bit;
        }
      }
    
--- 613,619 ----
          this->_M_finish = copy(begin(), end(), iterator(__q, 0));
          _M_deallocate();
          this->_M_start = iterator(__q, 0);
!         this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit;
        }
      }
    
*************** template <typename _Alloc> 
*** 687,693 ****
          fill_n(__i, __n, __x);
          this->_M_finish = copy(__position, end(), __i + difference_type(__n));
          _M_deallocate();
!         this->_M_end_of_storage = __q + (__len + _M_word_bit - 1)/_M_word_bit;
          this->_M_start = iterator(__q, 0);
        }
      }
--- 687,693 ----
          fill_n(__i, __n, __x);
          this->_M_finish = copy(__position, end(), __i + difference_type(__n));
          _M_deallocate();
!         this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit;
          this->_M_start = iterator(__q, 0);
        }
      }
Index: include/bits/stl_tree.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_tree.h,v
retrieving revision 1.19
diff -c -p -r1.19 stl_tree.h
*** include/bits/stl_tree.h	16 Jan 2003 20:30:24 -0000	1.19
--- include/bits/stl_tree.h	7 May 2003 04:29:45 -0000
*************** iterators invalidated are those referrin
*** 90,96 ****
  
  namespace std
  { 
!   enum _Rb_tree_color { _M_red = false, _M_black = true };
  
    struct _Rb_tree_node_base
    {
--- 90,96 ----
  
  namespace std
  { 
!   enum _Rb_tree_color { _S_red = false, _S_black = true };
  
    struct _Rb_tree_node_base
    {
*************** namespace std
*** 156,162 ****
      void 
      _M_decrement()
      {
!       if (_M_node->_M_color == _M_red 
  	  && _M_node->_M_parent->_M_parent == _M_node)
  	_M_node = _M_node->_M_right;
        else if (_M_node->_M_left != 0) 
--- 156,162 ----
      void 
      _M_decrement()
      {
!       if (_M_node->_M_color == _S_red 
  	  && _M_node->_M_parent->_M_parent == _M_node)
  	_M_node = _M_node->_M_right;
        else if (_M_node->_M_left != 0) 
*************** namespace std
*** 305,322 ****
    inline void 
    _Rb_tree_rebalance(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
    {
!     __x->_M_color = _M_red;
      while (__x != __root 
! 	   && __x->_M_parent->_M_color == _M_red) 
        {
  	if (__x->_M_parent == __x->_M_parent->_M_parent->_M_left) 
  	  {
  	    _Rb_tree_node_base* __y = __x->_M_parent->_M_parent->_M_right;
! 	    if (__y && __y->_M_color == _M_red) 
  	      {
! 		__x->_M_parent->_M_color = _M_black;
! 		__y->_M_color = _M_black;
! 		__x->_M_parent->_M_parent->_M_color = _M_red;
  		__x = __x->_M_parent->_M_parent;
  	      }
  	    else 
--- 305,322 ----
    inline void 
    _Rb_tree_rebalance(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
    {
!     __x->_M_color = _S_red;
      while (__x != __root 
! 	   && __x->_M_parent->_M_color == _S_red) 
        {
  	if (__x->_M_parent == __x->_M_parent->_M_parent->_M_left) 
  	  {
  	    _Rb_tree_node_base* __y = __x->_M_parent->_M_parent->_M_right;
! 	    if (__y && __y->_M_color == _S_red) 
  	      {
! 		__x->_M_parent->_M_color = _S_black;
! 		__y->_M_color = _S_black;
! 		__x->_M_parent->_M_parent->_M_color = _S_red;
  		__x = __x->_M_parent->_M_parent;
  	      }
  	    else 
*************** namespace std
*** 326,344 ****
  		    __x = __x->_M_parent;
  		    _Rb_tree_rotate_left(__x, __root);
  		  }
! 		__x->_M_parent->_M_color = _M_black;
! 		__x->_M_parent->_M_parent->_M_color = _M_red;
  		_Rb_tree_rotate_right(__x->_M_parent->_M_parent, __root);
  	      }
  	  }
  	else 
  	  {
  	    _Rb_tree_node_base* __y = __x->_M_parent->_M_parent->_M_left;
! 	    if (__y && __y->_M_color == _M_red) 
  	      {
! 		__x->_M_parent->_M_color = _M_black;
! 		__y->_M_color = _M_black;
! 		__x->_M_parent->_M_parent->_M_color = _M_red;
  		__x = __x->_M_parent->_M_parent;
  	      }
  	    else 
--- 326,344 ----
  		    __x = __x->_M_parent;
  		    _Rb_tree_rotate_left(__x, __root);
  		  }
! 		__x->_M_parent->_M_color = _S_black;
! 		__x->_M_parent->_M_parent->_M_color = _S_red;
  		_Rb_tree_rotate_right(__x->_M_parent->_M_parent, __root);
  	      }
  	  }
  	else 
  	  {
  	    _Rb_tree_node_base* __y = __x->_M_parent->_M_parent->_M_left;
! 	    if (__y && __y->_M_color == _S_red) 
  	      {
! 		__x->_M_parent->_M_color = _S_black;
! 		__y->_M_color = _S_black;
! 		__x->_M_parent->_M_parent->_M_color = _S_red;
  		__x = __x->_M_parent->_M_parent;
  	      }
  	    else 
*************** namespace std
*** 348,360 ****
  		    __x = __x->_M_parent;
  		    _Rb_tree_rotate_right(__x, __root);
  		  }
! 		__x->_M_parent->_M_color = _M_black;
! 		__x->_M_parent->_M_parent->_M_color = _M_red;
  		_Rb_tree_rotate_left(__x->_M_parent->_M_parent, __root);
  	      }
  	  }
        }
!     __root->_M_color = _M_black;
    }
  
    inline _Rb_tree_node_base*
--- 348,360 ----
  		    __x = __x->_M_parent;
  		    _Rb_tree_rotate_right(__x, __root);
  		  }
! 		__x->_M_parent->_M_color = _S_black;
! 		__x->_M_parent->_M_parent->_M_color = _S_red;
  		_Rb_tree_rotate_left(__x->_M_parent->_M_parent, __root);
  	      }
  	  }
        }
!     __root->_M_color = _S_black;
    }
  
    inline _Rb_tree_node_base*
*************** namespace std
*** 430,471 ****
  	  else                      // __x == __z->_M_left
  	    __rightmost = _Rb_tree_node_base::_S_maximum(__x);
        }
!     if (__y->_M_color != _M_red) 
        { 
! 	while (__x != __root && (__x == 0 || __x->_M_color == _M_black))
  	  if (__x == __x_parent->_M_left) 
  	    {
  	      _Rb_tree_node_base* __w = __x_parent->_M_right;
! 	      if (__w->_M_color == _M_red) 
  		{
! 		  __w->_M_color = _M_black;
! 		  __x_parent->_M_color = _M_red;
  		  _Rb_tree_rotate_left(__x_parent, __root);
  		  __w = __x_parent->_M_right;
  		}
  	      if ((__w->_M_left == 0 || 
! 		   __w->_M_left->_M_color == _M_black) &&
  		  (__w->_M_right == 0 || 
! 		   __w->_M_right->_M_color == _M_black)) 
  		{
! 		  __w->_M_color = _M_red;
  		  __x = __x_parent;
  		  __x_parent = __x_parent->_M_parent;
  		} 
  	      else 
  		{
  		  if (__w->_M_right == 0 
! 		      || __w->_M_right->_M_color == _M_black) 
  		    {
! 		      __w->_M_left->_M_color = _M_black;
! 		      __w->_M_color = _M_red;
  		      _Rb_tree_rotate_right(__w, __root);
  		      __w = __x_parent->_M_right;
  		    }
  		  __w->_M_color = __x_parent->_M_color;
! 		  __x_parent->_M_color = _M_black;
  		  if (__w->_M_right) 
! 		    __w->_M_right->_M_color = _M_black;
  		  _Rb_tree_rotate_left(__x_parent, __root);
  		  break;
  		}
--- 430,471 ----
  	  else                      // __x == __z->_M_left
  	    __rightmost = _Rb_tree_node_base::_S_maximum(__x);
        }
!     if (__y->_M_color != _S_red) 
        { 
! 	while (__x != __root && (__x == 0 || __x->_M_color == _S_black))
  	  if (__x == __x_parent->_M_left) 
  	    {
  	      _Rb_tree_node_base* __w = __x_parent->_M_right;
! 	      if (__w->_M_color == _S_red) 
  		{
! 		  __w->_M_color = _S_black;
! 		  __x_parent->_M_color = _S_red;
  		  _Rb_tree_rotate_left(__x_parent, __root);
  		  __w = __x_parent->_M_right;
  		}
  	      if ((__w->_M_left == 0 || 
! 		   __w->_M_left->_M_color == _S_black) &&
  		  (__w->_M_right == 0 || 
! 		   __w->_M_right->_M_color == _S_black)) 
  		{
! 		  __w->_M_color = _S_red;
  		  __x = __x_parent;
  		  __x_parent = __x_parent->_M_parent;
  		} 
  	      else 
  		{
  		  if (__w->_M_right == 0 
! 		      || __w->_M_right->_M_color == _S_black) 
  		    {
! 		      __w->_M_left->_M_color = _S_black;
! 		      __w->_M_color = _S_red;
  		      _Rb_tree_rotate_right(__w, __root);
  		      __w = __x_parent->_M_right;
  		    }
  		  __w->_M_color = __x_parent->_M_color;
! 		  __x_parent->_M_color = _S_black;
  		  if (__w->_M_right) 
! 		    __w->_M_right->_M_color = _S_black;
  		  _Rb_tree_rotate_left(__x_parent, __root);
  		  break;
  		}
*************** namespace std
*** 474,513 ****
  	    {   
  	      // same as above, with _M_right <-> _M_left.
  	      _Rb_tree_node_base* __w = __x_parent->_M_left;
! 	      if (__w->_M_color == _M_red) 
  		{
! 		  __w->_M_color = _M_black;
! 		  __x_parent->_M_color = _M_red;
  		  _Rb_tree_rotate_right(__x_parent, __root);
  		  __w = __x_parent->_M_left;
  		}
  	      if ((__w->_M_right == 0 || 
! 		   __w->_M_right->_M_color == _M_black) &&
  		  (__w->_M_left == 0 || 
! 		   __w->_M_left->_M_color == _M_black)) 
  		{
! 		  __w->_M_color = _M_red;
  		  __x = __x_parent;
  		  __x_parent = __x_parent->_M_parent;
  		} 
  	      else 
  		{
! 		  if (__w->_M_left == 0 || __w->_M_left->_M_color == _M_black) 
  		    {
! 		      __w->_M_right->_M_color = _M_black;
! 		      __w->_M_color = _M_red;
  		      _Rb_tree_rotate_left(__w, __root);
  		      __w = __x_parent->_M_left;
  		    }
  		  __w->_M_color = __x_parent->_M_color;
! 		  __x_parent->_M_color = _M_black;
  		  if (__w->_M_left) 
! 		    __w->_M_left->_M_color = _M_black;
  		  _Rb_tree_rotate_right(__x_parent, __root);
  		  break;
  		}
  	    }
! 	if (__x) __x->_M_color = _M_black;
        }
      return __y;
    }
--- 474,513 ----
  	    {   
  	      // same as above, with _M_right <-> _M_left.
  	      _Rb_tree_node_base* __w = __x_parent->_M_left;
! 	      if (__w->_M_color == _S_red) 
  		{
! 		  __w->_M_color = _S_black;
! 		  __x_parent->_M_color = _S_red;
  		  _Rb_tree_rotate_right(__x_parent, __root);
  		  __w = __x_parent->_M_left;
  		}
  	      if ((__w->_M_right == 0 || 
! 		   __w->_M_right->_M_color == _S_black) &&
  		  (__w->_M_left == 0 || 
! 		   __w->_M_left->_M_color == _S_black)) 
  		{
! 		  __w->_M_color = _S_red;
  		  __x = __x_parent;
  		  __x_parent = __x_parent->_M_parent;
  		} 
  	      else 
  		{
! 		  if (__w->_M_left == 0 || __w->_M_left->_M_color == _S_black) 
  		    {
! 		      __w->_M_right->_M_color = _S_black;
! 		      __w->_M_color = _S_red;
  		      _Rb_tree_rotate_left(__w, __root);
  		      __w = __x_parent->_M_left;
  		    }
  		  __w->_M_color = __x_parent->_M_color;
! 		  __x_parent->_M_color = _S_black;
  		  if (__w->_M_left) 
! 		    __w->_M_left->_M_color = _S_black;
  		  _Rb_tree_rotate_right(__x_parent, __root);
  		  break;
  		}
  	    }
! 	if (__x) __x->_M_color = _S_black;
        }
      return __y;
    }
*************** namespace std
*** 737,743 ****
  	  _M_empty_initialize();
  	else 
  	  {
! 	    _S_color(this->_M_header) = _M_red;
  	    _M_root() = _M_copy(__x._M_root(), this->_M_header);
  	    _M_leftmost() = _S_minimum(_M_root());
  	    _M_rightmost() = _S_maximum(_M_root());
--- 737,743 ----
  	  _M_empty_initialize();
  	else 
  	  {
! 	    _S_color(this->_M_header) = _S_red;
  	    _M_root() = _M_copy(__x._M_root(), this->_M_header);
  	    _M_leftmost() = _S_minimum(_M_root());
  	    _M_rightmost() = _S_maximum(_M_root());
*************** namespace std
*** 753,759 ****
      private:
        void _M_empty_initialize() 
        {
! 	_S_color(this->_M_header) = _M_red; // used to distinguish header from 
  	// __root, in iterator.operator++
  	_M_root() = 0;
  	_M_leftmost() = this->_M_header;
--- 753,759 ----
      private:
        void _M_empty_initialize() 
        {
! 	_S_color(this->_M_header) = _S_red; // used to distinguish header from 
  	// __root, in iterator.operator++
  	_M_root() = 0;
  	_M_leftmost() = this->_M_header;
*************** namespace std
*** 1417,1423 ****
      int __sum = 0;
      do 
        {
! 	if (__node->_M_color == _M_black) 
  	  ++__sum;
  	if (__node == __root) 
  	  break;
--- 1417,1423 ----
      int __sum = 0;
      do 
        {
! 	if (__node->_M_color == _S_black) 
  	  ++__sum;
  	if (__node == __root) 
  	  break;
*************** namespace std
*** 1444,1452 ****
  	_Link_type __L = _S_left(__x);
  	_Link_type __R = _S_right(__x);
  	
! 	if (__x->_M_color == _M_red)
! 	  if ((__L && __L->_M_color == _M_red) 
! 	      || (__R && __R->_M_color == _M_red))
  	    return false;
  	
  	if (__L && _M_key_compare(_S_key(__x), _S_key(__L)))
--- 1444,1452 ----
  	_Link_type __L = _S_left(__x);
  	_Link_type __R = _S_right(__x);
  	
! 	if (__x->_M_color == _S_red)
! 	  if ((__L && __L->_M_color == _S_red) 
! 	      || (__R && __R->_M_color == _S_red))
  	    return false;
  	
  	if (__L && _M_key_compare(_S_key(__x), _S_key(__L)))
Index: include/ext/stl_hashtable.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/ext/stl_hashtable.h,v
retrieving revision 1.18
diff -c -p -r1.18 stl_hashtable.h
*** include/ext/stl_hashtable.h	4 Jul 2002 00:28:02 -0000	1.18
--- include/ext/stl_hashtable.h	7 May 2003 04:29:47 -0000
***************
*** 1,6 ****
  // Hashtable implementation used by containers -*- C++ -*-
  
! // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
--- 1,6 ----
  // Hashtable implementation used by containers -*- C++ -*-
  
! // Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
*************** struct _Hashtable_const_iterator {
*** 180,188 ****
  };
  
  // Note: assumes long is at least 32 bits.
! enum { __stl_num_primes = 28 };
  
! static const unsigned long __stl_prime_list[__stl_num_primes] =
  {
    53ul,         97ul,         193ul,       389ul,       769ul,
    1543ul,       3079ul,       6151ul,      12289ul,     24593ul,
--- 180,188 ----
  };
  
  // Note: assumes long is at least 32 bits.
! enum { _S_num_primes = 28 };
  
! static const unsigned long __stl_prime_list[_S_num_primes] =
  {
    53ul,         97ul,         193ul,       389ul,       769ul,
    1543ul,       3079ul,       6151ul,      12289ul,     24593ul,
*************** static const unsigned long __stl_prime_l
*** 195,201 ****
  inline unsigned long __stl_next_prime(unsigned long __n)
  {
    const unsigned long* __first = __stl_prime_list;
!   const unsigned long* __last = __stl_prime_list + (int)__stl_num_primes;
    const unsigned long* pos = std::lower_bound(__first, __last, __n);
    return pos == __last ? *(__last - 1) : *pos;
  }
--- 195,201 ----
  inline unsigned long __stl_next_prime(unsigned long __n)
  {
    const unsigned long* __first = __stl_prime_list;
!   const unsigned long* __last = __stl_prime_list + (int)_S_num_primes;
    const unsigned long* pos = std::lower_bound(__first, __last, __n);
    return pos == __last ? *(__last - 1) : *pos;
  }
*************** public:
*** 363,369 ****
    size_type bucket_count() const { return _M_buckets.size(); }
  
    size_type max_bucket_count() const
!     { return __stl_prime_list[(int)__stl_num_primes - 1]; } 
  
    size_type elems_in_bucket(size_type __bucket) const
    {
--- 363,369 ----
    size_type bucket_count() const { return _M_buckets.size(); }
  
    size_type max_bucket_count() const
!     { return __stl_prime_list[(int)_S_num_primes - 1]; } 
  
    size_type elems_in_bucket(size_type __bucket) const
    {
Index: include/std/std_sstream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_sstream.h,v
retrieving revision 1.25
diff -c -p -r1.25 std_sstream.h
*** include/std/std_sstream.h	2 May 2003 23:02:03 -0000	1.25
--- include/std/std_sstream.h	7 May 2003 04:29:47 -0000
*************** namespace std
*** 133,143 ****
        __string_type
        str() const
        {
- 	const bool __testout = this->_M_mode & ios_base::out;
  	__string_type __ret = _M_string;
  	if (__testout && this->_M_out_beg < this->_M_out_lim)
! 	  __ret = __string_type(this->_M_out_beg,
! 				this->_M_out_lim);
  	return __ret;
        }
  
--- 133,142 ----
        __string_type
        str() const
        {
  	__string_type __ret = _M_string;
+ 	const bool __testout = this->_M_mode & ios_base::out;
  	if (__testout && this->_M_out_beg < this->_M_out_lim)
! 	  __ret = __string_type(this->_M_out_beg, this->_M_out_lim);
  	return __ret;
        }
  
*************** namespace std
*** 171,177 ****
  	__size_type __len = 0;
  	if (this->_M_mode & (ios_base::ate | ios_base::app))
  	  __len = _M_string.size();
! 	_M_really_sync(const_cast<char_type*>(_M_string.data()), 0, __len);
        }
  
        // Overridden virtual functions:
--- 170,176 ----
  	__size_type __len = 0;
  	if (this->_M_mode & (ios_base::ate | ios_base::app))
  	  __len = _M_string.size();
! 	_M_sync(const_cast<char_type*>(_M_string.data()), 0, __len);
        }
  
        // Overridden virtual functions:
*************** namespace std
*** 220,226 ****
  	    _M_string = __string_type(__s, __n);
  	    
  	    // Step 2: Use the external array.
! 	    _M_really_sync(__s, 0, 0);
  	  }
  	return this;
        }
--- 219,225 ----
  	    _M_string = __string_type(__s, __n);
  	    
  	    // Step 2: Use the external array.
! 	    _M_sync(__s, 0, 0);
  	  }
  	return this;
        }
*************** namespace std
*** 247,253 ****
         *  @endif
        */
        virtual void
!       _M_really_sync(char_type* __base, __size_type __i, __size_type __o)
        {
  	const bool __testin = this->_M_mode & ios_base::in;
  	const bool __testout = this->_M_mode & ios_base::out;
--- 246,252 ----
         *  @endif
        */
        virtual void
!       _M_sync(char_type* __base, __size_type __i, __size_type __o)
        {
  	const bool __testin = this->_M_mode & ios_base::in;
  	const bool __testout = this->_M_mode & ios_base::out;
Index: src/ios.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/ios.cc,v
retrieving revision 1.42
diff -c -p -r1.42 ios.cc
*** src/ios.cc	28 Apr 2003 23:05:57 -0000	1.42
--- src/ios.cc	7 May 2003 04:29:48 -0000
*************** namespace std 
*** 142,149 ****
  
    ios_base::failure::failure(const string& __str) throw()
    {
!     strncpy(_M_name, __str.c_str(), _M_bufsize);
!     _M_name[_M_bufsize - 1] = '\0';
    }
  
    ios_base::failure::~failure() throw()
--- 142,149 ----
  
    ios_base::failure::failure(const string& __str) throw()
    {
!     strncpy(_M_name, __str.c_str(), _S_bufsize);
!     _M_name[_S_bufsize - 1] = '\0';
    }
  
    ios_base::failure::~failure() throw()
Index: src/locale.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale.cc,v
retrieving revision 1.81
diff -c -p -r1.81 locale.cc
*** src/locale.cc	28 Apr 2003 23:05:57 -0000	1.81
--- src/locale.cc	7 May 2003 04:29:49 -0000
*************** namespace std 
*** 531,562 ****
        *__fptr++ = (__flags & ios_base::uppercase) ? 'G' : 'g';
      *__fptr = '\0';
    }
-   
-   void
-   __num_base::_S_format_int(const ios_base& __io, char* __fptr, char __mod, 
- 			    char __modl)
-   {
-     ios_base::fmtflags __flags = __io.flags();
-     *__fptr++ = '%';
-     // [22.2.2.2.2] Table 60
-     if (__flags & ios_base::showpos)
-       *__fptr++ = '+';
-     if (__flags & ios_base::showbase)
-       *__fptr++ = '#';
-     *__fptr++ = 'l';
- 
-     // For long long types.
-     if (__modl)
-       *__fptr++ = __modl;
- 
-     ios_base::fmtflags __bsefield = __flags & ios_base::basefield;
-     if (__bsefield == ios_base::hex)
-       *__fptr++ = (__flags & ios_base::uppercase) ? 'X' : 'x';
-     else if (__bsefield == ios_base::oct)
-       *__fptr++ = 'o';
-     else
-       *__fptr++ = __mod;
-     *__fptr = '\0';
-   }
  } // namespace std
  
--- 531,535 ----


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