Commit c411fdae by Andreas Tobler Committed by Paolo Carlini

PR libstdc++/11844/11740 (cont)

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.

Co-Authored-By: Paolo Carlini <pcarlini@unitus.it>

From-SVN: r72389
parent 33dac2ab
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> 2003-10-11 Bernardo Innocenti <bernie@develer.com>
* crossconfig.m4 (*-uclinux*): New target. * crossconfig.m4 (*-uclinux*): New target.
......
...@@ -49,16 +49,14 @@ ...@@ -49,16 +49,14 @@
return _M_table[static_cast<unsigned char>(__c)] & __m; return _M_table[static_cast<unsigned char>(__c)] & __m;
else else
{ {
bool __ret = true; bool __ret = false;
bool __any_match = false; const size_t __bitmasksize = 15;
const size_t __bitmasksize = 10;
size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 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) if (__m & __bit)
{ {
__any_match = true;
bool __testis; bool __testis;
switch (__bit) switch (__bit)
{ {
...@@ -99,10 +97,10 @@ ...@@ -99,10 +97,10 @@
__testis = false; __testis = false;
break; break;
} }
__ret &= __testis; __ret |= __testis;
} }
} }
return __ret & __any_match; return __ret;
} }
} }
...@@ -116,7 +114,7 @@ ...@@ -116,7 +114,7 @@
else else
{ {
// Highest bitmask in ctype_base == 10. // Highest bitmask in ctype_base == 10.
const size_t __bitmasksize = 10; const size_t __bitmasksize = 15;
for (;__low < __high; ++__vec, ++__low) for (;__low < __high; ++__vec, ++__low)
{ {
mask __m = 0; mask __m = 0;
...@@ -124,7 +122,7 @@ ...@@ -124,7 +122,7 @@
size_t __i = 0; size_t __i = 0;
for (;__i <= __bitmasksize; ++__i) for (;__i <= __bitmasksize; ++__i)
{ {
mask __bit = static_cast<mask>(1 << __i); const mask __bit = static_cast<mask>(1 << __i);
if (this->is(__bit, *__low)) if (this->is(__bit, *__low))
__m |= __bit; __m |= __bit;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment