From: Paolo Carlini Date: Sun, 29 Apr 2007 16:06:09 +0000 (+0000) Subject: localefwd.h: Remove redundant inline qualifiers. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=677e29e167fb205d5bee619c68ba057d5211cf73;p=platform%2Fupstream%2Fgcc.git localefwd.h: Remove redundant inline qualifiers. 2007-04-29 Paolo Carlini * include/bits/localefwd.h: Remove redundant inline qualifiers. (__check_facet): Move... * include/bits/basic_ios.h: ... here. (widen(char), narrow(char_type, char)): Define inline. * include/bits/basic_ios.tcc (widen(char), narrow(char_type, char)): Remove. From-SVN: r124282 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8084c5c..4943213 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2007-04-29 Paolo Carlini + + * include/bits/localefwd.h: Remove redundant inline qualifiers. + (__check_facet): Move... + * include/bits/basic_ios.h: ... here. + (widen(char), narrow(char_type, char)): Define inline. + * include/bits/basic_ios.tcc (widen(char), narrow(char_type, char)): + Remove. + 2007-04-27 Paolo Carlini DR 438, [DR]. diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h index d078431..ea9c0dc 100644 --- a/libstdc++-v3/include/bits/basic_ios.h +++ b/libstdc++-v3/include/bits/basic_ios.h @@ -1,6 +1,7 @@ // Iostreams base classes -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +// 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -38,13 +39,22 @@ #pragma GCC system_header -#include #include #include #include +#include _GLIBCXX_BEGIN_NAMESPACE(std) + template + inline const _Facet& + __check_facet(const _Facet* __f) + { + if (!__f) + __throw_bad_cast(); + return *__f; + } + // 27.4.5 Template class basic_ios /** * @brief Virtual base class for all stream classes. @@ -255,7 +265,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) explicit basic_ios(basic_streambuf<_CharT, _Traits>* __sb) : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0), - _M_ctype(0), _M_num_put(0), _M_num_get(0) + _M_ctype(0), _M_num_put(0), _M_num_get(0) { this->init(__sb); } /** @@ -413,7 +423,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html */ char - narrow(char_type __c, char __dfault) const; + narrow(char_type __c, char __dfault) const + { return __check_facet(_M_ctype).narrow(__c, __dfault); } /** * @brief Widens characters. @@ -431,7 +442,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html */ char_type - widen(char __c) const; + widen(char __c) const + { return __check_facet(_M_ctype).widen(__c); } protected: // 27.4.5.1 basic_ios constructors @@ -443,7 +455,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) */ basic_ios() : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false), - _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0) + _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0) { } /** diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc index e8434a5..399e93a 100644 --- a/libstdc++-v3/include/bits/basic_ios.tcc +++ b/libstdc++-v3/include/bits/basic_ios.tcc @@ -1,6 +1,6 @@ // basic_ios member functions -*- C++ -*- -// Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -112,16 +112,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return *this; } - template - char - basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const - { return __check_facet(_M_ctype).narrow(__c, __dfault); } - - template - _CharT - basic_ios<_CharT, _Traits>::widen(char __c) const - { return __check_facet(_M_ctype).widen(__c); } - // Locales: template locale diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h index aff3e23..94a7363 100644 --- a/libstdc++-v3/include/bits/localefwd.h +++ b/libstdc++-v3/include/bits/localefwd.h @@ -1,6 +1,7 @@ // Locale support -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +// 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -43,67 +44,74 @@ #pragma GCC system_header #include -#include // Defines __c_locale, config-specific includes -#include // For ostreambuf_iterator, istreambuf_iterator +#include // Defines __c_locale, config-specific include +#include // For ostreambuf_iterator, istreambuf_iterator #include -#include _GLIBCXX_BEGIN_NAMESPACE(std) // 22.1.1 Locale class locale; + template + bool + has_facet(const locale&) throw(); + + template + const _Facet& + use_facet(const locale&); + // 22.1.3 Convenience interfaces template - inline bool + bool isspace(_CharT, const locale&); template - inline bool + bool isprint(_CharT, const locale&); template - inline bool + bool iscntrl(_CharT, const locale&); template - inline bool + bool isupper(_CharT, const locale&); template - inline bool + bool islower(_CharT, const locale&); template - inline bool + bool isalpha(_CharT, const locale&); template - inline bool + bool isdigit(_CharT, const locale&); template - inline bool + bool ispunct(_CharT, const locale&); template - inline bool + bool isxdigit(_CharT, const locale&); template - inline bool + bool isalnum(_CharT, const locale&); template - inline bool + bool isgraph(_CharT, const locale&); template - inline _CharT + _CharT toupper(_CharT, const locale&); template - inline _CharT + _CharT tolower(_CharT, const locale&); // 22.2.1 and 22.2.1.3 ctype @@ -175,23 +183,6 @@ _GLIBCXX_END_LDBL_NAMESPACE template class messages_byname; - template - bool - has_facet(const locale& __loc) throw(); - - template - const _Facet& - use_facet(const locale& __loc); - - template - inline const _Facet& - __check_facet(const _Facet* __f) - { - if (!__f) - __throw_bad_cast(); - return *__f; - } - _GLIBCXX_END_NAMESPACE #endif