summaryrefslogtreecommitdiff
path: root/libstdc++-v3/config/os/generic
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-25 16:37:24 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-25 16:37:24 +0000
commit5ce410875ea583fc4d5a6a582060a1b55175ddd3 (patch)
tree2fac0f31f5522326e93dba0228ecf56f4a5cf306 /libstdc++-v3/config/os/generic
parentd66e4477a4ef806d7e24ce7b9a94c1ad0557080b (diff)
downloadgcc-5ce410875ea583fc4d5a6a582060a1b55175ddd3.tar.gz
2003-09-25 Benjamin Kosnik <bkoz@redhat.com>
* config/locale/gnu/ctype_members.cc (ctype<wchar_t>::do_is): Fix. * config/locale/generic/ctype_members.cc: Same. * testsuite/22_locale/ctype/is/char/1.cc: Initialize mask. * testsuite/22_locale/ctype/is/wchar_t/1.cc: Same. * config/os/generic/ctype_inline.h: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71780 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/config/os/generic')
-rw-r--r--libstdc++-v3/config/os/generic/ctype_inline.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/libstdc++-v3/config/os/generic/ctype_inline.h b/libstdc++-v3/config/os/generic/ctype_inline.h
index be43c47fd0a..0da0c7ccfb5 100644
--- a/libstdc++-v3/config/os/generic/ctype_inline.h
+++ b/libstdc++-v3/config/os/generic/ctype_inline.h
@@ -50,13 +50,15 @@
else
{
bool __ret = true;
- const int __bitmasksize = 11;
- int __bitcur = 0; // Lowest bitmask in ctype_base == 0
- for (;__ret && __bitcur < __bitmasksize; ++__bitcur)
+ bool __any_match = false;
+ const size_t __bitmasksize = 10;
+ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0
+ for (;__ret && __bitcur <= __bitmasksize; ++__bitcur)
{
mask __bit = static_cast<mask>(1 << __bitcur);
if (__m & __bit)
{
+ __any_match = true;
bool __testis;
switch (__bit)
{
@@ -100,7 +102,7 @@
__ret &= __testis;
}
}
- return __ret;
+ return __ret & __any_match;
}
}
@@ -114,13 +116,13 @@
else
{
// Highest bitmask in ctype_base == 10.
- const int __bitmasksize = 11;
+ const size_t __bitmasksize = 10;
for (;__low < __high; ++__vec, ++__low)
{
mask __m = 0;
// Lowest bitmask in ctype_base == 0
- int __i = 0;
- for (;__i < __bitmasksize; ++__i)
+ size_t __i = 0;
+ for (;__i <= __bitmasksize; ++__i)
{
mask __bit = static_cast<mask>(1 << __i);
if (this->is(__bit, *__low))