diff options
author | Laurynas Biveinis <lauras@softhome.net> | 2001-03-05 04:44:16 +0000 |
---|---|---|
committer | Laurynas Biveinis <lauras@gcc.gnu.org> | 2001-03-05 04:44:16 +0000 |
commit | e49ceff2d177870795b5f65b9e0c62821465481f (patch) | |
tree | 6dac6cd09de97d420090c14fee35bcc0b408897a | |
parent | d9fd5aae76841f6eb601ef0f7fd9ae9869355473 (diff) | |
download | gcc-e49ceff2d177870795b5f65b9e0c62821465481f.zip gcc-e49ceff2d177870795b5f65b9e0c62821465481f.tar.gz gcc-e49ceff2d177870795b5f65b9e0c62821465481f.tar.bz2 |
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 16 | ||||
-rw-r--r-- | libstdc++-v3/config/os/djgpp/bits/ctype_base.h | 31 | ||||
-rw-r--r-- | libstdc++-v3/config/os/djgpp/bits/ctype_inline.h | 12 | ||||
-rw-r--r-- | libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h | 10 |
4 files changed, 42 insertions, 27 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index dd9ef01..05aef91 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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 diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_base.h b/libstdc++-v3/config/os/djgpp/bits/ctype_base.h index b64f470..018e20e 100644 --- a/libstdc++-v3/config/os/djgpp/bits/ctype_base.h +++ b/libstdc++-v3/config/os/djgpp/bits/ctype_base.h @@ -36,22 +36,21 @@ typedef unsigned short mask; // Non-standard typedefs. - 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 - }; + typedef unsigned char * __to_type; + + // 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 }; diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h b/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h index e17fe6d..21958c4 100644 --- a/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h @@ -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; diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h index bbcab08..efc7958 100644 --- a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h +++ b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h @@ -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; |