diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2f08f4f9897..46340e3d8f9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -2,7 +2,8 @@ * include/bits/locale_facets.h (ctype): Remove throw specs not in base class signature. - + * config/os/*/bits/ctype_inline.h (is): Same. + 2000-12-13 Benjamin Kosnik * config/os/generic/bits/ctype_base.h (ctype_base): Consistency diff --git a/libstdc++-v3/config/os/aix/bits/ctype_inline.h b/libstdc++-v3/config/os/aix/bits/ctype_inline.h index c376f356723..16e011c4a9a 100644 --- a/libstdc++-v3/config/os/aix/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/aix/bits/ctype_inline.h @@ -36,12 +36,12 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return __OBJ_DATA(__lc_ctype)->mask[__c] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -57,7 +57,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !this->is(__m, *__low)) ++__low; @@ -66,7 +66,7 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && this->is(__m, *__low) != 0) ++__low; 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 64566c27bf1..b51867dcac2 100644 --- a/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/bsd/freebsd/bits/ctype_inline.h @@ -36,7 +36,7 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { if (__m & (digit | xdigit)) return __isctype(__c, __m); @@ -46,7 +46,7 @@ const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -62,7 +62,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !this->is(__m, *__low)) ++__low; @@ -71,7 +71,7 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && this->is(__m, *__low) != 0) ++__low; diff --git a/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_inline.h b/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_inline.h index 23a6d19bbb2..2d72d9896cf 100644 --- a/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/bsd/netbsd/bits/ctype_inline.h @@ -36,12 +36,12 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return _M_table[(unsigned char)(__c)] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -57,7 +57,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !this->is(__m, *__low)) ++__low; @@ -66,7 +66,7 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && this->is(__m, *__low) != 0) ++__low; @@ -77,3 +77,4 @@ + diff --git a/libstdc++-v3/config/os/generic/bits/ctype_inline.h b/libstdc++-v3/config/os/generic/bits/ctype_inline.h index 74429a2a059..98c7e3d0309 100644 --- a/libstdc++-v3/config/os/generic/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/generic/bits/ctype_inline.h @@ -41,7 +41,7 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { bool __ret; switch (__m) @@ -88,7 +88,7 @@ const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + 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) @@ -104,7 +104,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !this->is(__m, *__low)) ++__low; @@ -113,7 +113,7 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && this->is(__m, *__low) != 0) ++__low; diff --git a/libstdc++-v3/config/os/gnu-linux/bits/ctype_inline.h b/libstdc++-v3/config/os/gnu-linux/bits/ctype_inline.h index 9fe7b16f7b6..83563a9ade7 100644 --- a/libstdc++-v3/config/os/gnu-linux/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/gnu-linux/bits/ctype_inline.h @@ -36,12 +36,12 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return _M_table[__c] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -57,7 +57,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !(_M_table[*__low] & __m)) ++__low; @@ -66,7 +66,7 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && (_M_table[*__low] & __m) != 0) diff --git a/libstdc++-v3/config/os/hpux/bits/ctype_base.h b/libstdc++-v3/config/os/hpux/bits/ctype_base.h index 8b5e0a07252..d11e1e51851 100644 --- a/libstdc++-v3/config/os/hpux/bits/ctype_base.h +++ b/libstdc++-v3/config/os/hpux/bits/ctype_base.h @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 1997-1999 Free Software Foundation, Inc. +// Copyright (C) 1997-1999, 2000 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 @@ -35,25 +35,21 @@ struct ctype_base { - typedef unsigned int mask; // Non-standard typedefs. typedef const int* __to_type; - enum - { - space = (1 << 5), // Whitespace - print = (1 << 6), // Printing - cntrl = (1 << 9), // Control character - upper = (1 << 0), // UPPERCASE - lower = (1 << 1), // lowercase - alpha = (1 << 5), // Alphabetic - digit = (1 << 2), // Numeric - punct = (1 << 10),// Punctuation - xdigit = (1 << 4),// Hexadecimal numeric - alnum = (1 << 11),// Alphanumeric - graph = (1 << 7) // Graphical - }; + // NB: Offsets into ctype::_M_table force a particular size + // on the mask type. Because of this, we don't use an enum. + typedef unsigned int mask; + static const mask upper = 1 << 0; + static const mask lower = 1 << 1; + static const mask alpha = 1 << 2; + static const mask digit = 1 << 3; + static const mask xdigit = 1 << 4; + static const mask space = 1 << 5; + static const mask print = 1 << 6; + static const mask graph = 1 << 7; + static const mask cntrl = 1 << 8; + static const mask punct = 1 << 9; + static const mask alnum = 1 << 10; }; - - - diff --git a/libstdc++-v3/config/os/hpux/bits/ctype_inline.h b/libstdc++-v3/config/os/hpux/bits/ctype_inline.h index 952b0da8c98..35cc3063d4c 100644 --- a/libstdc++-v3/config/os/hpux/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/hpux/bits/ctype_inline.h @@ -36,21 +36,28 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return _M_table[(unsigned char)(__c)] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { - while (__low < __high) - *__vec++ = _M_table[(unsigned char)(*__low++)]; + const int __bitmasksize = 11; // Highest bitmask in ctype_base == 10 + for (;__low < __high; ++__vec, ++__low) + { + mask __m = _M_table[*__low]; + int __i = 0; // Lowest bitmask in ctype_base == 0 + while (__i < __bitmasksize && !(__m & static_cast(1 << __i))) + ++__i; + *__vec = static_cast(1 << __i); + } return __high; } const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !this->is(__m, *__low)) ++__low; @@ -59,7 +66,7 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && this->is(__m, *__low) != 0) ++__low; diff --git a/libstdc++-v3/config/os/irix/bits/ctype_inline.h b/libstdc++-v3/config/os/irix/bits/ctype_inline.h index 4a76dc5c6bd..1b400f24183 100644 --- a/libstdc++-v3/config/os/irix/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/irix/bits/ctype_inline.h @@ -36,12 +36,12 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return (_M_table)[__c] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -57,7 +57,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !((_M_table)[*__low] & __m)) ++__low; @@ -66,7 +66,7 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && ((_M_table + 1)[*__low] & __m) != 0) ++__low; diff --git a/libstdc++-v3/config/os/newlib/bits/ctype_inline.h b/libstdc++-v3/config/os/newlib/bits/ctype_inline.h index b2dd42b2854..61c4bc85898 100644 --- a/libstdc++-v3/config/os/newlib/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/newlib/bits/ctype_inline.h @@ -36,12 +36,12 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return (_M_table + 1)[(unsigned char)(__c)] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -57,7 +57,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !((_M_table + 1)[(unsigned char)(*__low)] & __m)) ++__low; @@ -66,7 +66,7 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && ((_M_table + 1)[(unsigned char)(*__low)] & __m) != 0) diff --git a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_inline.h b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_inline.h index d6259a44eac..f6719935af0 100644 --- a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_inline.h @@ -36,12 +36,12 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return (_M_table + 1)[(unsigned char)(__c)] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -57,7 +57,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !((_M_table + 1)[(unsigned char)(*__low)] & __m)) ++__low; @@ -66,15 +66,10 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && ((_M_table + 1)[(unsigned char)(*__low)] & __m) != 0) ++__low; return __low; } - - - - - diff --git a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_inline.h b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_inline.h index 2ea6f69b97f..f254e839fb8 100644 --- a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_inline.h @@ -36,12 +36,12 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return _M_table[__c] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -57,7 +57,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !(_M_table[*__low] & __m)) ++__low; @@ -66,15 +66,10 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && (_M_table[*__low] & __m) != 0) ++__low; return __low; } - - - - - diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_inline.h b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_inline.h index 2ea6f69b97f..f254e839fb8 100644 --- a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_inline.h +++ b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_inline.h @@ -36,12 +36,12 @@ bool ctype:: - is(mask __m, char __c) const throw() + is(mask __m, char __c) const { return _M_table[__c] & __m; } const char* ctype:: - is(const char* __low, const char* __high, mask* __vec) const throw() + is(const char* __low, const char* __high, mask* __vec) const { const int __bitmasksize = sizeof(mask) * 8; for (;__low < __high; ++__vec, ++__low) @@ -57,7 +57,7 @@ const char* ctype:: - scan_is(mask __m, const char* __low, const char* __high) const throw() + scan_is(mask __m, const char* __low, const char* __high) const { while (__low < __high && !(_M_table[*__low] & __m)) ++__low; @@ -66,15 +66,10 @@ const char* ctype:: - scan_not(mask __m, const char* __low, const char* __high) const throw() + scan_not(mask __m, const char* __low, const char* __high) const { while (__low < __high && (_M_table[*__low] & __m) != 0) ++__low; return __low; } - - - - -