diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-12 07:34:30 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-12 07:34:30 +0000 |
commit | 077dd222b5526406e83647c0b2f7bf045b7421b4 (patch) | |
tree | a094d6d2059ec27871b34a4bb53995ec54c60156 /libstdc++-v3 | |
parent | a42dfcc1e457f8287f45189915c559fbfb1b7449 (diff) | |
download | gcc-077dd222b5526406e83647c0b2f7bf045b7421b4.tar.gz |
2003-10-12 Andreas Tobler <a.tobler@schweiz.ch>
Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/11844/11740 (cont)
* config/os/generic/ctype_inline.h (ctype<char>::is):
Generically, use a bitmasksize of 15 (instead of 10);
Fix the logic to actually return (M & m) != 0 as per
22.2.1.1.2.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72389 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 9 | ||||
-rw-r--r-- | libstdc++-v3/config/os/generic/ctype_inline.h | 18 |
2 files changed, 17 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a274c241dc1..6f631d2dff7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2003-10-12 Andreas Tobler <a.tobler@schweiz.ch> + Paolo Carlini <pcarlini@unitus.it> + + PR libstdc++/11844/11740 (cont) + * config/os/generic/ctype_inline.h (ctype<char>::is): + Generically, use a bitmasksize of 15 (instead of 10); + Fix the logic to actually return (M & m) != 0 as per + 22.2.1.1.2. + 2003-10-11 Bernardo Innocenti <bernie@develer.com> * crossconfig.m4 (*-uclinux*): New target. diff --git a/libstdc++-v3/config/os/generic/ctype_inline.h b/libstdc++-v3/config/os/generic/ctype_inline.h index 0da0c7ccfb5..5f24fe69a79 100644 --- a/libstdc++-v3/config/os/generic/ctype_inline.h +++ b/libstdc++-v3/config/os/generic/ctype_inline.h @@ -49,16 +49,14 @@ return _M_table[static_cast<unsigned char>(__c)] & __m; else { - bool __ret = true; - bool __any_match = false; - const size_t __bitmasksize = 10; + bool __ret = false; + const size_t __bitmasksize = 15; size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 - for (;__ret && __bitcur <= __bitmasksize; ++__bitcur) + for (; __bitcur <= __bitmasksize; ++__bitcur) { - mask __bit = static_cast<mask>(1 << __bitcur); + const mask __bit = static_cast<mask>(1 << __bitcur); if (__m & __bit) { - __any_match = true; bool __testis; switch (__bit) { @@ -99,10 +97,10 @@ __testis = false; break; } - __ret &= __testis; + __ret |= __testis; } } - return __ret & __any_match; + return __ret; } } @@ -116,7 +114,7 @@ else { // Highest bitmask in ctype_base == 10. - const size_t __bitmasksize = 10; + const size_t __bitmasksize = 15; for (;__low < __high; ++__vec, ++__low) { mask __m = 0; @@ -124,7 +122,7 @@ size_t __i = 0; for (;__i <= __bitmasksize; ++__i) { - mask __bit = static_cast<mask>(1 << __i); + const mask __bit = static_cast<mask>(1 << __i); if (this->is(__bit, *__low)) __m |= __bit; } |