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

2002-08-01  Rick Danos  <rdanos@hotmail.com>

	PR libstdc++/7461
	* config/os/newlib/ctype_noninline.h (classic_table): Add offset.
	* config/os/newlib/ctype_inline.h (is): Use static_cast.

From-SVN: r55955
This commit is contained in:
Benjamin Kosnik 2002-08-01 22:17:23 +00:00
parent db2350e020
commit 3450b8d03c
3 changed files with 18 additions and 11 deletions

View File

@ -1,3 +1,14 @@
2002-08-01 Rick Danos <rdanos@hotmail.com>
PR libstdc++/7461
* config/os/newlib/ctype_noninline.h (classic_table): Add offset.
* config/os/newlib/ctype_inline.h (is): Use static_cast.
2002-08-01 Neil Booth <neil@daikokuya.co.uk>
* libsupc++/Makefile.am (LT_COMPILE): Remove C++ flags.
* libsupc++/Makefile.in: Regenerate.
2002-08-01 Benjamin Kosnik <bkoz@redhat.com> 2002-08-01 Benjamin Kosnik <bkoz@redhat.com>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*- // Locale support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
@ -37,14 +37,14 @@
bool bool
ctype<char>:: ctype<char>::
is(mask __m, char __c) const is(mask __m, char __c) const
{ return (_M_table + 1)[(unsigned char)(__c)] & __m; } { return (_M_table + 1)[static_cast<unsigned char>(__c)] & __m; }
const char* const char*
ctype<char>:: ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const is(const char* __low, const char* __high, mask* __vec) const
{ {
while (__low < __high) while (__low < __high)
*__vec++ = (_M_table + 1)[(unsigned char) (*__low++)]; *__vec++ = (_M_table + 1)[static_cast<unsigned char>(*__low++)];
return __high; return __high;
} }
@ -52,7 +52,8 @@
ctype<char>:: ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const scan_is(mask __m, const char* __low, const char* __high) const
{ {
while (__low < __high && !((_M_table + 1)[(unsigned char)(*__low)] & __m)) while (__low < __high
&& !((_M_table + 1)[static_cast<unsigned char>(*__low)] & __m))
++__low; ++__low;
return __low; return __low;
} }
@ -62,12 +63,7 @@
scan_not(mask __m, const char* __low, const char* __high) const scan_not(mask __m, const char* __low, const char* __high) const
{ {
while (__low < __high while (__low < __high
&& ((_M_table + 1)[(unsigned char)(*__low)] & __m) != 0) && ((_M_table + 1)[static_cast<unsigned char>(*__low)] & __m) != 0)
++__low; ++__low;
return __low; return __low;
} }

View File

@ -35,7 +35,7 @@
const ctype_base::mask* const ctype_base::mask*
ctype<char>::classic_table() throw() ctype<char>::classic_table() throw()
{ return _ctype_; } { return _ctype_ + 1; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)