Author: sebor Date: Fri Aug 8 15:41:56 2008 New Revision: 684133 URL: http://svn.apache.org/viewvc?rev=684133&view=rev Log: 2008-08-08 Martin Sebor <[EMAIL PROTECTED]>
STDCXX-998 * include/loc/_numpunct.h (~numpunct): Added attribute nothrow to help optimizers generate better code. * include/loc/_facet.h (~__rw_facet): Same. (__rw_facet, __rw_id::_C_init, __rw_release_facet_data): Declared with the empty exception specification. * include/loc/_ctype.h, src/ctype.cpp, src/wctype.cpp (ctype): Same. (~ctype, ~ctype_byname): Added attribute nothrow. * include/loc/_codecvt.h, src/codecvt.cpp, src/wcodecvt.cpp (codecvt): Declared constructors with the empty exception specification. * src/collate.cpp (__rw_get_cat): Same. * src/locale_body.h, src/locale_body.cpp (~__rw_locale, _C_is_managed, _C_LC2category, _C_LC2facet_bits, _C_check_category, _C_get_facet_type, _C_get_facet_inx, __rw_get_cat, __rw_is_C): Same. * src/facet.cpp (__rw_get_cat, __rw_get_cat_name, __rw_facet, cmpfacets, cmpfacet, __rw_release_facet_data, __rw_facet_id::_C_init): Same. (~__rw_facet): Added attribute nothrow. Modified: stdcxx/branches/4.2.x/include/loc/_codecvt.h stdcxx/branches/4.2.x/include/loc/_ctype.h stdcxx/branches/4.2.x/include/loc/_facet.h stdcxx/branches/4.2.x/include/loc/_numpunct.h stdcxx/branches/4.2.x/src/codecvt.cpp stdcxx/branches/4.2.x/src/collate.cpp stdcxx/branches/4.2.x/src/ctype.cpp stdcxx/branches/4.2.x/src/facet.cpp stdcxx/branches/4.2.x/src/locale_body.cpp stdcxx/branches/4.2.x/src/locale_body.h stdcxx/branches/4.2.x/src/wcodecvt.cpp stdcxx/branches/4.2.x/src/wctype.cpp Modified: stdcxx/branches/4.2.x/include/loc/_codecvt.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_codecvt.h?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/include/loc/_codecvt.h (original) +++ stdcxx/branches/4.2.x/include/loc/_codecvt.h Fri Aug 8 15:41:56 2008 @@ -188,7 +188,7 @@ typedef char intern_type; typedef _RWSTD_MBSTATE_T state_type; - _EXPLICIT codecvt (_RWSTD_SIZE_T = 0); + _EXPLICIT codecvt (_RWSTD_SIZE_T = 0) _THROWS (()); virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; @@ -332,7 +332,7 @@ public: - _EXPLICIT codecvt (_RWSTD_SIZE_T = 0); + _EXPLICIT codecvt (_RWSTD_SIZE_T = 0) _THROWS (()); virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; Modified: stdcxx/branches/4.2.x/include/loc/_ctype.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_ctype.h?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/include/loc/_ctype.h (original) +++ stdcxx/branches/4.2.x/include/loc/_ctype.h Fri Aug 8 15:41:56 2008 @@ -242,7 +242,8 @@ _RWSTD_STATIC_CONST (_RWSTD_SIZE_T, table_size = 256); - _EXPLICIT ctype (const mask* = 0, bool = false, _RWSTD_SIZE_T = 0); + _EXPLICIT + ctype (const mask* = 0, bool = false, _RWSTD_SIZE_T = 0) _THROWS (()); const char_type* is (const char_type*, const char_type*, mask*) const; @@ -292,7 +293,7 @@ static const mask* classic_table () _THROWS (()); - virtual ~ctype (); + virtual ~ctype () _RWSTD_ATTRIBUTE_NOTHROW; virtual const char_type* do_toupper (char_type*, const char_type*) const; @@ -421,7 +422,7 @@ typedef wchar_t char_type; - _EXPLICIT ctype (_RWSTD_SIZE_T = 0); + _EXPLICIT ctype (_RWSTD_SIZE_T = 0) _THROWS (()); // 22.2.1.1.1, p1 bool is (mask __m, char_type __c) const { @@ -484,7 +485,7 @@ protected: - virtual ~ctype (); + virtual ~ctype () _RWSTD_ATTRIBUTE_NOTHROW; // 22.2.1.1.2, p1 virtual bool do_is (mask, char_type) const; @@ -601,7 +602,7 @@ protected: - virtual ~ctype_byname (); + virtual ~ctype_byname () _RWSTD_ATTRIBUTE_NOTHROW; virtual bool do_is (mask, char_type) const; Modified: stdcxx/branches/4.2.x/include/loc/_facet.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_facet.h?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/include/loc/_facet.h (original) +++ stdcxx/branches/4.2.x/include/loc/_facet.h Fri Aug 8 15:41:56 2008 @@ -64,9 +64,9 @@ #endif // !MSVC || 5 <= stdcxx version - _EXPLICIT __rw_facet (_RWSTD_SIZE_T = 0); + _EXPLICIT __rw_facet (_RWSTD_SIZE_T = 0) _THROWS (()); - virtual ~__rw_facet (); + virtual ~__rw_facet () _RWSTD_ATTRIBUTE_NOTHROW; public: @@ -263,7 +263,7 @@ // initialize id to the given value if within the valid range // otherwise to the next value generated by the id generator - _RWSTD_SIZE_T _C_init () const; + _RWSTD_SIZE_T _C_init () const _THROWS (()); _MUTABLE _RWSTD_SIZE_T _C_id; // unique id > 0 @@ -278,7 +278,7 @@ __rw_get_facet_data (int, _RWSTD_SIZE_T&, const char*, const char* = 0); // its counterpart - does the database unmapping -void __rw_release_facet_data (const void*, _RWSTD_SIZE_T); +void __rw_release_facet_data (const void*, _RWSTD_SIZE_T) _THROWS (()); } // namespace __rw Modified: stdcxx/branches/4.2.x/include/loc/_numpunct.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_numpunct.h?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/include/loc/_numpunct.h (original) +++ stdcxx/branches/4.2.x/include/loc/_numpunct.h Fri Aug 8 15:41:56 2008 @@ -63,7 +63,7 @@ _EXPLICIT numpunct (_RWSTD_SIZE_T __ref = 0) : _RW::__rw_facet (__ref), _C_flags (0) { } - virtual ~numpunct (); + virtual ~numpunct () _RWSTD_ATTRIBUTE_NOTHROW; // 22.2.3.1.1, p1 char_type decimal_point () const; Modified: stdcxx/branches/4.2.x/src/codecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/codecvt.cpp?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/codecvt.cpp (original) +++ stdcxx/branches/4.2.x/src/codecvt.cpp Fri Aug 8 15:41:56 2008 @@ -98,7 +98,7 @@ codecvt<char, char, _RWSTD_MBSTATE_T>:: -codecvt (size_t refs /* = 0 */) +codecvt (size_t refs /* = 0 */) _THROWS (()) : _RW::__rw_facet (refs), _C_always_noconv (-1) { // empty @@ -108,7 +108,7 @@ // outlined to avoid generating a vtable in each translation unit // that uses the class /* virtual */ codecvt<char, char, _RWSTD_MBSTATE_T>:: -~codecvt () +~codecvt () // nothrow { // no-op } @@ -279,7 +279,7 @@ // outlined to avoid generating a vtable in each translation unit // that uses the class /* virtual */ codecvt_byname<char, char, _RWSTD_MBSTATE_T>:: -~codecvt_byname () +~codecvt_byname () // nothrow { // no-op } Modified: stdcxx/branches/4.2.x/src/collate.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/collate.cpp?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/collate.cpp (original) +++ stdcxx/branches/4.2.x/src/collate.cpp Fri Aug 8 15:41:56 2008 @@ -130,7 +130,7 @@ // computes LC_XXX category from a numeric facet id, returns the // LC_XXX category for standard facets, LC_ALL for all others -int __rw_get_cat (int); +int __rw_get_cat (int) _THROWS (()); #ifndef _RWSTD_NO_WCHAR_T Modified: stdcxx/branches/4.2.x/src/ctype.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/ctype.cpp?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/ctype.cpp (original) +++ stdcxx/branches/4.2.x/src/ctype.cpp Fri Aug 8 15:41:56 2008 @@ -657,7 +657,8 @@ _RW::__rw_facet_id ctype<char>::id; -ctype<char>::ctype (const mask *tab, bool del, _RWSTD_SIZE_T refs) +ctype<char>:: +ctype (const mask *tab, bool del, _RWSTD_SIZE_T refs) _THROWS (()) : _RW::__rw_facet (refs), _C_mask_tab (tab), _C_delete_it (del) @@ -677,7 +678,7 @@ } -ctype<char>::~ctype () +ctype<char>::~ctype () // nothrow { if (_C_delete_it) { delete[] _RWSTD_CONST_CAST (mask*, _C_mask_tab); Modified: stdcxx/branches/4.2.x/src/facet.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/facet.cpp?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/facet.cpp (original) +++ stdcxx/branches/4.2.x/src/facet.cpp Fri Aug 8 15:41:56 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 2001-2006 Rogue Wave Software. + * Copyright 2001-2006 Rogue Wave Software, Inc. * **************************************************************************/ @@ -53,11 +53,11 @@ // computes LC_XXX category from a numeric facet id, returns the // LC_XXX category for standard facets, LC_ALL for all others -int __rw_get_cat (int); +int __rw_get_cat (int) _THROWS (()); // retrieves the literal name for a given category value static inline -const char* __rw_get_cat_name (int category) +const char* __rw_get_cat_name (int category) _THROWS (()) { // FIXME: merge this struct and lookup with __rw_cats in rw_locale.cpp // maps LC_XXX category values to their names @@ -104,14 +104,14 @@ -__rw_facet::__rw_facet (_RWSTD_SIZE_T __ref /* = 0 */) +__rw_facet::__rw_facet (_RWSTD_SIZE_T __ref /* = 0 */) _THROWS (()) : _C_name (0), _C_buf (0), _C_impdata (0), _C_impsize (0), _C_type (_C_unknown), _C_ref (__ref), _C_pid (0 /* invalid */) { } -__rw_facet::~__rw_facet () +__rw_facet::~__rw_facet () // nothrow { _RWSTD_ASSERT (!_C_name && !_C_buf || _C_name && _C_buf); @@ -297,7 +297,7 @@ extern "C" { // compares two facets, returns 0 if equal, -1 if less, +1 otherwise -static int cmpfacets (const void *pv1, const void *pv2) +static int cmpfacets (const void *pv1, const void *pv2) _THROWS (()) { _RWSTD_ASSERT (0 != pv1); _RWSTD_ASSERT (0 != pv2); @@ -325,7 +325,7 @@ }; // compares a key to a facet, returns 0 if equal, -1 if less, +1 otherwise -static int cmpfacet (const void *pv1, const void *pv2) +static int cmpfacet (const void *pv1, const void *pv2) _THROWS (()) { _RWSTD_ASSERT (0 != pv1); _RWSTD_ASSERT (0 != pv2); @@ -582,7 +582,7 @@ } // Its counterpart - does the database unmapping -void __rw_release_facet_data (const void* pv, _RWSTD_SIZE_T sz) +void __rw_release_facet_data (const void* pv, _RWSTD_SIZE_T sz) _THROWS (()) { __rw_munmap (pv, sz); } @@ -596,7 +596,7 @@ static _RWSTD_SIZE_T __rw_id_gen = __rw_facet::_C_last_type + 1; -_RWSTD_SIZE_T __rw_facet_id::_C_init () const +_RWSTD_SIZE_T __rw_facet_id::_C_init () const _THROWS (()) { // return immediately if already initialized if (_C_id) Modified: stdcxx/branches/4.2.x/src/locale_body.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/locale_body.cpp?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/locale_body.cpp (original) +++ stdcxx/branches/4.2.x/src/locale_body.cpp Fri Aug 8 15:41:56 2008 @@ -492,7 +492,7 @@ size_t __rw_locale:: -_C_get_facet_inx (size_t id) const +_C_get_facet_inx (size_t id) const _THROWS (()) { // verify that facet's id is initialized _RWSTD_ASSERT (id); @@ -607,7 +607,7 @@ // convert a LC_XXX constant to a locale::category value /* static */ int __rw_locale:: -_C_LC2category (int cat) +_C_LC2category (int cat) _THROWS (()) { switch (cat) { case _RWSTD_LC_ALL: cat = __rw_cat_all; break; @@ -630,7 +630,7 @@ // convert a LC_XXX constant to an internal bitset of facets /* static */ int __rw_locale:: -_C_LC2facet_bits (int cat) +_C_LC2facet_bits (int cat) _THROWS (()) { int bits; @@ -671,7 +671,7 @@ __rw_locale:: -~__rw_locale () +~__rw_locale () _THROWS (()) { // verify that object isn't being destroyed prematurely _RWSTD_ASSERT (0 == _C_ref); @@ -741,7 +741,7 @@ // compares two locales, returns 0 if equal, -1 if less, +1 otherwise static int -cmplocales (const void *pv1, const void *pv2) +cmplocales (const void *pv1, const void *pv2) _THROWS (()) { _RWSTD_ASSERT (0 != pv1); _RWSTD_ASSERT (0 != pv2); @@ -760,7 +760,7 @@ // compares a key to a locale, returns 0 if equal, -1 if less, +1 otherwise static int -cmplocale (const void *pv1, const void *pv2) +cmplocale (const void *pv1, const void *pv2) _THROWS (()) { _RWSTD_ASSERT (0 != pv1); _RWSTD_ASSERT (0 != pv2); @@ -1053,7 +1053,7 @@ // if (cat == locale::none) holds, returns true iff the entire // locale body is being managed bool __rw_locale:: -_C_is_managed (int cat) const +_C_is_managed (int cat) const _THROWS (()) { // `cat' must be a valid category _RWSTD_ASSERT (_C_check_category (_C_LC2category (cat))); Modified: stdcxx/branches/4.2.x/src/locale_body.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/locale_body.h?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/locale_body.h (original) +++ stdcxx/branches/4.2.x/src/locale_body.h Fri Aug 8 15:41:56 2008 @@ -150,7 +150,7 @@ _C_construct (__l1, __l2, __cat); } - ~__rw_locale (); + ~__rw_locale () _THROWS (()); // returns the name of the locale const char* _C_get_name () const { @@ -180,7 +180,7 @@ // get a string of locale names, one for each installed standard // facet's category; will dynamically allocate string if buf is 0 - char* _C_get_cat_names (char*, _RWSTD_SIZE_T) const; + char* _C_get_cat_names (char*, _RWSTD_SIZE_T) const /* may throw */; // returns true iff all categories of facets (given by the bitmap) // in *this are being globally managed, i.e., iff all of *this facets @@ -188,19 +188,20 @@ // (when the category is locale::none, the function fails for all // locales that contain any user-defined facets; otherwise only // standard facets are considered) - bool _C_is_managed (int) const; + bool _C_is_managed (int) const _THROWS (()); // converts a LC_XXX constant to a locale::category value - static int _C_LC2category (int); + static int _C_LC2category (int) _THROWS (()); // converts a LC_XXX constant to an internal bitset of facets - static int _C_LC2facet_bits (int); + static int _C_LC2facet_bits (int) _THROWS (()); - static bool _C_check_category (int); + static bool _C_check_category (int) _THROWS (()); // returns the type of the standard facet object or `unknown' // if the facet is of a user-defined type - static __rw_facet::_C_facet_type _C_get_facet_type (const __rw_facet&); + static __rw_facet::_C_facet_type + _C_get_facet_type (const __rw_facet&) _THROWS (()); private: @@ -230,11 +231,13 @@ // -1 if the facet isn't installed // value < _C_n_std_facets for a standard facet // value >= _C_n_std_facets otherwise (i.e., for user defined facets) - _RWSTD_SIZE_T _C_get_facet_inx (_RWSTD_SIZE_T) const; + _RWSTD_SIZE_T _C_get_facet_inx (_RWSTD_SIZE_T) const _THROWS (()); }; -/* static */ inline bool __rw_locale::_C_check_category (int cat) +/* static */ inline bool +__rw_locale:: +_C_check_category (int cat) _THROWS (()) { // `cat' is assumed to be a C++ locale category (i.e., not an LC_XXX) _RWSTD_ASSERT (cat == _C_LC2category (cat)); @@ -244,7 +247,8 @@ /* static */ inline __rw_facet::_C_facet_type -__rw_locale::_C_get_facet_type (const __rw_facet &__facet) +__rw_locale:: +_C_get_facet_type (const __rw_facet &__facet) _THROWS (()) { _RWSTD_ASSERT (0 != __facet._C_pid); _RWSTD_ASSERT (0 != *__facet._C_pid); @@ -278,7 +282,7 @@ // computes LC_XXX category from a numeric facet id, returns the // LC_XXX category for standard facets, LC_ALL for all others -inline int __rw_get_cat (int id) +inline int __rw_get_cat (int id) _THROWS (()) { #if _RWSTD_LC_MIN >= 0 && _RWSTD_LC_MAX < _RWSTD_UCHAR_MAX typedef unsigned char LC_type; @@ -326,7 +330,7 @@ // returns true iff `name' is a name of the classic C locale -static inline bool __rw_is_C (const char *name) +static inline bool __rw_is_C (const char *name) _THROWS (()) { _RWSTD_ASSERT (0 != name); Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/wcodecvt.cpp?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/wcodecvt.cpp (original) +++ stdcxx/branches/4.2.x/src/wcodecvt.cpp Fri Aug 8 15:41:56 2008 @@ -1025,7 +1025,7 @@ /* explicit */ codecvt<wchar_t, char, _RWSTD_MBSTATE_T>:: -codecvt (size_t __ref /* = 0 */) +codecvt (size_t __ref /* = 0 */) _THROWS (()) : _RW::__rw_facet (__ref) { // no-op @@ -1035,7 +1035,7 @@ // outlined to avoid generating a vtable in each translation unit // that uses the class /* virtual */ codecvt<wchar_t, char, _RWSTD_MBSTATE_T>:: -~codecvt () +~codecvt () // nothrow { // no-op } @@ -1316,8 +1316,8 @@ // outlined to avoid generating a vtable in each translation unit // that uses the class -/* virtual */ codecvt_byname<wchar_t, char, _RWSTD_MBSTATE_T>::~ -codecvt_byname () +/* virtual */ codecvt_byname<wchar_t, char, _RWSTD_MBSTATE_T>:: +~codecvt_byname () // nothrow { // no-op } Modified: stdcxx/branches/4.2.x/src/wctype.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/wctype.cpp?rev=684133&r1=684132&r2=684133&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/wctype.cpp (original) +++ stdcxx/branches/4.2.x/src/wctype.cpp Fri Aug 8 15:41:56 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 2001-2005 Rogue Wave Software. + * Copyright 2001-2005 Rogue Wave Software, Inc. * **************************************************************************/ @@ -421,7 +421,7 @@ _RW::__rw_facet_id ctype<wchar_t>::id; -ctype<wchar_t>::ctype (_RWSTD_SIZE_T ref) +ctype<wchar_t>::ctype (_RWSTD_SIZE_T ref) _THROWS (()) : _RW::__rw_facet (ref) { #ifndef _RWSTD_NO_EQUAL_CTYPE_MASK