diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-01-21 04:08:54 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-01-21 04:08:54 +0000 |
commit | 277bb1d69b1dece27674dd6eb4c47720373e88d4 (patch) | |
tree | 3f0b8007dc93d255d94ed79496e422650245bdce /libstdc++-v3 | |
parent | 87d3145ef24607ef106920379c257caddfd948b5 (diff) | |
download | gcc-277bb1d69b1dece27674dd6eb4c47720373e88d4.tar.gz |
2002-01-20 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h (ctype<char>::classic_table):
Remove definition.
(ctype<char>::_S_ctable): Remove.
* config/os/gnu-linux/bits/ctype_noninline.h
(ctype<char>::_S_table): Remove definition.
(ctype<char>::classic_table): Define.
(ctype<char>::ctype): Replace _S_ctable with classic_table().
* config/os/aix/bits/ctype_noninline.h: Same.
* config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
* config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
* config/os/djgpp/bits/ctype_noninline.h: Same.
* config/os/generic/bits/ctype_noninline.h: Same.
* config/os/gnu-linux/bits/ctype_noninline.h: Same.
* config/os/hpux/bits/ctype_noninline.h: Same.
* config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
* config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
* config/os/mingw32/bits/ctype_noninline.h: Same.
* config/os/newlib/bits/ctype_noninline.h: Same.
* config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
* config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
* config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.
2002-01-20 Danny Smith <dannysmith@users.sourceforge.net>
* config/os/mingw32/bits/ctype_noninline.h: Declare _ctype instead
of _pctype. Use to define _S_ctable. Add definition for alternate
ctor. Initialise _M_ctable to _S_ctable in ctors.
(do_toupper, do_tolower): Use inline code appropriate for C-locale
rather than ::toupper, ::tolower.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49032 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
16 files changed, 118 insertions, 61 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d8ada879324..16dc9b3e088 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,35 @@ +2002-01-20 Benjamin Kosnik <bkoz@redhat.com> + + * include/bits/locale_facets.h (ctype<char>::classic_table): + Remove definition. + (ctype<char>::_S_ctable): Remove. + * config/os/gnu-linux/bits/ctype_noninline.h + (ctype<char>::_S_table): Remove definition. + (ctype<char>::classic_table): Define. + (ctype<char>::ctype): Replace _S_ctable with classic_table(). + * config/os/aix/bits/ctype_noninline.h: Same. + * config/os/bsd/freebsd/bits/ctype_noninline.h: Same. + * config/os/bsd/netbsd/bits/ctype_noninline.h: Same. + * config/os/djgpp/bits/ctype_noninline.h: Same. + * config/os/generic/bits/ctype_noninline.h: Same. + * config/os/gnu-linux/bits/ctype_noninline.h: Same. + * config/os/hpux/bits/ctype_noninline.h: Same. + * config/os/irix/irix5.2/bits/ctype_noninline.h: Same. + * config/os/irix/irix6.5/bits/ctype_noninline.h: Same. + * config/os/mingw32/bits/ctype_noninline.h: Same. + * config/os/newlib/bits/ctype_noninline.h: Same. + * config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same. + * config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same. + * config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same. + +2002-01-20 Danny Smith <dannysmith@users.sourceforge.net> + + * config/os/mingw32/bits/ctype_noninline.h: Declare _ctype instead + of _pctype. Use to define _S_ctable. Add definition for alternate + ctor. Initialise _M_ctable to _S_ctable in ctors. + (do_toupper, do_tolower): Use inline code appropriate for C-locale + rather than ::toupper, ::tolower. + 2002-01-18 Loren Rittle <ljrittle@acm.org> * testsuite/18_support/numeric_limits.cc (test_extrema<long double>): diff --git a/libstdc++-v3/config/os/aix/bits/ctype_noninline.h b/libstdc++-v3/config/os/aix/bits/ctype_noninline.h index dabcae981bf..0e081d79381 100644 --- a/libstdc++-v3/config/os/aix/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/aix/bits/ctype_noninline.h @@ -33,18 +33,19 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; - + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } + ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable) + _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table()) { } ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable) + _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table()) { } char diff --git a/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h b/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h index db58ecb27c4..9b452444daa 100644 --- a/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_noninline.h @@ -33,18 +33,19 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable) + _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table()) { } ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable) + _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table()) { } char diff --git a/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h b/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h index f27d93dbdc7..ee9475ee5fc 100644 --- a/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_noninline.h @@ -33,8 +33,9 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h index fd68e814231..e84468c66ae 100644 --- a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h @@ -33,8 +33,9 @@ // Information as gleaned from DJGPP <ctype.h> - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false, size_t __refs = 0) diff --git a/libstdc++-v3/config/os/generic/bits/ctype_noninline.h b/libstdc++-v3/config/os/generic/bits/ctype_noninline.h index 36846d74a08..9fec00b43d2 100644 --- a/libstdc++-v3/config/os/generic/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/generic/bits/ctype_noninline.h @@ -34,20 +34,21 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; - + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } + ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table == 0 ? _S_ctable : __table) + _M_table(__table == 0 ? classic_table() : __table) { } ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table == 0 ? _S_ctable : __table) + _M_table(__table == 0 ? classic_table() : __table) { } char diff --git a/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h b/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h index 1f2bdcf9e65..86a38fa8f58 100644 --- a/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h @@ -40,9 +40,10 @@ using _C_legacy::__ctype_b; #endif - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable = __ctype_b; - + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return __ctype_b; } + #if _GLIBCPP_C_LOCALE_GNU ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del, size_t __refs) @@ -58,14 +59,14 @@ size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { _M_c_locale_ctype = NULL; } #endif ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { _M_c_locale_ctype = NULL; } char diff --git a/libstdc++-v3/config/os/hpux/bits/ctype_noninline.h b/libstdc++-v3/config/os/hpux/bits/ctype_noninline.h index fae41de2ca0..7ec3b30ed9c 100644 --- a/libstdc++-v3/config/os/hpux/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/hpux/bits/ctype_noninline.h @@ -34,9 +34,10 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; - + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } + ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), diff --git a/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h index 10fef4e5bca..f9df21fb0d0 100644 --- a/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h @@ -34,8 +34,9 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) diff --git a/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h index 73676f0c58c..009e6110b73 100644 --- a/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h @@ -33,8 +33,9 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) diff --git a/libstdc++-v3/config/os/mingw32/bits/ctype_noninline.h b/libstdc++-v3/config/os/mingw32/bits/ctype_noninline.h index a877cf80fa7..11a78436664 100644 --- a/libstdc++-v3/config/os/mingw32/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/mingw32/bits/ctype_noninline.h @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 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 @@ -33,26 +33,37 @@ // Information as gleaned from /mingw32/include/ctype.h. -// This should be in mingw's ctype.h but isn't in older versions + // This should be in mingw's ctype.h but isn't in older versions + // Static classic C-locale table. _ctype[0] is EOF + extern "C" unsigned short __declspec(dllimport) _ctype[]; - extern "C" unsigned short* __declspec(dllimport) _pctype; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return _ctype + 1; } + + ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false, + size_t __refs = 0) + : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { } ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) - : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), _M_tolower(NULL), - _M_ctable(NULL), _M_table(__table == 0 ? (_pctype) : __table) - { } + : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_table(__table ? __table : classic_table()) + { } char ctype<char>::do_toupper(char __c) const - { return ::toupper((int) __c); } + { return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); } const char* ctype<char>::do_toupper(char* __low, const char* __high) const { while (__low < __high) { - *__low = ::toupper((int) *__low); + *__low = this->do_toupper(*__low); ++__low; } return __high; @@ -60,16 +71,19 @@ char ctype<char>::do_tolower(char __c) const - { return ::tolower((int) __c); } + { return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); } const char* ctype<char>::do_tolower(char* __low, const char* __high) const { while (__low < __high) { - *__low = ::tolower((int) *__low); + *__low = this->do_tolower(*__low); ++__low; } return __high; } + + + diff --git a/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h b/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h index 89a486bcd5a..546f5c5ac74 100644 --- a/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h @@ -33,20 +33,21 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { } ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { } char diff --git a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h index a37df89eebb..9ab764a6c17 100644 --- a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h @@ -33,20 +33,21 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; - + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } + ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { } ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(NULL), _M_tolower(NULL), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { } char diff --git a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h index 19ad6d97ef1..8e1c2d76f97 100644 --- a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h @@ -33,20 +33,21 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return 0; } ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(__trans_upper), _M_tolower(__trans_lower), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { } ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(__trans_upper), _M_tolower(__trans_lower), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { } char diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h index c668ae2a3dd..eafc1fc71e2 100644 --- a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h @@ -34,20 +34,21 @@ // Information as gleaned from /usr/include/ctype.h - // Data for classic_table(). - const ctype_base::mask* ctype<char>::_S_ctable = __ctype_mask; + const ctype_base::mask* + ctype<char>::classic_table() throw() + { return __ctype_mask; } ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(__trans_upper), _M_tolower(__trans_lower), - _M_table(__table ? __table : _S_ctable) + _M_table(__table ? __table : classic_table()) { } ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), _M_toupper(__trans_upper), _M_tolower(__trans_lower), - _M_table(__table == 0 ? __table : _S_ctable) + _M_table(__table == 0 ? __table : classic_table()) { } char diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h index 8108bf0c6fc..9f435be5774 100644 --- a/libstdc++-v3/include/bits/locale_facets.h +++ b/libstdc++-v3/include/bits/locale_facets.h @@ -238,7 +238,6 @@ namespace std public: static locale::id id; static const size_t table_size = 1 + static_cast<unsigned char>(-1); - static const mask* _S_ctable; explicit ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0); @@ -265,8 +264,7 @@ namespace std { return _M_table; } static const mask* - classic_table() throw() - { return _S_ctable; } + classic_table() throw(); virtual ~ctype(); |