From: Laurynas Biveinis Date: Mon, 5 Mar 2001 04:44:16 +0000 (+0000) Subject: ctype_base.h (ctype_base): fix __to_type definition. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e49ceff2d177870795b5f65b9e0c62821465481f;p=gcc.git 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::is): remove throw specification, fix typos, use . (ctype::scan_is): remove throw specification. (ctype::scan_not): likewise. * config/os/djgpp/ctype_noninline.h (ctype::ctype): fix typo. (ctype::do_toupper(char)): use . (ctype::do_toupper(char *, const char *)): likewise. (ctype::do_tolower(char)): likewise. (ctype::do_tolower(char *, const char *)): likewise. From-SVN: r40243 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index dd9ef014697..05aef915a81 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2001-03-05 Laurynas Biveinis + + * 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::is): remove + throw specification, fix typos, use . + (ctype::scan_is): remove throw specification. + (ctype::scan_not): likewise. + + * config/os/djgpp/ctype_noninline.h (ctype::ctype): fix typo. + (ctype::do_toupper(char)): use . + (ctype::do_toupper(char *, const char *)): likewise. + (ctype::do_tolower(char)): likewise. + (ctype::do_tolower(char *, const char *)): likewise. + 2001-03-04 Phil Edwards 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 b64f4705d23..018e20e4a4a 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::_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 e17fe6d29ab..21958c43641 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:: - 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(__c + 1)] & __m; } const char* ctype:: - 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(*__low++)]; return __high; } const char* ctype:: - 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:: - 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 bbcab083722..efc7958fe01 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::ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0) - : _Ctype_nois(__refs), + : __ctype_abstract_base(__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::do_toupper(char __c) const - { return _M_toupper[(int)(__c)+1]) } + { return _M_toupper[static_cast(__c)+1]; } const char* ctype::do_toupper(char* __low, const char* __high) const { while (__low < __high) { - *__low = ::toupper((int) *__low); + *__low = ::toupper(static_cast (*__low)); ++__low; } return __high; @@ -65,14 +65,14 @@ extern unsigned char __dj_ctype_tolower[]; char ctype::do_tolower(char __c) const - { return _M_tolower[(int)(__c)+1]) } + { return _M_tolower[static_cast(__c)+1]; } const char* ctype::do_tolower(char* __low, const char* __high) const { while (__low < __high) { - *__low = ::tolower((int) *__low); + *__low = ::tolower(static_cast (*__low)); ++__low; } return __high;