This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/7461: ctype<char>::classic_table() returns offset array on Cygwin


The following fixes fallout from last patch to newlib/ctype_inline.h
and makes consistent with gnu-linux and other os definitions.

2002-08-02 Danny Smith <dannysmith@users,sourceforge.net>

	* config/os/newlib/ctype_inline.h (is): Don't offset _M_table.
	(scan_is): Use this->is.
	(scan_not): Likewise.

Index: ctype_inline.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/newlib/ctype_inline.h,v
retrieving revision 1.2
diff -u -p -r1.2 ctype_inline.h
--- ctype_inline.h	1 Aug 2002 22:17:23 -0000	1.2
+++ ctype_inline.h	2 Aug 2002 01:16:26 -0000
@@ -37,14 +37,14 @@
   bool
   ctype<char>::
   is(mask __m, char __c) const
-  { return (_M_table + 1)[static_cast<unsigned char>(__c)] & __m; }
+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
 
   const char*
   ctype<char>::
   is(const char* __low, const char* __high, mask* __vec) const
   {
     while (__low < __high)
-      *__vec++ = (_M_table + 1)[static_cast<unsigned char>(*__low++)];
+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
     return __high;
   }
 
@@ -52,8 +52,7 @@
   ctype<char>::
   scan_is(mask __m, const char* __low, const char* __high) const 
   {
-    while (__low < __high 
-	   && !((_M_table + 1)[static_cast<unsigned char>(*__low)] & __m))
+    while (__low < __high && !this->is(__m, *__low))
       ++__low;
     return __low;
   }
@@ -62,8 +61,7 @@
   ctype<char>::
   scan_not(mask __m, const char* __low, const char* __high) const
   {
-    while (__low < __high 
-	   && ((_M_table + 1)[static_cast<unsigned char>(*__low)] & __m) != 0)
+    while (__low < __high && this->is(__m, *__low) != 0)
       ++__low;
     return __low;
   }

http://digital.yahoo.com.au - Yahoo! Digital How To
- Get the best out of your PC!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]