Commit 93dbe8d7 by Benjamin Kosnik

[multiple changes]


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.

From-SVN: r49032
parent ed168e45
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> 2002-01-18 Loren Rittle <ljrittle@acm.org>
* testsuite/18_support/numeric_limits.cc (test_extrema<long double>): * testsuite/18_support/numeric_limits.cc (test_extrema<long double>):
......
...@@ -33,18 +33,19 @@ ...@@ -33,18 +33,19 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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 char
......
...@@ -33,18 +33,19 @@ ...@@ -33,18 +33,19 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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 char
......
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
......
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
// Information as gleaned from DJGPP <ctype.h> // Information as gleaned from DJGPP <ctype.h>
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false, ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false,
size_t __refs = 0) size_t __refs = 0)
......
...@@ -34,20 +34,21 @@ ...@@ -34,20 +34,21 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? _S_ctable : __table) _M_table(__table == 0 ? classic_table() : __table)
{ } { }
char char
......
...@@ -40,9 +40,10 @@ ...@@ -40,9 +40,10 @@
using _C_legacy::__ctype_b; using _C_legacy::__ctype_b;
#endif #endif
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable = __ctype_b; ctype<char>::classic_table() throw()
{ return __ctype_b; }
#if _GLIBCPP_C_LOCALE_GNU #if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del, ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
size_t __refs) size_t __refs)
...@@ -58,14 +59,14 @@ ...@@ -58,14 +59,14 @@
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), _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; } { _M_c_locale_ctype = NULL; }
#endif #endif
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), _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; } { _M_c_locale_ctype = NULL; }
char char
......
...@@ -34,9 +34,10 @@ ...@@ -34,9 +34,10 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
......
...@@ -34,8 +34,9 @@ ...@@ -34,8 +34,9 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
......
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,26 +33,37 @@ ...@@ -33,26 +33,37 @@
// Information as gleaned from /mingw32/include/ctype.h. // 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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL),
_M_ctable(NULL), _M_table(__table == 0 ? (_pctype) : __table) _M_table(__table ? __table : classic_table())
{ } { }
char char
ctype<char>::do_toupper(char __c) const ctype<char>::do_toupper(char __c) const
{ return ::toupper((int) __c); } { return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); }
const char* const char*
ctype<char>::do_toupper(char* __low, const char* __high) const ctype<char>::do_toupper(char* __low, const char* __high) const
{ {
while (__low < __high) while (__low < __high)
{ {
*__low = ::toupper((int) *__low); *__low = this->do_toupper(*__low);
++__low; ++__low;
} }
return __high; return __high;
...@@ -60,16 +71,19 @@ ...@@ -60,16 +71,19 @@
char char
ctype<char>::do_tolower(char __c) const ctype<char>::do_tolower(char __c) const
{ return ::tolower((int) __c); } { return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); }
const char* const char*
ctype<char>::do_tolower(char* __low, const char* __high) const ctype<char>::do_tolower(char* __low, const char* __high) const
{ {
while (__low < __high) while (__low < __high)
{ {
*__low = ::tolower((int) *__low); *__low = this->do_tolower(*__low);
++__low; ++__low;
} }
return __high; return __high;
} }
...@@ -33,20 +33,21 @@ ...@@ -33,20 +33,21 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : _S_ctable) _M_table(__table ? __table : classic_table())
{ } { }
char char
......
...@@ -33,20 +33,21 @@ ...@@ -33,20 +33,21 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : _S_ctable) _M_table(__table ? __table : classic_table())
{ } { }
char char
......
...@@ -33,20 +33,21 @@ ...@@ -33,20 +33,21 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable; ctype<char>::classic_table() throw()
{ return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_table(__table ? __table : _S_ctable) _M_table(__table ? __table : classic_table())
{ } { }
char char
......
...@@ -34,20 +34,21 @@ ...@@ -34,20 +34,21 @@
// Information as gleaned from /usr/include/ctype.h // Information as gleaned from /usr/include/ctype.h
// Data for classic_table(). const ctype_base::mask*
const ctype_base::mask* ctype<char>::_S_ctable = __ctype_mask; ctype<char>::classic_table() throw()
{ return __ctype_mask; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_table(__table == 0 ? __table : _S_ctable) _M_table(__table == 0 ? __table : classic_table())
{ } { }
char char
......
...@@ -238,7 +238,6 @@ namespace std ...@@ -238,7 +238,6 @@ namespace std
public: public:
static locale::id id; static locale::id id;
static const size_t table_size = 1 + static_cast<unsigned char>(-1); static const size_t table_size = 1 + static_cast<unsigned char>(-1);
static const mask* _S_ctable;
explicit explicit
ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0); ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
...@@ -265,8 +264,7 @@ namespace std ...@@ -265,8 +264,7 @@ namespace std
{ return _M_table; } { return _M_table; }
static const mask* static const mask*
classic_table() throw() classic_table() throw();
{ return _S_ctable; }
virtual virtual
~ctype(); ~ctype();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment