ctype_base.h (ctype_base): fix __to_type definition.

* config/os/djgpp/ctype_base.h (ctype_base): fix __to_type
        definition. Replace enum with static const variables.

        * config/os/djgpp/ctype_inline.h (ctype<char>::is): remove
        throw specification, fix typos, use <static_cast>.
        (ctype<char>::scan_is): remove throw specification.
        (ctype<char>::scan_not): likewise.

        * config/os/djgpp/ctype_noninline.h (ctype<char>::ctype): fix typo.
        (ctype<char>::do_toupper(char)): use <static_cast>.
        (ctype<char>::do_toupper(char *, const char *)): likewise.
        (ctype<char>::do_tolower(char)): likewise.
        (ctype<char>::do_tolower(char *, const char *)): likewise.

From-SVN: r40243
This commit is contained in:
Laurynas Biveinis 2001-03-05 04:44:16 +00:00 committed by Laurynas Biveinis
parent d9fd5aae76
commit e49ceff2d1
4 changed files with 41 additions and 26 deletions

View File

@ -1,3 +1,19 @@
2001-03-05 Laurynas Biveinis <lauras@softhome.net>
* config/os/djgpp/ctype_base.h (ctype_base): fix __to_type
definition. Replace enum with static const variables.
* config/os/djgpp/ctype_inline.h (ctype<char>::is): remove
throw specification, fix typos, use <static_cast>.
(ctype<char>::scan_is): remove throw specification.
(ctype<char>::scan_not): likewise.
* config/os/djgpp/ctype_noninline.h (ctype<char>::ctype): fix typo.
(ctype<char>::do_toupper(char)): use <static_cast>.
(ctype<char>::do_toupper(char *, const char *)): likewise.
(ctype<char>::do_tolower(char)): likewise.
(ctype<char>::do_tolower(char *, const char *)): likewise.
2001-03-04 Phil Edwards <pme@sources.redhat.com>
http://gcc.gnu.org/ml/libstdc++/2001-03/msg00015.html

View File

@ -36,22 +36,21 @@
typedef unsigned short mask;
// Non-standard typedefs.
typedef unsigned char __to_type;
typedef unsigned char * __to_type;
enum
{
space = __dj_ISSPACE, // Whitespace
print = __dj_ISPRINT, // Printing
cntrl = __dj_ISCNTRL, // Control character
upper = __dj_ISUPPER, // UPPERCASE
lower = __dj_ISLOWER, // lowercase
alpha = __dj_ISALPHA, // Alphabetic
digit = __dj_ISDIGIT, // Numeric
punct = __dj_ISPUNCT, // Punctuation
xdigit = __dj_ISXDIGIT, // Hexadecimal numeric
alnum = __dj_ISAL, // Alphanumeric
graph = __dj_ISGRAPH // Graphical
};
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
static const mask space = __dj_ISSPACE; // Whitespace
static const mask print = __dj_ISPRINT; // Printing
static const mask cntrl = __dj_ISCNTRL; // Control character
static const mask upper = __dj_ISUPPER; // UPPERCASE
static const mask lower = __dj_ISLOWER; // lowercase
static const mask alpha = __dj_ISALPHA; // Alphabetic
static const mask digit = __dj_ISDIGIT; // Numeric
static const mask punct = __dj_ISPUNCT; // Punctuation
static const mask xdigit = __dj_ISXDIGIT; // Hexadecimal numeric
static const mask alnum = __dj_ISALPHA; // Alphanumeric
static const mask graph = __dj_ISGRAPH; // Graphical
};

View File

@ -36,21 +36,21 @@
bool
ctype<char>::
is(mask __m, char __c) const throw()
{ return _M_table[(unsigned char)(__c + 1)] & __m; }
is(mask __m, char __c) const
{ return _M_table[static_cast<unsigned char>(__c + 1)] & __m; }
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const throw()
is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
*__vec++ = _M_table[(unsigned char)(*__low++)];
*__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const throw()
scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
@ -59,7 +59,7 @@
const char*
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const throw()
scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;

View File

@ -40,7 +40,7 @@ extern unsigned char __dj_ctype_tolower[];
ctype<char>::ctype(const mask* __table = 0, bool __del = false,
size_t __refs = 0)
: _Ctype_nois<char>(__refs),
: __ctype_abstract_base<char>(__refs),
_M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper),
_M_tolower(__dj_ctype_tolower),
@ -50,14 +50,14 @@ extern unsigned char __dj_ctype_tolower[];
char
ctype<char>::do_toupper(char __c) const
{ return _M_toupper[(int)(__c)+1]) }
{ return _M_toupper[static_cast<int>(__c)+1]; }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::toupper((int) *__low);
*__low = ::toupper(static_cast<int> (*__low));
++__low;
}
return __high;
@ -65,14 +65,14 @@ extern unsigned char __dj_ctype_tolower[];
char
ctype<char>::do_tolower(char __c) const
{ return _M_tolower[(int)(__c)+1]) }
{ return _M_tolower[static_cast<int>(__c)+1]; }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
*__low = ::tolower((int) *__low);
*__low = ::tolower(static_cast<int> (*__low));
++__low;
}
return __high;