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
This commit is contained in:
Greg Bumgardner 2001-02-17 17:51:45 +00:00 committed by Benjamin Kosnik
parent 6483cbecc4
commit f5d3e93f97
10 changed files with 48 additions and 37 deletions

View File

@ -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> 2001-02-16 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/21_strings/char_traits.cc: Move to ... * testsuite/21_strings/char_traits.cc: Move to ...

View File

@ -31,6 +31,7 @@
#define _CPP_BITS_BASICIOS_H 1 #define _CPP_BITS_BASICIOS_H 1
#include <bits/sbuf_iter.h> #include <bits/sbuf_iter.h>
#include <bits/locale_facets.h>
namespace std { namespace std {
@ -205,7 +206,7 @@ namespace std {
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export # define export
//#include <bits/basic_ios.tcc> #include <bits/basic_ios.tcc>
#endif #endif
#endif /* _CPP_BITS_BASICIOS_H */ #endif /* _CPP_BITS_BASICIOS_H */
@ -214,3 +215,6 @@ namespace std {

View File

@ -1,6 +1,6 @@
// basic_ios locale and locale-related member functions -*- C++ -*- // 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 // 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 // software; you can redistribute it and/or modify it under the

View File

@ -130,15 +130,9 @@ namespace std {
eq_int_type(const int_type& __c1, const int_type& __c2) eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static state_type
_S_get_state(const pos_type& __pos) { return __pos.state(); }
static int_type static int_type
eof() { return static_cast<int_type>(-1); } eof() { return static_cast<int_type>(-1); }
static int_type
_S_eos() { return char_type(); }
static int_type static int_type
not_eof(const int_type& __c) not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? int_type(0) : __c; } { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
@ -205,15 +199,9 @@ namespace std {
eq_int_type(const int_type& __c1, const int_type& __c2) eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static state_type
_S_get_state(const pos_type& __pos) { return __pos.state(); }
static int_type static int_type
eof() { return static_cast<int_type>(EOF); } eof() { return static_cast<int_type>(EOF); }
static int_type
_S_eos() { return char_type(); }
static int_type static int_type
not_eof(const int_type& __c) not_eof(const int_type& __c)
{ return (__c == eof()) ? 0 : __c; } { return (__c == eof()) ? 0 : __c; }
@ -276,15 +264,9 @@ namespace std {
eq_int_type(const int_type& __c1, const int_type& __c2) eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static state_type
_S_get_state(const pos_type& __pos) { return __pos.state(); }
static int_type static int_type
eof() { return static_cast<int_type>(WEOF); } eof() { return static_cast<int_type>(WEOF); }
static int_type
_S_eos() { return char_type(); }
static int_type static int_type
not_eof(const int_type& __c) not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? 0 : __c; } { return eq_int_type(__c, eof()) ? 0 : __c; }

View File

@ -1,6 +1,6 @@
// Locale support (codecvt) -*- C++ -*- // 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 // 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 // software; you can redistribute it and/or modify it under the
@ -417,7 +417,7 @@
if (__int_bom) if (__int_bom)
{ {
size_t __size = __from_end - __from; 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); __cfixed[0] = static_cast<intern_type>(__int_bom);
char_traits<intern_type>::copy(__cfixed + 1, __from, __size); char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
__cfrom = reinterpret_cast<char*>(__cfixed); __cfrom = reinterpret_cast<char*>(__cfixed);
@ -522,7 +522,7 @@
if (__ext_bom) if (__ext_bom)
{ {
size_t __size = __from_end - __from; 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); __cfixed[0] = static_cast<extern_type>(__ext_bom);
char_traits<extern_type>::copy(__cfixed + 1, __from, __size); char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
__cfrom = reinterpret_cast<char*>(__cfixed); __cfrom = reinterpret_cast<char*>(__cfixed);

View File

@ -262,7 +262,7 @@ namespace std
// Part one: (Re)fill external buf (_M_file->_IO_*) from // Part one: (Re)fill external buf (_M_file->_IO_*) from
// external byte sequence (whatever physical byte sink or // external byte sequence (whatever physical byte sink or
// FILE actually is.) // 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); streamsize __size = _M_file->xsgetn(__conv_buf, _M_buf_size);
// Part two: (Re)fill internal buf contents from external buf. // Part two: (Re)fill internal buf contents from external buf.
@ -436,7 +436,7 @@ namespace std
// stack. Convert internal buffer plus __c (ie, // stack. Convert internal buffer plus __c (ie,
// "pending sequence") to temporary conversion buffer. // "pending sequence") to temporary conversion buffer.
int __plen = _M_out_end - _M_out_beg; 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); traits_type::copy(__pbuf, this->pbase(), __plen);
if (!__testeof) if (!__testeof)
{ {
@ -445,7 +445,7 @@ namespace std
} }
char_type* __pend; char_type* __pend;
char __conv_buf[__plen]; __extension__ char __conv_buf[__plen];
char* __conv_end; char* __conv_end;
_M_state_beg = _M_state_cur; _M_state_beg = _M_state_cur;

View File

@ -397,7 +397,7 @@ namespace std
{ {
_M_impl = new _Impl(*__other._M_impl, 1); _M_impl = new _Impl(*__other._M_impl, 1);
_M_impl->_M_install_facet(&_Facet::id, __f); _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] = "*"; _M_impl->_M_names[__i] = "*";
} }

View File

@ -417,7 +417,7 @@ namespace std {
typedef typename traits_type::int_type int_type; typedef typename traits_type::int_type int_type;
int_type __plen = static_cast<size_t>(__newlen - __oldlen); 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()); traits_type::assign(__pads, __plen, __ios.fill());
char_type* __beg; char_type* __beg;
@ -496,7 +496,7 @@ namespace std {
{ {
try { try {
streamsize __w = __out.width(); streamsize __w = __out.width();
_CharT __pads[__w]; __extension__ _CharT __pads[__w];
__pads[0] = __c; __pads[0] = __c;
streamsize __len = 1; streamsize __len = 1;
if (__w > __len) if (__w > __len)
@ -529,7 +529,7 @@ namespace std {
{ {
try { try {
streamsize __w = __out.width(); streamsize __w = __out.width();
char __pads[__w + 1]; __extension__ char __pads[__w + 1];
__pads[0] = __c; __pads[0] = __c;
streamsize __len = 1; streamsize __len = 1;
if (__w > __len) if (__w > __len)
@ -596,7 +596,7 @@ namespace std {
if (__cerb) if (__cerb)
{ {
size_t __clen = __ctraits_type::length(__s); size_t __clen = __ctraits_type::length(__s);
_CharT __ws[__clen + 1]; __extension__ _CharT __ws[__clen + 1];
for (size_t __i = 0; __i <= __clen; ++__i) for (size_t __i = 0; __i <= __clen; ++__i)
__ws[__i] = __out.widen(__s[__i]); __ws[__i] = __out.widen(__s[__i]);
_CharT* __str = __ws; _CharT* __str = __ws;
@ -604,7 +604,7 @@ namespace std {
try { try {
streamsize __len = static_cast<streamsize>(__clen); streamsize __len = static_cast<streamsize>(__clen);
streamsize __w = __out.width(); streamsize __w = __out.width();
_CharT __pads[__w]; __extension__ _CharT __pads[__w];
if (__w > __len) if (__w > __len)
{ {
@ -637,7 +637,7 @@ namespace std {
{ {
try { try {
streamsize __w = __out.width(); streamsize __w = __out.width();
char __pads[__w]; __extension__ char __pads[__w];
streamsize __len = static_cast<streamsize>(_Traits::length(__s)); streamsize __len = static_cast<streamsize>(_Traits::length(__s));
if (__w > __len) if (__w > __len)
{ {

View File

@ -1,6 +1,6 @@
// File based streams -*- C++ -*- // 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 // 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 // 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 typename traits_type::state_type __state_type;
typedef codecvt<char_type, char, __state_type> __codecvt_type; typedef codecvt<char_type, char, __state_type> __codecvt_type;
typedef typename __codecvt_type::result __res_type; typedef typename __codecvt_type::result __res_type;
typedef ctype<char_type> __ctype_type;
friend class ios_base; // For sync_with_stdio. friend class ios_base; // For sync_with_stdio.
private: private:

View File

@ -1,6 +1,6 @@
// Output streams -*- C++ -*- // 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 // 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 // software; you can redistribute it and/or modify it under the
@ -262,7 +262,7 @@ namespace std {
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>&
ends(basic_ostream<_CharT, _Traits>& __os) ends(basic_ostream<_CharT, _Traits>& __os)
{ return __os.put(_Traits::_S_eos()); } { return __os.put(_CharT()); }
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>&