mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-30 07:14:09 +08:00
[multiple changes]
2000-06-12 Benjamin Kosnik <bkoz@purist.soma.redhat.com> * bits/locale_facets.h (ctype<wchar_t>): Remove unnecessary data members. * src/locale.cc: Add cwchar include here. Remove incorrect definitions, and stub them out. * config/generic/ctype.cc (ctype): Remove ctype<wchar_t> bits. * config/solaris/solaris2.7/ctype.cc (ctype): Same. * config/solaris/solaris2.5/ctype.cc (ctype): Same. * config/newlib/ctype.cc: Same. * config/gnu-linux/ctype.cc: Same. * config/bsd/ctype.cc: Same. * config/aix/ctype.cc: Same. 2000-06-12 Branko Cibej <branko.cibej@hermes.si> * config/solaris/solaris2.6/ctype.cc (do_toupper, do_tolower): Use towupper and towlower to convert wide characters. From-SVN: r34511
This commit is contained in:
parent
d54a528ae4
commit
088eb5a274
@ -1,3 +1,22 @@
|
||||
2000-06-12 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
|
||||
|
||||
* bits/locale_facets.h (ctype<wchar_t>): Remove unnecessary data
|
||||
members.
|
||||
* src/locale.cc: Add cwchar include here. Remove incorrect
|
||||
definitions, and stub them out.
|
||||
* config/generic/ctype.cc (ctype): Remove ctype<wchar_t> bits.
|
||||
* config/solaris/solaris2.7/ctype.cc (ctype): Same.
|
||||
* config/solaris/solaris2.5/ctype.cc (ctype): Same.
|
||||
* config/newlib/ctype.cc: Same.
|
||||
* config/gnu-linux/ctype.cc: Same.
|
||||
* config/bsd/ctype.cc: Same.
|
||||
* config/aix/ctype.cc: Same.
|
||||
|
||||
2000-06-12 Branko Cibej <branko.cibej@hermes.si>
|
||||
|
||||
* config/solaris/solaris2.6/ctype.cc (do_toupper, do_tolower): Use
|
||||
towupper and towlower to convert wide characters.
|
||||
|
||||
2000-06-12 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
|
||||
|
||||
* mkcheck.in: Clean up confusion regarding NAME, PRE_NAME.
|
||||
|
@ -390,15 +390,7 @@ namespace std
|
||||
// Types:
|
||||
typedef wchar_t char_type;
|
||||
typedef ctype::mask mask;
|
||||
typedef size_t __table_type;
|
||||
|
||||
private:
|
||||
__to_type const& _M_toupper;
|
||||
__to_type const& _M_tolower;
|
||||
const mask* const& _M_ctable;
|
||||
static const __table_type _S_table_size = ctype<char>::table_size;
|
||||
|
||||
public:
|
||||
static locale::id id;
|
||||
|
||||
explicit
|
||||
|
@ -69,42 +69,3 @@
|
||||
}
|
||||
return __high;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
|
||||
: _M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_ctable(NULL)
|
||||
{ }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(wchar_t __c) const
|
||||
{ return towupper(__c); }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
for (;low < high; ++low)
|
||||
if (*low < _S_table_size)
|
||||
*low = this->do_toupper(*low);
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(wchar_t __c) const
|
||||
{ return towlower(__c); }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low)
|
||||
if (*__low < _S_table_size)
|
||||
*__low = this->do_tolower(*__low);
|
||||
return __high;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -69,38 +69,3 @@
|
||||
}
|
||||
return __high;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
|
||||
: _M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_ctable(NULL)
|
||||
{ }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(char_type __c) const
|
||||
{ return (__c < _S_table_size) ? _S_toupper[__c] : __c; }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
|
||||
{
|
||||
for (;low < high; ++low)
|
||||
if (*low < _S_table_size)
|
||||
*low = _S_toupper[*low];
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(char_type __c) const
|
||||
{ return (__c < _S_table_size) ? _S_tolower[__c] : __c; }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(char_type* __low, const char_type* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low)
|
||||
if (*__low < _S_table_size)
|
||||
*__low = _S_toupper[*__low];
|
||||
return __high;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -69,38 +69,3 @@
|
||||
}
|
||||
return __high;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
|
||||
: _M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_ctable(NULL)
|
||||
{ }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(char_type __c) const
|
||||
{ return (__c < _S_table_size) ? _S_toupper[__c] : __c; }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
|
||||
{
|
||||
for (;low < high; ++low)
|
||||
if (*low < _S_table_size)
|
||||
*low = _S_toupper[*low];
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(char_type __c) const
|
||||
{ return (__c < _S_table_size) ? _S_tolower[__c] : __c; }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(char_type* __low, const char_type* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low)
|
||||
if (*__low < _S_table_size)
|
||||
*__low = _S_toupper[*__low];
|
||||
return __high;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -70,43 +70,3 @@
|
||||
return __high;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
|
||||
: _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
|
||||
_M_ctable(__ctype_b)
|
||||
{ }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(wchar_t __c) const
|
||||
{
|
||||
return ((static_cast<__table_type>(__c) < _S_table_size)
|
||||
? _M_toupper[__c] : __c);
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
for (;low < high; ++low)
|
||||
if (static_cast<__table_type>(*low) < _S_table_size)
|
||||
*low = _M_toupper[*low];
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(wchar_t __c) const
|
||||
{
|
||||
return ((static_cast<__table_type>(__c) < _S_table_size)
|
||||
? _M_tolower[__c] : __c);
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low)
|
||||
if (static_cast<__table_type>(*__low) < _S_table_size)
|
||||
*__low = _M_toupper[*__low];
|
||||
return __high;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -76,45 +76,3 @@
|
||||
return __high;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
|
||||
: _M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_ctable(_ctype_)
|
||||
{ }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(wchar_t __c) const
|
||||
{
|
||||
int __x = __c;
|
||||
bool __testok = __c < _S_table_size && this->is(ctype_base::upper, __c);
|
||||
return (__testok ? (__x - 'A' + 'a') : __x);
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
for (;low < high; ++low)
|
||||
if (*low < _S_table_size)
|
||||
*low = this->do_toupper(*low);
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(wchar_t __c) const
|
||||
{
|
||||
int __x = __c;
|
||||
bool __testok = __c < _S_table_size && this->is(ctype_base::lower, __c);
|
||||
return (__testok ? (__x - 'A' + 'a') : __x);
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low)
|
||||
if (*__low < _S_table_size)
|
||||
*__low = this->do_tolower(*__low);
|
||||
return __high;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -70,49 +70,3 @@
|
||||
return __high;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
|
||||
: _M_toupper(NULL), _M_tolower(NULL),
|
||||
_M_ctable(__ctype)
|
||||
{ }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(wchar_t __c) const
|
||||
{
|
||||
int __x = __c;
|
||||
bool __testok = __c < _S_table_size && this->is(ctype_base::upper, __c);
|
||||
return (__testok ? __x : (__x - 'a' + 'A'));
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
for (;low < high; ++low)
|
||||
if (*low < _S_table_size)
|
||||
*low = this->do_toupper(*low);
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(wchar_t __c) const
|
||||
{
|
||||
int __x = __c;
|
||||
bool __testok = __c < _S_table_size && this->is(ctype_base::lower, __c);
|
||||
return (__testok ? __x: (__x - 'A' + 'a'));
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low)
|
||||
if (*__low < _S_table_size)
|
||||
*__low = this->do_tolower(*__low);
|
||||
return __high;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -69,39 +69,3 @@
|
||||
}
|
||||
return __high;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
|
||||
: _M_toupper(__trans_upper), _M_tolower(__trans_lower),
|
||||
_M_ctable(__ctype_mask)
|
||||
{ }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(wchar_t __c) const
|
||||
{ return (__c < _S_table_size) ? _M_toupper[__c] : __c; }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
for (;low < high; ++low)
|
||||
if (*low < _S_table_size)
|
||||
*low = _M_toupper[*low];
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(wchar_t __c) const
|
||||
{ return (__c < _S_table_size) ? _M_tolower[__c] : __c; }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low)
|
||||
if (*__low < _S_table_size)
|
||||
*__low = _M_toupper[*__low];
|
||||
return __high;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -70,41 +70,4 @@
|
||||
return __high;
|
||||
}
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
|
||||
: _M_toupper(__trans_upper), _M_tolower(__trans_lower),
|
||||
_M_ctable(__ctype_mask)
|
||||
{ }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(wchar_t __c) const
|
||||
{ return (static_cast<__table_type>(__c) < _S_table_size) ? _M_toupper[__c] : __c; }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(wchar_t* low, const wchar_t* high) const
|
||||
{
|
||||
for (;low < high; ++low)
|
||||
if (static_cast<__table_type>(*low) < _S_table_size)
|
||||
*low = _M_toupper[*low];
|
||||
return high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(wchar_t __c) const
|
||||
{ return (static_cast<__table_type>(__c) < _S_table_size) ? _M_tolower[__c] : __c; }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low)
|
||||
if (static_cast<__table_type>(*__low) < _S_table_size)
|
||||
*__low = _M_toupper[*__low];
|
||||
return __high;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -37,7 +37,9 @@
|
||||
#include <bits/std_ostream.h>
|
||||
#include <bits/std_vector.h>
|
||||
#include <bits/std_memory.h> // for auto_ptr
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
#include <bits/std_cwctype.h> // for towupper, etc.
|
||||
#endif
|
||||
namespace std {
|
||||
|
||||
// locale::_Impl
|
||||
@ -641,76 +643,104 @@ namespace std {
|
||||
ctype<wchar_t>::
|
||||
~ctype() { }
|
||||
|
||||
bool
|
||||
ctype<wchar_t>::
|
||||
do_is(mask __m, char_type __c) const
|
||||
{
|
||||
return ((static_cast<__table_type>(__c) < _S_table_size)
|
||||
&& (_M_ctable[__c] & __m));
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::
|
||||
do_is(const wchar_t* __low, const wchar_t* __high, mask* __vec) const
|
||||
// NB: These ctype<wchar_t> methods are not configuration-specific,
|
||||
// unlike the ctype<char> bits.
|
||||
ctype<wchar_t>::ctype(size_t /*__refs*/) throw() { }
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_toupper(wchar_t __c) const
|
||||
{ return ::towupper(__c); }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_toupper(wchar_t* __low, const wchar_t* __high) const
|
||||
{
|
||||
for (; __low < __high; ++__low, ++__vec)
|
||||
*__vec = ((static_cast<__table_type>(*__low) < _S_table_size)
|
||||
? _M_ctable[*__low] : mask(0));
|
||||
while (__low < __high)
|
||||
{
|
||||
*__low = ::towupper(*__low);
|
||||
++__low;
|
||||
}
|
||||
return __high;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::do_tolower(wchar_t __c) const
|
||||
{ return ::towlower(__c); }
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
|
||||
{
|
||||
while (__low < __high)
|
||||
{
|
||||
*__low = ::towlower(*__low);
|
||||
++__low;
|
||||
}
|
||||
return __high;
|
||||
}
|
||||
|
||||
bool
|
||||
ctype<wchar_t>::
|
||||
do_is(mask /*__m*/, char_type /*__c*/) const
|
||||
{
|
||||
// XXX
|
||||
return false;
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::
|
||||
do_scan_is(mask __m, const wchar_t* __low, const wchar_t* __high) const
|
||||
do_is(const wchar_t* __low, const wchar_t* /*__high*/, mask* /*__vec*/) const
|
||||
{
|
||||
while (__low < __high
|
||||
&& (_S_table_size < static_cast<__table_type>(*__low)
|
||||
|| !(_M_ctable[*__low] & __m)))
|
||||
++__low;
|
||||
// XXX
|
||||
return __low;
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::
|
||||
do_scan_is(mask /*__m*/, const wchar_t* __low, const wchar_t* /*__high*/) const
|
||||
{
|
||||
// XXX
|
||||
return __low;
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::
|
||||
do_scan_not(mask __m, const char_type* __low, const char_type* __high) const
|
||||
do_scan_not(mask /*__m*/, const char_type* __low,
|
||||
const char_type* /*__high*/) const
|
||||
{
|
||||
while (__low < __high
|
||||
&& static_cast<__table_type>(*__low) < _S_table_size
|
||||
&& (_M_ctable[*__low] & __m))
|
||||
++__low;
|
||||
// XXX
|
||||
return __low;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype<wchar_t>::
|
||||
do_widen(char __c) const
|
||||
{ return static_cast<wchar_t>((unsigned char)__c); }
|
||||
{
|
||||
// XXX
|
||||
return static_cast<wchar_t>((unsigned char)__c);
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype<wchar_t>::
|
||||
do_widen(const char* __low, const char* __high, wchar_t* __dest) const
|
||||
do_widen(const char* /*__low*/, const char* __high,
|
||||
wchar_t* /*__dest*/) const
|
||||
{
|
||||
while (__low < __high)
|
||||
*__dest++ = static_cast<wchar_t>((unsigned char)*__low++);
|
||||
// XXX
|
||||
return __high;
|
||||
}
|
||||
|
||||
char
|
||||
ctype<wchar_t>::
|
||||
do_narrow(wchar_t __c, char __dfault) const
|
||||
do_narrow(wchar_t /*__c*/, char __dfault) const
|
||||
{
|
||||
return ((static_cast<__table_type>(__c) < _S_table_size)
|
||||
? static_cast<char>(__c) : __dfault);
|
||||
// XXX
|
||||
return __dfault;
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype<wchar_t>::
|
||||
do_narrow(const wchar_t* __low, const wchar_t* __high,
|
||||
char __dfault, char* __dest) const
|
||||
do_narrow(const wchar_t* /*__low*/, const wchar_t* __high,
|
||||
char /*__dfault*/, char* /*__dest*/) const
|
||||
{
|
||||
for (; __low < __high; ++__dest, ++__low)
|
||||
*__dest = (static_cast<__table_type>(*__low) < _S_table_size)
|
||||
? static_cast<char>(*__low) : __dfault;
|
||||
// XXX
|
||||
return __high;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user