diff options
author | Greg Bumgardner <bumgard@roguewave.com> | 2001-02-17 17:51:45 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2001-02-17 17:51:45 +0000 |
commit | f5d3e93f974899f1fde4b015e925d25b908a666d (patch) | |
tree | b133e82fcf2e96957914cf1597c56b161b8b285b | |
parent | 6483cbecc479c7adde5b2c348e1211c57730d0fc (diff) | |
download | gcc-f5d3e93f974899f1fde4b015e925d25b908a666d.zip gcc-f5d3e93f974899f1fde4b015e925d25b908a666d.tar.gz gcc-f5d3e93f974899f1fde4b015e925d25b908a666d.tar.bz2 |
std_ostream.h: Replaced usage of _Traits::_S_eos() with _CharT() as per section 17.2.2.1.3.
2001-02-16 Greg Bumgardner <bumgard@roguewave.com>
libstdc++/1734
* include/bits/std_ostream.h: Replaced usage of
_Traits::_S_eos() with _CharT() as per section 17.2.2.1.3.
* include/bits/char_traits.h: Removed non-standard
methods that cannot be used elsewhere.
libstdc++/1885
* include/bits/basic_ios.h: Uncommented #include of
bits/basic_ios.tcc
libstdc++/1897
* include/bits/codecvt.h: See next...
* include/bits/fstream.tcc: See next...
* include/bits/ostream.tcc: Add __extension__
to variable-length arrays.
libstdc++/1967
* include/bits/localefwd.h: Changed int counter type to size_t.
libstdc++/1968
* include/bits/std_fstream.h: Added typedef for __ctype_type.
From-SVN: r39802
-rw-r--r-- | libstdc++-v3/ChangeLog | 24 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/basic_ios.h | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/basic_ios.tcc | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/char_traits.h | 18 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/codecvt.h | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/fstream.tcc | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/localefwd.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/ostream.tcc | 12 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/std_fstream.h | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/std_ostream.h | 4 |
10 files changed, 48 insertions, 37 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f9fe2d36..6203763 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,27 @@ +2001-02-16 Greg Bumgardner <bumgard@roguewave.com> + + libstdc++/1734 + * include/bits/std_ostream.h: Replaced usage of + _Traits::_S_eos() with _CharT() as per section 17.2.2.1.3. + * include/bits/char_traits.h: Removed non-standard + methods that cannot be used elsewhere. + + libstdc++/1885 + * include/bits/basic_ios.h: Uncommented #include of + bits/basic_ios.tcc + + libstdc++/1897 + * include/bits/codecvt.h: See next... + * include/bits/fstream.tcc: See next... + * include/bits/ostream.tcc: Add __extension__ + to variable-length arrays. + + libstdc++/1967 + * include/bits/localefwd.h: Changed int counter type to size_t. + + libstdc++/1968 + * include/bits/std_fstream.h: Added typedef for __ctype_type. + 2001-02-16 Benjamin Kosnik <bkoz@redhat.com> * testsuite/21_strings/char_traits.cc: Move to ... diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h index a6a6a87..d03e656 100644 --- a/libstdc++-v3/include/bits/basic_ios.h +++ b/libstdc++-v3/include/bits/basic_ios.h @@ -31,6 +31,7 @@ #define _CPP_BITS_BASICIOS_H 1 #include <bits/sbuf_iter.h> +#include <bits/locale_facets.h> namespace std { @@ -205,7 +206,7 @@ namespace std { #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export -//#include <bits/basic_ios.tcc> +#include <bits/basic_ios.tcc> #endif #endif /* _CPP_BITS_BASICIOS_H */ @@ -214,3 +215,6 @@ namespace std { + + + diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc index 2b9d6f8..d4178c2 100644 --- a/libstdc++-v3/include/bits/basic_ios.tcc +++ b/libstdc++-v3/include/bits/basic_ios.tcc @@ -1,6 +1,6 @@ // basic_ios locale and locale-related member functions -*- C++ -*- -// Copyright (C) 1999 Free Software Foundation, Inc. +// Copyright (C) 1999, 2001 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 diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index caa90e9..43dee93 100644 --- a/libstdc++-v3/include/bits/char_traits.h +++ b/libstdc++-v3/include/bits/char_traits.h @@ -130,16 +130,10 @@ namespace std { eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } - static state_type - _S_get_state(const pos_type& __pos) { return __pos.state(); } - static int_type eof() { return static_cast<int_type>(-1); } static int_type - _S_eos() { return char_type(); } - - static int_type not_eof(const int_type& __c) { return eq_int_type(__c, eof()) ? int_type(0) : __c; } }; @@ -205,16 +199,10 @@ namespace std { eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } - static state_type - _S_get_state(const pos_type& __pos) { return __pos.state(); } - static int_type eof() { return static_cast<int_type>(EOF); } static int_type - _S_eos() { return char_type(); } - - static int_type not_eof(const int_type& __c) { return (__c == eof()) ? 0 : __c; } }; @@ -276,16 +264,10 @@ namespace std { eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } - static state_type - _S_get_state(const pos_type& __pos) { return __pos.state(); } - static int_type eof() { return static_cast<int_type>(WEOF); } static int_type - _S_eos() { return char_type(); } - - static int_type not_eof(const int_type& __c) { return eq_int_type(__c, eof()) ? 0 : __c; } }; diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h index 8873298..a023102 100644 --- a/libstdc++-v3/include/bits/codecvt.h +++ b/libstdc++-v3/include/bits/codecvt.h @@ -1,6 +1,6 @@ // Locale support (codecvt) -*- C++ -*- -// Copyright (C) 2000 Free Software Foundation, Inc. +// Copyright (C) 2000, 2001 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 @@ -417,7 +417,7 @@ if (__int_bom) { size_t __size = __from_end - __from; - intern_type __cfixed[__size + 1]; + __extension__ intern_type __cfixed[__size + 1]; __cfixed[0] = static_cast<intern_type>(__int_bom); char_traits<intern_type>::copy(__cfixed + 1, __from, __size); __cfrom = reinterpret_cast<char*>(__cfixed); @@ -522,7 +522,7 @@ if (__ext_bom) { size_t __size = __from_end - __from; - extern_type __cfixed[__size + 1]; + __extension__ extern_type __cfixed[__size + 1]; __cfixed[0] = static_cast<extern_type>(__ext_bom); char_traits<extern_type>::copy(__cfixed + 1, __from, __size); __cfrom = reinterpret_cast<char*>(__cfixed); diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 5898a21..be31be0 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -262,7 +262,7 @@ namespace std // Part one: (Re)fill external buf (_M_file->_IO_*) from // external byte sequence (whatever physical byte sink or // FILE actually is.) - char_type __conv_buf[_M_buf_size]; + __extension__ char_type __conv_buf[_M_buf_size]; streamsize __size = _M_file->xsgetn(__conv_buf, _M_buf_size); // Part two: (Re)fill internal buf contents from external buf. @@ -436,7 +436,7 @@ namespace std // stack. Convert internal buffer plus __c (ie, // "pending sequence") to temporary conversion buffer. int __plen = _M_out_end - _M_out_beg; - char_type __pbuf[__plen + 1]; + __extension__ char_type __pbuf[__plen + 1]; traits_type::copy(__pbuf, this->pbase(), __plen); if (!__testeof) { @@ -445,7 +445,7 @@ namespace std } char_type* __pend; - char __conv_buf[__plen]; + __extension__ char __conv_buf[__plen]; char* __conv_end; _M_state_beg = _M_state_cur; diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h index 17a2ec2..d15afd9 100644 --- a/libstdc++-v3/include/bits/localefwd.h +++ b/libstdc++-v3/include/bits/localefwd.h @@ -397,7 +397,7 @@ namespace std { _M_impl = new _Impl(*__other._M_impl, 1); _M_impl->_M_install_facet(&_Facet::id, __f); - for (int __i = 0; __i < _S_num_categories; ++__i) + for (size_t __i = 0; __i < _S_num_categories; ++__i) _M_impl->_M_names[__i] = "*"; } diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index 64e006f..77bce26 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -417,7 +417,7 @@ namespace std { typedef typename traits_type::int_type int_type; int_type __plen = static_cast<size_t>(__newlen - __oldlen); - char_type __pads[__plen]; + __extension__ char_type __pads[__plen]; traits_type::assign(__pads, __plen, __ios.fill()); char_type* __beg; @@ -496,7 +496,7 @@ namespace std { { try { streamsize __w = __out.width(); - _CharT __pads[__w]; + __extension__ _CharT __pads[__w]; __pads[0] = __c; streamsize __len = 1; if (__w > __len) @@ -529,7 +529,7 @@ namespace std { { try { streamsize __w = __out.width(); - char __pads[__w + 1]; + __extension__ char __pads[__w + 1]; __pads[0] = __c; streamsize __len = 1; if (__w > __len) @@ -596,7 +596,7 @@ namespace std { if (__cerb) { size_t __clen = __ctraits_type::length(__s); - _CharT __ws[__clen + 1]; + __extension__ _CharT __ws[__clen + 1]; for (size_t __i = 0; __i <= __clen; ++__i) __ws[__i] = __out.widen(__s[__i]); _CharT* __str = __ws; @@ -604,7 +604,7 @@ namespace std { try { streamsize __len = static_cast<streamsize>(__clen); streamsize __w = __out.width(); - _CharT __pads[__w]; + __extension__ _CharT __pads[__w]; if (__w > __len) { @@ -637,7 +637,7 @@ namespace std { { try { streamsize __w = __out.width(); - char __pads[__w]; + __extension__ char __pads[__w]; streamsize __len = static_cast<streamsize>(_Traits::length(__s)); if (__w > __len) { diff --git a/libstdc++-v3/include/bits/std_fstream.h b/libstdc++-v3/include/bits/std_fstream.h index 4cafb2d..0860650 100644 --- a/libstdc++-v3/include/bits/std_fstream.h +++ b/libstdc++-v3/include/bits/std_fstream.h @@ -1,6 +1,6 @@ // File based streams -*- C++ -*- -// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 @@ -60,7 +60,8 @@ namespace std { typedef typename traits_type::state_type __state_type; typedef codecvt<char_type, char, __state_type> __codecvt_type; typedef typename __codecvt_type::result __res_type; - + typedef ctype<char_type> __ctype_type; + friend class ios_base; // For sync_with_stdio. private: diff --git a/libstdc++-v3/include/bits/std_ostream.h b/libstdc++-v3/include/bits/std_ostream.h index eb63e93..bec1f15 100644 --- a/libstdc++-v3/include/bits/std_ostream.h +++ b/libstdc++-v3/include/bits/std_ostream.h @@ -1,6 +1,6 @@ // Output streams -*- C++ -*- -// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 @@ -262,7 +262,7 @@ namespace std { template<typename _CharT, typename _Traits> basic_ostream<_CharT, _Traits>& ends(basic_ostream<_CharT, _Traits>& __os) - { return __os.put(_Traits::_S_eos()); } + { return __os.put(_CharT()); } template<typename _CharT, typename _Traits> basic_ostream<_CharT, _Traits>& |