diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 64e2775c77c..1e77ef5c708 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2001-01-10 Loren J. Rittle + + * config/os/bsd/freebsd/bits/ctype_inline.h (is): (Make right + code path:) Remove magic constants and restructure to handle + ctype.h bit mask layout changes more gracefully. (Make fast + code path:) Use __maskrune (), if available. + (is): Remove special case for digit and xdigit masks. 2001-01-09 Robert Lipe diff --git a/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_inline.h b/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_inline.h index c282c4bf158..b4ba03f30f5 100644 --- a/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_inline.h @@ -38,28 +38,34 @@ ctype:: is(mask __m, char __c) const { - if (__m & (digit | xdigit)) - return __isctype(__c, __m); - else - return __istype(__c, __m); + return __istype(__c, __m); } const char* ctype:: is(const char* __low, const char* __high, mask* __vec) const { - const int __bitmasksize = 11; // Highest bitmask in ctype_base == 10 for (;__low < __high; ++__vec, ++__low) { +#if defined (_CTYPE_S) || defined (__istype) + *__vec = __maskrune (*__low, upper | lower | alpha | digit | xdigit + | space | print | graph | cntrl | punct | alnum); +#else mask __m = 0; - int __i = 0; // Lowest bitmask in ctype_base == 0 - for (;__i < __bitmasksize; ++__i) - { - mask __bit = static_cast(1 << __i); - if (this->is(__bit, *__low)) - __m |= __bit; - } + if (this->is(upper, *__low)) __m |= upper; + if (this->is(lower, *__low)) __m |= lower; + if (this->is(alpha, *__low)) __m |= alpha; + if (this->is(digit, *__low)) __m |= digit; + if (this->is(xdigit, *__low)) __m |= xdigit; + if (this->is(space, *__low)) __m |= space; + if (this->is(print, *__low)) __m |= print; + if (this->is(graph, *__low)) __m |= graph; + if (this->is(cntrl, *__low)) __m |= cntrl; + if (this->is(punct, *__low)) __m |= punct; + // Do not include explicit line for alnum mask since it is a + // pure composite of masks on FreeBSD. *__vec = __m; +#endif } return __high; }