aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorpaolo <>2005-10-29 21:44:23 +0000
committerpaolo <>2005-10-29 21:44:23 +0000
commitbd1cb39962ee2014fd0bf11c9ee625c3e6c3990d (patch)
tree756ad7d68b78f262c6a4c6f4dd22bd40308f4dc0 /libstdc++-v3
parent740e23acf559ebe808fab2e94205e28435e89578 (diff)
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.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/config/os/djgpp/ctype_inline.h10
-rw-r--r--libstdc++-v3/config/os/djgpp/ctype_noninline.h16
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;