ctype_base.h (ctype_base): fix __to_type definition.
authorLaurynas Biveinis <lauras@softhome.net>
Mon, 5 Mar 2001 04:44:16 +0000 (04:44 +0000)
committerLaurynas Biveinis <lauras@gcc.gnu.org>
Mon, 5 Mar 2001 04:44:16 +0000 (04:44 +0000)
        * 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

libstdc++-v3/ChangeLog
libstdc++-v3/config/os/djgpp/bits/ctype_base.h
libstdc++-v3/config/os/djgpp/bits/ctype_inline.h
libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h

index dd9ef01469730589229eb01bde44173439f370b3..05aef915a81939ca4f46552ca9f2bbc7f4cdb3be 100644 (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
index b64f4705d23d24cd250c007d0dc95131beddceaf..018e20e4a4ab805d56a5087c23927f6cf0c706e7 100644 (file)
     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
   };
 
 
index e17fe6d29ab3c2a8d076d145c77d981f4241580d..21958c43641c3f8ef132a548cc656db8c0e0f2a8 100644 (file)
   
   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;
index bbcab083722bd5a330fbf4d9889ccace786935b4..efc7958fe01358d1b360520dd963db6ae8f6e0df 100644 (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;