diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-29 22:44:23 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-29 22:44:23 +0000 |
commit | 1313b4d654a1695dc0572fe694bafde1a8a2ebd4 (patch) | |
tree | 756ad7d68b78f262c6a4c6f4dd22bd40308f4dc0 /libstdc++-v3 | |
parent | e0ab227c1288d86446a1e6712a95ca24ed104914 (diff) | |
download | gcc-1313b4d654a1695dc0572fe694bafde1a8a2ebd4.tar.gz |
2005-10-29 Carey Evans <carey.evans@gmail.com>
PR libstdc++/22087
* config/os/djgpp/ctype_inline.h: Fix.
* config/os/djgpp/ctype_noninline.h: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105999 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/config/os/djgpp/ctype_inline.h | 10 | ||||
-rw-r--r-- | libstdc++-v3/config/os/djgpp/ctype_noninline.h | 16 |
3 files changed, 20 insertions, 12 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ceea46da626..4aeee69f030 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2005-10-29 Carey Evans <carey.evans@gmail.com> + + PR libstdc++/22087 + * config/os/djgpp/ctype_inline.h: Fix. + * config/os/djgpp/ctype_noninline.h: Likewise. + 2005-10-28 Paolo Carlini <pcarlini@suse.de> PR libstdc++/24559 diff --git a/libstdc++-v3/config/os/djgpp/ctype_inline.h b/libstdc++-v3/config/os/djgpp/ctype_inline.h index 2758d015518..2383325518f 100644 --- a/libstdc++-v3/config/os/djgpp/ctype_inline.h +++ b/libstdc++-v3/config/os/djgpp/ctype_inline.h @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. // // 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 @@ -37,7 +37,7 @@ bool ctype<char>:: is(mask __m, char __c) const - { return _M_table[static_cast<unsigned char>(__c + 1)] & __m; } + { return _M_table[static_cast<unsigned char>(__c)] & __m; } const char* ctype<char>:: @@ -52,7 +52,8 @@ ctype<char>:: scan_is(mask __m, const char* __low, const char* __high) const { - while (__low < __high && !this->is(__m, *__low)) + while (__low < __high + && !(_M_table[static_cast<unsigned char>(*__low)] & __m)) ++__low; return __low; } @@ -61,7 +62,8 @@ ctype<char>:: scan_not(mask __m, const char* __low, const char* __high) const { - while (__low < __high && this->is(__m, *__low) != 0) + while (__low < __high + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0) ++__low; return __low; } diff --git a/libstdc++-v3/config/os/djgpp/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/ctype_noninline.h index bb05583e57b..0c905492c50 100644 --- a/libstdc++-v3/config/os/djgpp/ctype_noninline.h +++ b/libstdc++-v3/config/os/djgpp/ctype_noninline.h @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. // // 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 @@ -35,13 +35,13 @@ const ctype_base::mask* ctype<char>::classic_table() throw() - { return 0; } + { return __dj_ctype_flags+1; } ctype<char>::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) : facet(__refs), _M_del(__table != 0 && __del), _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), - _M_table(__table ? __table : __dj_ctype_flags) + _M_table(__table ? __table : classic_table()) { memset(_M_widen, 0, sizeof(_M_widen)); _M_widen_ok = 0; @@ -52,7 +52,7 @@ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : facet(__refs), _M_del(__table != 0 && __del), _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), - _M_table(__table ? __table : __dj_ctype_flags) + _M_table(__table ? __table : classic_table()) { memset(_M_widen, 0, sizeof(_M_widen)); _M_widen_ok = 0; @@ -62,14 +62,14 @@ char ctype<char>::do_toupper(char __c) const - { return _M_toupper[static_cast<int>(__c)+1]; } + { return _M_toupper[static_cast<unsigned char>(__c)]; } const char* ctype<char>::do_toupper(char* __low, const char* __high) const { while (__low < __high) { - *__low = ::toupper(static_cast<int> (*__low)); + *__low = _M_toupper[static_cast<unsigned char>(*__low)]; ++__low; } return __high; @@ -77,14 +77,14 @@ char ctype<char>::do_tolower(char __c) const - { return _M_tolower[static_cast<int>(__c)+1]; } + { return _M_tolower[static_cast<unsigned char>(__c)]; } const char* ctype<char>::do_tolower(char* __low, const char* __high) const { while (__low < __high) { - *__low = ::tolower(static_cast<int> (*__low)); + *__low = _M_tolower[static_cast<unsigned char>(*__low)]; ++__low; } return __high; |