summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/config/locale/gnu/ctype_members.cc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libstdc++/config/locale/gnu/ctype_members.cc')
-rw-r--r--contrib/libstdc++/config/locale/gnu/ctype_members.cc39
1 files changed, 31 insertions, 8 deletions
diff --git a/contrib/libstdc++/config/locale/gnu/ctype_members.cc b/contrib/libstdc++/config/locale/gnu/ctype_members.cc
index e0be949..ee4cc0a 100644
--- a/contrib/libstdc++/config/locale/gnu/ctype_members.cc
+++ b/contrib/libstdc++/config/locale/gnu/ctype_members.cc
@@ -1,6 +1,6 @@
// std::ctype implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 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
@@ -129,19 +129,42 @@ namespace std
bool
ctype<wchar_t>::
- do_is(mask __m, char_type __c) const
+ do_is(mask __m, wchar_t __c) const
{
- return static_cast<bool>(__iswctype_l(__c, _M_convert_to_wmask(__m),
- _M_c_locale_ctype));
+ // Highest bitmask in ctype_base == 10, but extra in "C"
+ // library for blank.
+ bool __ret = false;
+ const size_t __bitmasksize = 11;
+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+ {
+ const mask __bit = static_cast<mask>(_ISbit(__bitcur));
+ if (__m & __bit)
+ __ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit),
+ _M_c_locale_ctype);
+ }
+ return __ret;
}
const wchar_t*
ctype<wchar_t>::
- do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __m) const
+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
{
- while (__lo < __hi && !this->do_is(*__m, *__lo))
- ++__lo;
- return __lo;
+ for (;__lo < __hi; ++__vec, ++__lo)
+ {
+ // Highest bitmask in ctype_base == 10, but extra in "C"
+ // library for blank.
+ const size_t __bitmasksize = 11;
+ mask __m = 0;
+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+ {
+ const mask __bit = static_cast<mask>(_ISbit(__bitcur));
+ if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit),
+ _M_c_locale_ctype))
+ __m |= __bit;
+ }
+ *__vec = __m;
+ }
+ return __hi;
}
const wchar_t*
OpenPOWER on IntegriCloud