From: bkoz Date: Sat, 17 Feb 2001 17:51:45 +0000 (+0000) Subject: 2001-02-16 Greg Bumgardner X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=d47c401cd7b5853886dc9c179fb802ca1f63a7a0;p=pf3gnuchains%2Fgcc-fork.git 2001-02-16 Greg Bumgardner 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39802 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f9fe2d369ea..6203763a16d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,27 @@ +2001-02-16 Greg Bumgardner + + 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 * 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 a6a6a87296f..d03e656b29e 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 +#include namespace std { @@ -205,7 +206,7 @@ namespace std { #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export -//#include +#include #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 2b9d6f87aaa..d4178c286a9 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 caa90e985f9..43dee93fcb2 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(-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(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(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 8873298e476..a02310276c6 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(__int_bom); char_traits::copy(__cfixed + 1, __from, __size); __cfrom = reinterpret_cast(__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(__ext_bom); char_traits::copy(__cfixed + 1, __from, __size); __cfrom = reinterpret_cast(__cfixed); diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 5898a21bc90..be31be06635 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 17a2ec23974..d15afd9e9f9 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 64e006f15ad..77bce2616da 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(__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(__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(_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 4cafb2d9ee3..0860650a4b1 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 __codecvt_type; typedef typename __codecvt_type::result __res_type; - + typedef ctype __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 eb63e93623a..bec1f15e405 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 basic_ostream<_CharT, _Traits>& ends(basic_ostream<_CharT, _Traits>& __os) - { return __os.put(_Traits::_S_eos()); } + { return __os.put(_CharT()); } template basic_ostream<_CharT, _Traits>&