You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2009/05/26 21:33:41 UTC
svn commit: r778855 [1/2] - in /stdcxx/branches/4.3.x: ./ doc/stdlibug/
examples/tutorial/ include/ include/loc/ include/rw/ src/ src/x86/
src/x86_64/ tests/include/
Author: sebor
Date: Tue May 26 19:33:39 2009
New Revision: 778855
URL: http://svn.apache.org/viewvc?rev=778855&view=rev
Log:
2009-05-26 Martin Sebor <se...@apache.org>
Merged revs 684133, 684134, 684138, 686537, 693942, 714208, 723464,
731135, and 731378 from stdcxx-4.2.x.
2008-08-08 Martin Sebor <se...@apache.org>
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.
2008-08-08 Martin Sebor <se...@apache.org>
STDCXX-998
* include/loc/_num_put.h (~num_put): Added attribute nothrow
to help optimizers generate better code.
2008-08-08 Martin Sebor <se...@apache.org>
STDCXX-998
* include/rw/_file.h (__rw_fopen, __rw_fdopen, __rw_fclose,
__rw_fileno, __rw_fdmode, __rw_fmode, __rw_fread, __rw_fwrite,
__rw_fseek, __rw_fflush): Declared with attribute nothrow.
* include/ostream (__rw_fflush): Same.
* src/mman.h (__rw_mmap, __rw_munmap): Same.
* src/mman.cpp (__rw_mmap): Used malloc() instead of operator
new to avoid exceptions.
2008-08-16 Martin Sebor <se...@roguewave.com>
STDCXX-998
* include/rw/_allocator.h (__rw_deallocate): Added the empty
exception specification.
(allocator::destroy): Decorated with attribute nothrow to
help optimizers generate better code by letting them assume
that the type's dtor doesn't throw even if it's not explicitly
declared not to.
2008-12-04 Martin Sebor <se...@apache.org>
STDCXX-998
* include/streambuf (basic_streambuf): Added empty exception
specification to class ctor. The corresponding change to the
function definition was accidentally committed in rev 723461.
2009-01-04 Martin Sebor <se...@apache.org>
STDCXX-791
* tests/include/rw_char.h (~UserInt): Parenthesized an expression
to silence the annoying gcc 4.3 +Wparentheses warning.
2009-01-03 Martin Sebor <se...@roguewave.com>
STDCXX-791
* include/iomanip (__rw_setbase::operator()): Added parentheses
around operands of bitwise OR to silence gcc 4.3 -Wparentheses
warning.
* examples/tutorial/alg3.cpp (RandomInteger::operator()): Replaced
addition with bitwise OR to silence said gcc warning.
2008-11-14 Martin Sebor <se...@apache.org>
STDCXX-791
* include/loc/_localedef.h (__rw_utf8toucs4): Parenthesized
subexpression to silence gcc 4.3 -Wparentheses warning: suggest
parentheses around arithmetic in operand of |.
* include/rw/_iosbase.h (ios_base::setf): Same.
* src/num_get.cpp (__rw_check_grouping): Added an empty/dummy
body to a while loop to silence the braindead gcc 4.3 -Wempty-body
warning: uggest a space before ';' or explicit braces around empty
body in 'while' statement.
Parenthesized subexpressions to silence gcc 4.3.0 -Wparentheses
warnings.
* src/iostore.cpp (ios_base::_C_copyfmt): Silenced gcc 4.3
-Wparentheses warning.
* src/tmpbuf.cpp:
* src/string.cpp (__rw_memcpy, __rw_memmove, __rw_memcmp, __rw_strlen):
Silenced gcc 4.3 -Wparentheses warning.
(__rw_wmemcpy, __rw_wmemmove, __rw_wmemcmp, __rw_wcslen): Same.
* src/codecvt.cpp (codecvt::do_out, codecvt::do_in, codecvt::do_unshift,
codecvt::do_length): Same.
* src/ios.cpp (ios_base::flags): Same.
* src/wcodecvt.cpp (__rw_libc_do_out, codecvt::do_out, codecvt::do_in,
codecvt::do_unshift, codecvt::do_length, codecvt_byname::do_out,
codecvt_byname::do_in, codecvt_byname::do_unshift,
codecvt_byname::do_length): Same.
* src/time_put.cpp (__rw_get_era, __rw_get_zone_off, __rw_get_zone,
__rw_get_time_put_data): Same.
* src/wctype.cpp (__rw_get_mask): Same.
* src/facet.cpp (__rw_facet::~__rw_facet, __rw_facet::_C_get_data):
Same.
* src/locale_body.cpp (__rw_locale::_C_is_managed): Same.
* src/locale_eq.cpp (locale::operator==): Same.
* src/strstream.cpp (strstreambuf::setbuf): Same.
* src/locale_combine.cpp (__rw_locale::_C_construct): Same.
* src/num_put.cpp (__rw_itoa): Silenced gcc 4.3 -Wempty-body warning.
2008-09-10 Martin Sebor <se...@roguewave.com>
* src/ctype_bits.cpp: Globally replaced the _RWSTD_SIZE_T macro
(required to be used in library headers for namespace cleanliness)
with the standard size_t typedef.
* src/memory.cpp: Same.
* src/iostore.cpp: Same.
* src/bitset.cpp: Same.
* src/tmpbuf.cpp: Same.
* src/iso2022.cpp: Same.
* src/valarray.cpp: Same.
* src/random.cpp: Same.
* src/ctype.cpp: Same.
* src/codecvt.cpp: Same.
* src/locale_name.cpp: Same.
* src/time_put.cpp: Same.
* src/memattr.cpp: Same.
* src/wctype.cpp: Same.
* src/facet.cpp: Same.
* src/locale_eq.cpp: Same.
* src/strstream.cpp: Same.
* src/num_put.cpp: Same.
* src/mman.cpp: Same.
* src/locale_combine.cpp: Same.
Modified:
stdcxx/branches/4.3.x/ (props changed)
stdcxx/branches/4.3.x/doc/stdlibug/14-3.html (props changed)
stdcxx/branches/4.3.x/examples/tutorial/alg3.cpp
stdcxx/branches/4.3.x/include/iomanip
stdcxx/branches/4.3.x/include/loc/_codecvt.h
stdcxx/branches/4.3.x/include/loc/_ctype.h
stdcxx/branches/4.3.x/include/loc/_facet.h
stdcxx/branches/4.3.x/include/loc/_localedef.h
stdcxx/branches/4.3.x/include/loc/_num_put.h
stdcxx/branches/4.3.x/include/loc/_numpunct.h
stdcxx/branches/4.3.x/include/ostream
stdcxx/branches/4.3.x/include/rw/_allocator.h
stdcxx/branches/4.3.x/include/rw/_file.h
stdcxx/branches/4.3.x/include/rw/_iosbase.h
stdcxx/branches/4.3.x/include/streambuf
stdcxx/branches/4.3.x/include/streambuf.cc
stdcxx/branches/4.3.x/include/strstream
stdcxx/branches/4.3.x/src/ (props changed)
stdcxx/branches/4.3.x/src/atomic-cxx.S (props changed)
stdcxx/branches/4.3.x/src/bitset.cpp
stdcxx/branches/4.3.x/src/codecvt.cpp
stdcxx/branches/4.3.x/src/collate.cpp
stdcxx/branches/4.3.x/src/ctype.cpp
stdcxx/branches/4.3.x/src/ctype_bits.cpp
stdcxx/branches/4.3.x/src/facet.cpp
stdcxx/branches/4.3.x/src/ios.cpp
stdcxx/branches/4.3.x/src/iostore.cpp
stdcxx/branches/4.3.x/src/iso2022.cpp
stdcxx/branches/4.3.x/src/locale_body.cpp
stdcxx/branches/4.3.x/src/locale_body.h
stdcxx/branches/4.3.x/src/locale_combine.cpp
stdcxx/branches/4.3.x/src/locale_eq.cpp
stdcxx/branches/4.3.x/src/locale_name.cpp
stdcxx/branches/4.3.x/src/memattr.cpp
stdcxx/branches/4.3.x/src/memory.cpp
stdcxx/branches/4.3.x/src/mman.cpp
stdcxx/branches/4.3.x/src/mman.h
stdcxx/branches/4.3.x/src/num_get.cpp
stdcxx/branches/4.3.x/src/num_put.cpp
stdcxx/branches/4.3.x/src/random.cpp
stdcxx/branches/4.3.x/src/string.cpp
stdcxx/branches/4.3.x/src/strstream.cpp
stdcxx/branches/4.3.x/src/time_put.cpp
stdcxx/branches/4.3.x/src/tmpbuf.cpp
stdcxx/branches/4.3.x/src/valarray.cpp
stdcxx/branches/4.3.x/src/wcodecvt.cpp
stdcxx/branches/4.3.x/src/wctype.cpp
stdcxx/branches/4.3.x/src/x86/ (props changed)
stdcxx/branches/4.3.x/src/x86_64/ (props changed)
stdcxx/branches/4.3.x/tests/include/rw_char.h
Propchange: stdcxx/branches/4.3.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue May 26 19:33:39 2009
@@ -0,0 +1 @@
+/stdcxx/branches/4.2.x:684133-684134,684138,686537,693942,714208,723464,731135,731378
Propchange: stdcxx/branches/4.3.x/doc/stdlibug/14-3.html
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 26 19:33:39 2009
@@ -1 +1 @@
-/stdcxx/branches/4.2.x/doc/stdlibug/14-3.html:763018
+/stdcxx/branches/4.2.x/doc/stdlibug/14-3.html:684133-684134,684138,686537,693942,714208,723464,731135,731378,763018
Modified: stdcxx/branches/4.3.x/examples/tutorial/alg3.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/examples/tutorial/alg3.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/examples/tutorial/alg3.cpp (original)
+++ stdcxx/branches/4.3.x/examples/tutorial/alg3.cpp Tue May 26 19:33:39 2009
@@ -66,7 +66,7 @@
std::random_shuffle (seq, seq + sizeof seq / sizeof *seq);
const long rnd =
- (seq [0] << 11) | (seq [1] << 8) | (seq [2] << 4) + seq [3];
+ (seq [0] << 11) | (seq [1] << 8) | (seq [2] << 4) | seq [3];
return rnd % n;
}
Modified: stdcxx/branches/4.3.x/include/iomanip
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/iomanip?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/iomanip (original)
+++ stdcxx/branches/4.3.x/include/iomanip Tue May 26 19:33:39 2009
@@ -86,9 +86,9 @@
#endif // _RWSTD_NO_EXT_SETBASE
const unsigned __ifl =
- __strm.flags () & ~_STD::ios_base::basefield
- & ~( _RWSTD_STATIC_CAST (unsigned, _RWSTD_IOS_BASEMASK)
- << _RWSTD_IOS_BASEOFF)
+ ( __strm.flags () & ~_STD::ios_base::basefield
+ & ~( _RWSTD_STATIC_CAST (unsigned, _RWSTD_IOS_BASEMASK)
+ << _RWSTD_IOS_BASEOFF))
| __base << _RWSTD_IOS_BASEOFF;
__strm.flags (_STD::ios_base::fmtflags (__ifl));
Modified: stdcxx/branches/4.3.x/include/loc/_codecvt.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_codecvt.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/loc/_codecvt.h (original)
+++ stdcxx/branches/4.3.x/include/loc/_codecvt.h Tue May 26 19:33:39 2009
@@ -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.3.x/include/loc/_ctype.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_ctype.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/loc/_ctype.h (original)
+++ stdcxx/branches/4.3.x/include/loc/_ctype.h Tue May 26 19:33:39 2009
@@ -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.3.x/include/loc/_facet.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_facet.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/loc/_facet.h (original)
+++ stdcxx/branches/4.3.x/include/loc/_facet.h Tue May 26 19:33:39 2009
@@ -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.3.x/include/loc/_localedef.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_localedef.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/loc/_localedef.h (original)
+++ stdcxx/branches/4.3.x/include/loc/_localedef.h Tue May 26 19:33:39 2009
@@ -774,7 +774,7 @@
if (len < 2)
return from;
- *ret = _Int32 ((byte [0] & 0x1fU) << 6 | byte [1] & 0x3fU);
+ *ret = _Int32 ((byte [0] & 0x1fU) << 6 | (byte [1] & 0x3fU));
return from + 2;
}
Modified: stdcxx/branches/4.3.x/include/loc/_num_put.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_num_put.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/loc/_num_put.h (original)
+++ stdcxx/branches/4.3.x/include/loc/_num_put.h Tue May 26 19:33:39 2009
@@ -59,7 +59,7 @@
explicit num_put (_RWSTD_SIZE_T __refs = 0)
: _RW::__rw_facet (__refs) { }
- virtual ~num_put ();
+ virtual ~num_put () _RWSTD_ATTRIBUTE_NOTHROW;
#ifndef _RWSTD_NO_BOOL
Modified: stdcxx/branches/4.3.x/include/loc/_numpunct.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/loc/_numpunct.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/loc/_numpunct.h (original)
+++ stdcxx/branches/4.3.x/include/loc/_numpunct.h Tue May 26 19:33:39 2009
@@ -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.3.x/include/ostream
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/ostream?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/ostream (original)
+++ stdcxx/branches/4.3.x/include/ostream Tue May 26 19:33:39 2009
@@ -49,7 +49,7 @@
_RWSTD_NAMESPACE (__rw) {
-_RWSTD_EXPORT int __rw_fflush (void*, int);
+_RWSTD_EXPORT int __rw_fflush (void*, int) _RWSTD_ATTRIBUTE_NOTHROW;
} // namespace __rw
Modified: stdcxx/branches/4.3.x/include/rw/_allocator.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_allocator.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_allocator.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_allocator.h Tue May 26 19:33:39 2009
@@ -39,7 +39,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -54,8 +54,11 @@
_RWSTD_NAMESPACE (__rw) {
// [de]allocate storage (in bytes)
-_RWSTD_EXPORT void* __rw_allocate (_RWSTD_SIZE_T, int = 0);
-_RWSTD_EXPORT void __rw_deallocate (void*, _RWSTD_SIZE_T, int = 0);
+_RWSTD_EXPORT void*
+__rw_allocate (_RWSTD_SIZE_T, int = 0);
+
+_RWSTD_EXPORT void
+__rw_deallocate (void*, _RWSTD_SIZE_T, int = 0) _THROWS (());
} // namespace __rw
@@ -158,9 +161,9 @@
}
#ifdef _RWSTD_ALLOCATOR
- void deallocate (pointer __p, size_type __n)
+ void deallocate (pointer __p, size_type __n) _THROWS (())
#else
- void deallocate (void* __p, size_type __n)
+ void deallocate (void* __p, size_type __n) _THROWS (())
#endif // _RWSTD_ALLOCATOR
{
_RW::__rw_deallocate (__p, __n);
@@ -177,7 +180,10 @@
_RW::__rw_construct (__p, __val);
}
- void destroy (pointer __p) {
+ // declared as nothrow since the behavior of programs that
+ // instantiate library templates on types whose dtors throw
+ // is undefined
+ void destroy (pointer __p) _RWSTD_ATTRIBUTE_NOTHROW {
_RWSTD_ASSERT (0 != __p);
__p->~_TypeT ();
}
@@ -248,11 +254,11 @@
}
#ifdef _RWSTD_ALLOCATOR
- void deallocate (const_pointer __p, size_type __nelems) {
+ void deallocate (const_pointer __p, size_type __nelems) _THROWS (()) {
_RW::__rw_deallocate (_RWSTD_CONST_CAST (_TypeT*, __p), __nelems);
}
#else
- void deallocate (const void* __p, size_type __nbytes) {
+ void deallocate (const void* __p, size_type __nbytes) _THROWS (()) {
_RW::__rw_deallocate (_RWSTD_CONST_CAST (void*, __p), __nbytes);
}
#endif // _RWSTD_ALLOCATOR
@@ -267,8 +273,11 @@
void construct (const_pointer __p, const_reference __val) {
_RW::__rw_construct (_RWSTD_CONST_CAST (_TypeT*, __p), __val);
}
-
- void destroy (const_pointer __p) {
+
+ // declared as nothrow since the behavior of programs that
+ // instantiate library templates on types whose dtors throw
+ // is undefined
+ void destroy (const_pointer __p) _RWSTD_ATTRIBUTE_NOTHROW {
_RWSTD_ASSERT (0 != __p);
__p->~_TypeT ();
}
Modified: stdcxx/branches/4.3.x/include/rw/_file.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_file.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_file.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_file.h Tue May 26 19:33:39 2009
@@ -25,7 +25,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -39,21 +39,35 @@
_RWSTD_NAMESPACE (__rw) {
-_RWSTD_EXPORT void* __rw_fopen (const char*, int, long);
-_RWSTD_EXPORT void* __rw_fdopen (int);
-_RWSTD_EXPORT int __rw_fclose (void*, int);
-_RWSTD_EXPORT int __rw_fileno (void*, int);
-_RWSTD_EXPORT int __rw_fdmode (int);
-_RWSTD_EXPORT int __rw_fmode (void*, int);
+_RWSTD_EXPORT void*
+__rw_fopen (const char*, int, long) _RWSTD_ATTRIBUTE_NOTHROW;
+
+_RWSTD_EXPORT void*
+__rw_fdopen (int) _RWSTD_ATTRIBUTE_NOTHROW;
+
+_RWSTD_EXPORT int
+__rw_fclose (void*, int) _RWSTD_ATTRIBUTE_NOTHROW;
+
+_RWSTD_EXPORT int
+__rw_fileno (void*, int) _RWSTD_ATTRIBUTE_NOTHROW;
+
+_RWSTD_EXPORT int
+__rw_fdmode (int) _RWSTD_ATTRIBUTE_NOTHROW;
+
+_RWSTD_EXPORT int
+__rw_fmode (void*, int) _RWSTD_ATTRIBUTE_NOTHROW;
_RWSTD_EXPORT _RWSTD_SIZE_T
-__rw_fread (void*, int, void*, _RWSTD_SIZE_T);
+__rw_fread (void*, int, void*, _RWSTD_SIZE_T) _RWSTD_ATTRIBUTE_NOTHROW;
_RWSTD_EXPORT _RWSTD_PTRDIFF_T
-__rw_fwrite (void*, int, const void*, _RWSTD_SIZE_T);
+__rw_fwrite (void*, int, const void*, _RWSTD_SIZE_T) _RWSTD_ATTRIBUTE_NOTHROW;
+
+_RWSTD_EXPORT long
+__rw_fseek (void*, int, _RWSTD_PTRDIFF_T, int) _RWSTD_ATTRIBUTE_NOTHROW;
-_RWSTD_EXPORT long __rw_fseek (void*, int, _RWSTD_PTRDIFF_T, int);
-_RWSTD_EXPORT int __rw_fflush (void*, int);
+_RWSTD_EXPORT int
+__rw_fflush (void*, int) _RWSTD_ATTRIBUTE_NOTHROW;
} // namespace __rw
Modified: stdcxx/branches/4.3.x/include/rw/_iosbase.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_iosbase.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_iosbase.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_iosbase.h Tue May 26 19:33:39 2009
@@ -239,7 +239,7 @@
// 27.4.2.2, p6
fmtflags setf (fmtflags __f, fmtflags __mask) {
- return flags (flags () & ~__mask | __f & __mask);
+ return flags ((flags () & ~__mask) | (__f & __mask));
}
// 27.4.2.2, p8
Modified: stdcxx/branches/4.3.x/include/streambuf
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/streambuf?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/streambuf (original)
+++ stdcxx/branches/4.3.x/include/streambuf Tue May 26 19:33:39 2009
@@ -159,7 +159,8 @@
protected:
// 27.5.2.1, p1: default mode argument is a convenience extension
- basic_streambuf (ios_base::openmode = ios_base::in | ios_base::out);
+ basic_streambuf (ios_base::openmode = ios_base::in | ios_base::out)
+ _THROWS (());
// 27.5.2.3.1, p1
char_type* eback () const {
Modified: stdcxx/branches/4.3.x/include/streambuf.cc
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/streambuf.cc?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/streambuf.cc (original)
+++ stdcxx/branches/4.3.x/include/streambuf.cc Tue May 26 19:33:39 2009
@@ -34,6 +34,7 @@
template <class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits>::
basic_streambuf (ios_base::openmode __mode /* = ios_base::in | ios_base::out */)
+ _THROWS (())
: _C_buffer (0),
_C_bufsize (0),
_C_state (__mode),
Modified: stdcxx/branches/4.3.x/include/strstream
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/strstream?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/strstream (original)
+++ stdcxx/branches/4.3.x/include/strstream Tue May 26 19:33:39 2009
@@ -23,7 +23,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -51,7 +51,7 @@
typedef basic_streambuf<char, char_traits<char> > _Base;
void _C_init (streamsize, const void*, streamsize, const void*,
- void* (*)(_RWSTD_SIZE_T), void (*)(void*), int);
+ void* (*)(_RWSTD_SIZE_T), void (*)(void*), int) _THROWS (());
public:
// D.7.1.1, p1
Propchange: stdcxx/branches/4.3.x/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue May 26 19:33:39 2009
@@ -0,0 +1 @@
+/stdcxx/branches/4.2.x/src:684133-684134,684138,686537,693942,714208,723464,731135,731378,778780,778800,778803
Propchange: stdcxx/branches/4.3.x/src/atomic-cxx.S
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 26 19:33:39 2009
@@ -1 +1 @@
-/stdcxx/branches/4.2.x/src/atomic-cxx.S:746865
+/stdcxx/branches/4.2.x/src/atomic-cxx.S:684133-684134,684138,686537,693942,714208,723464,731135,731378,746865,778780,778800,778803
Modified: stdcxx/branches/4.3.x/src/bitset.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/bitset.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/bitset.cpp (original)
+++ stdcxx/branches/4.3.x/src/bitset.cpp Tue May 26 19:33:39 2009
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -39,17 +39,17 @@
_RWSTD_NAMESPACE (__rw) {
#if 2 == _RWSTD_LONG_SIZE
-static const int __rw_wbasebits = 1;
-static const _RWSTD_SIZE_T __rw_wbasemask = 15;
+static const int __rw_wbasebits = 1;
+static const size_t __rw_wbasemask = 15;
#elif 4 == _RWSTD_LONG_SIZE
-static const int __rw_wbasebits = 2;
-static const _RWSTD_SIZE_T __rw_wbasemask = 31;
+static const int __rw_wbasebits = 2;
+static const size_t __rw_wbasemask = 31;
#elif 8 == _RWSTD_LONG_SIZE
-static const int __rw_wbasebits = 3;
-static const _RWSTD_SIZE_T __rw_wbasemask = 63;
+static const int __rw_wbasebits = 3;
+static const size_t __rw_wbasemask = 63;
#else // assume 16 == sizeof (long)
-static const int __rw_wbasebits = 4;
-static const _RWSTD_SIZE_T __rw_wbasemask = 127;
+static const int __rw_wbasebits = 4;
+static const size_t __rw_wbasemask = 127;
#endif // _RWSTD_LONG_SIZE
// overloads of __rw_bitset() implement:
@@ -78,10 +78,10 @@
// -7- If M < N, remaining bit positions are initialized to zero.
_RWSTD_SPECIALIZED_FUNCTION _RWSTD_EXPORT void
-__rw_bitset (unsigned long *bits, _RWSTD_SIZE_T maxbits,
- const char *str, _RWSTD_SIZE_T slen,
+__rw_bitset (unsigned long *bits, size_t maxbits,
+ const char *str, size_t slen,
const _STD::char_traits<char>*, char b0, char b1,
- _RWSTD_SIZE_T pos, _RWSTD_SIZE_T n,
+ size_t pos, size_t n,
const char *file, const char *fun)
{
if (_RWSTD_SIZE_MAX == slen)
@@ -92,15 +92,15 @@
(_RWSTD_ERROR_OUT_OF_RANGE, file, fun, pos, slen));
// compute the number of characters in `str' past the offset `pos'
- const _RWSTD_SIZE_T nchars = n < (slen - pos) ? n : slen - pos;
+ const size_t nchars = n < (slen - pos) ? n : slen - pos;
// compute the number of bits to initialize from `str'
- const _RWSTD_SIZE_T nbits = nchars < maxbits ? nchars : maxbits;
+ const size_t nbits = nchars < maxbits ? nchars : maxbits;
str += pos;
// compute the number of non-zero bytes occupied by `bits'
- _RWSTD_SIZE_T nbytes = ((maxbits | 1) >> 3) + (0 != (maxbits & 7));
+ size_t nbytes = ((maxbits | 1) >> 3) + (0 != (maxbits & 7));
// round the number up to a multiple of sizeof(long)
nbytes = ( (nbytes >> __rw_wbasebits)
@@ -109,11 +109,11 @@
memset (bits, 0, nbytes);
// set all bits but also check any extra characters as required
- for (_RWSTD_SIZE_T i = 0; i != nchars; ++i) {
+ for (size_t i = 0; i != nchars; ++i) {
if (b1 == str [i]) {
if (i < nbits) {
- const _RWSTD_SIZE_T bitno = nbits - i - 1;
+ const size_t bitno = nbits - i - 1;
// efficiently compute the value of the expression below
// (i.e., without relying on slow division and modulo)
@@ -134,10 +134,10 @@
#ifndef _RWSTD_NO_WCHAR_T
_RWSTD_SPECIALIZED_FUNCTION _RWSTD_EXPORT void
-__rw_bitset (unsigned long *bits, _RWSTD_SIZE_T maxbits,
- const wchar_t *str, _RWSTD_SIZE_T slen,
+__rw_bitset (unsigned long *bits, size_t maxbits,
+ const wchar_t *str, size_t slen,
const _STD::char_traits<wchar_t>*, wchar_t b0, wchar_t b1,
- _RWSTD_SIZE_T pos, _RWSTD_SIZE_T n,
+ size_t pos, size_t n,
const char *file, const char *fun)
{
if (_RWSTD_SIZE_MAX == slen)
@@ -148,15 +148,15 @@
(_RWSTD_ERROR_OUT_OF_RANGE, file, fun, pos, slen));
// compute the number of characters in `str' past the offset `pos'
- const _RWSTD_SIZE_T nchars = n < (slen - pos) ? n : slen - pos;
+ const size_t nchars = n < (slen - pos) ? n : slen - pos;
// compute the number of bits to initialize from `str'
- const _RWSTD_SIZE_T nbits = nchars < maxbits ? nchars : maxbits;
+ const size_t nbits = nchars < maxbits ? nchars : maxbits;
str += pos;
// compute the number of non-zero bytes occupied by `bits'
- _RWSTD_SIZE_T nbytes = ((maxbits | 1) >> 3) + (0 != (maxbits & 7));
+ size_t nbytes = ((maxbits | 1) >> 3) + (0 != (maxbits & 7));
// round the number up to a multiple of sizeof(long)
nbytes = ( (nbytes >> __rw_wbasebits)
@@ -165,11 +165,11 @@
memset (bits, 0, nbytes);
// set all bits but also check any extra characters as required
- for (_RWSTD_SIZE_T i = 0; i != nchars; ++i) {
+ for (size_t i = 0; i != nchars; ++i) {
if (b1 == str [i]) {
if (i < nbits) {
- const _RWSTD_SIZE_T bitno = nbits - i - 1;
+ const size_t bitno = nbits - i - 1;
bits [bitno >> (3 + __rw_wbasebits)]
|= 1UL << (bitno & __rw_wbasemask);
}
@@ -209,13 +209,13 @@
// count the number of 1 bits in bitset `bits' of `size' elements
-_RWSTD_EXPORT _RWSTD_SIZE_T
+_RWSTD_EXPORT size_t
__rw_bit_count (const unsigned long *bits,
- _RWSTD_SIZE_T size) _THROWS (())
+ size_t size) _THROWS (())
{
_RWSTD_ASSERT (0 != bits);
- _RWSTD_SIZE_T sum = 0;
+ size_t sum = 0;
typedef unsigned char UChar;
@@ -231,10 +231,9 @@
// shift bitset `bits' of `size' elements left by `n' positions
_RWSTD_EXPORT void
-__rw_shl (unsigned long *bits,
- _RWSTD_SIZE_T size, _RWSTD_SIZE_T n) _THROWS (())
+__rw_shl (unsigned long *bits, size_t size, size_t n) _THROWS (())
{
- const _RWSTD_SIZE_T wordbits = sizeof *bits * _RWSTD_CHAR_BIT;
+ const size_t wordbits = sizeof *bits * _RWSTD_CHAR_BIT;
if (n >= size * wordbits) {
memset (bits, 0, size * sizeof *bits);
@@ -244,14 +243,14 @@
if (!n)
return;
- const _RWSTD_SIZE_T shlw = n / wordbits; // word shift left
- const _RWSTD_SIZE_T shlb = n % wordbits; // bit shift left
+ const size_t shlw = n / wordbits; // word shift left
+ const size_t shlb = n % wordbits; // bit shift left
if (shlb) {
- const _RWSTD_SIZE_T shrb = wordbits - shlb; // bit shift right
+ const size_t shrb = wordbits - shlb; // bit shift right
// shift one word at a time, spanning word boundaries
- for (_RWSTD_SIZE_T i = size - 1; i > shlw; --i)
+ for (size_t i = size - 1; i > shlw; --i)
bits [i] = bits [i - shlw] << shlb
| bits [i - shlw - 1] >> shrb;
@@ -270,10 +269,9 @@
// shift bitset `bits' of `size' elements right by `n' positions
_RWSTD_EXPORT void
-__rw_shr (unsigned long *bits,
- _RWSTD_SIZE_T size, _RWSTD_SIZE_T n) _THROWS (())
+__rw_shr (unsigned long *bits, size_t size, size_t n) _THROWS (())
{
- const _RWSTD_SIZE_T wordbits = sizeof *bits * _RWSTD_CHAR_BIT;
+ const size_t wordbits = sizeof *bits * _RWSTD_CHAR_BIT;
if (n >= size * wordbits) {
memset (bits, 0, size * sizeof *bits);
@@ -283,17 +281,17 @@
if (!n)
return;
- const _RWSTD_SIZE_T shrw = n / wordbits; // word shift right
- const _RWSTD_SIZE_T shrb = n % wordbits; // bit shift right
+ const size_t shrw = n / wordbits; // word shift right
+ const size_t shrb = n % wordbits; // bit shift right
// max word index
- const _RWSTD_SIZE_T maxw = size - shrw - 1;
+ const size_t maxw = size - shrw - 1;
if (shrb) {
- const _RWSTD_SIZE_T shlb = wordbits - shrb; // bit shift left
+ const size_t shlb = wordbits - shrb; // bit shift left
// shift one word at a time, spanning word boundaries
- for (_RWSTD_SIZE_T i = 0; i < maxw; ++i)
+ for (size_t i = 0; i < maxw; ++i)
bits [i] = bits [i + shrw] >> shrb
| bits [i + shrw + 1] << shlb;
Modified: stdcxx/branches/4.3.x/src/codecvt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/codecvt.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/codecvt.cpp (original)
+++ stdcxx/branches/4.3.x/src/codecvt.cpp Tue May 26 19:33:39 2009
@@ -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
}
@@ -127,8 +127,8 @@
// verify that both ranges are valid
_RWSTD_ASSERT (from <= from_end);
_RWSTD_ASSERT (to <= to_end);
- _RWSTD_ASSERT (from && from_end || !from && !from_end);
- _RWSTD_ASSERT (to && to_end || !to && !to_end);
+ _RWSTD_ASSERT ((from && from_end) || (!from && !from_end));
+ _RWSTD_ASSERT ((to && to_end) || (!to && !to_end));
// next pointers must always be set before returning, even on error
from_next = from;
@@ -152,10 +152,10 @@
if (always_noconv ())
return noconv;
- const _RWSTD_SIZE_T nfrom = from_end - from;
- const _RWSTD_SIZE_T nto = to_end - to;
+ const size_t nfrom = from_end - from;
+ const size_t nto = to_end - to;
- const _RWSTD_SIZE_T nconv = nfrom < nto ? nfrom : nto;
+ const size_t nconv = nfrom < nto ? nfrom : nto;
// use memmove() in case ranges overlap
memmove (to, from, nconv);
@@ -183,8 +183,8 @@
// verify that both ranges are valid
_RWSTD_ASSERT (from <= from_end);
_RWSTD_ASSERT (to <= to_end);
- _RWSTD_ASSERT (from && from_end || !from && !from_end);
- _RWSTD_ASSERT (to && to_end || !to && !to_end);
+ _RWSTD_ASSERT ((from && from_end) || (!from && !from_end));
+ _RWSTD_ASSERT ((to && to_end) || (!to && !to_end));
typedef codecvt<char, char, _RWSTD_MBSTATE_T> This;
@@ -204,7 +204,7 @@
{
// verify that the range is valid
_RWSTD_ASSERT (to <= to_end);
- _RWSTD_ASSERT (to && to_end || !to && !to_end);
+ _RWSTD_ASSERT ((to && to_end) || (!to && !to_end));
_RWSTD_UNUSED (to_end);
@@ -240,13 +240,13 @@
do_length (state_type &state,
const extern_type *from,
const extern_type *from_end,
- _RWSTD_SIZE_T imax) const
+ size_t imax) const
{
// 22.2.1.5.2, p9 - preconditions
_RWSTD_ASSERT (from <= from_end);
// verify that the range is valid
- _RWSTD_ASSERT (from && from_end || !from && !from_end);
+ _RWSTD_ASSERT ((from && from_end) || (!from && !from_end));
const int mbstate_valid = _RW::__rw_mbsinit (&state);
_RWSTD_ASSERT (mbstate_valid);
@@ -255,7 +255,7 @@
return 0;
// 22.2.1.5.2, p10
- const _RWSTD_SIZE_T len = from_end - from;
+ const size_t len = from_end - from;
return int (len < imax ? len : imax);
}
@@ -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.3.x/src/collate.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/collate.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/collate.cpp (original)
+++ stdcxx/branches/4.3.x/src/collate.cpp Tue May 26 19:33:39 2009
@@ -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.3.x/src/ctype.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/ctype.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/ctype.cpp (original)
+++ stdcxx/branches/4.3.x/src/ctype.cpp Tue May 26 19:33:39 2009
@@ -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.
*
**************************************************************************/
@@ -34,7 +34,7 @@
#include <limits.h>
#include <locale.h>
#include <wctype.h>
-#include <string.h> // for memset()
+#include <string.h> // for memset(), size_t
#include <loc/_ctype.h>
#include <loc/_locale.h>
@@ -618,7 +618,7 @@
_RWSTD_EXPORT __rw_facet::_C_ctor_t __rw_ct_ctype;
-_RWSTD_EXPORT __rw_facet* __rw_ct_ctype (_RWSTD_SIZE_T ref, const char *name)
+_RWSTD_EXPORT __rw_facet* __rw_ct_ctype (size_t ref, const char *name)
{
__rw_facet* pfacet;
@@ -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, 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);
@@ -849,7 +850,7 @@
}
-ctype_byname<char>::ctype_byname (const char *name, _RWSTD_SIZE_T refs)
+ctype_byname<char>::ctype_byname (const char *name, size_t refs)
: ctype<char>(0, false, refs)
{
_RWSTD_ASSERT (0 != name);
Modified: stdcxx/branches/4.3.x/src/ctype_bits.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/ctype_bits.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/ctype_bits.cpp (original)
+++ stdcxx/branches/4.3.x/src/ctype_bits.cpp Tue May 26 19:33:39 2009
@@ -22,16 +22,18 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
*
**************************************************************************/
#define _RWSTD_LIB_SRC
#include <rw/_defs.h>
-
#include <loc/_ctype.h>
+#include <stddef.h> // for size_t
+
+
_RWSTD_NAMESPACE (std) {
@@ -48,7 +50,7 @@
_RWSTD_DEFINE_STATIC_CONST (const ctype_base::mask ctype_base::alnum);
_RWSTD_DEFINE_STATIC_CONST (const ctype_base::mask ctype_base::graph);
-_RWSTD_DEFINE_STATIC_CONST (const _RWSTD_SIZE_T ctype<char>::table_size);
+_RWSTD_DEFINE_STATIC_CONST (const size_t ctype<char>::table_size);
} // namespace std
Modified: stdcxx/branches/4.3.x/src/facet.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/facet.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/facet.cpp (original)
+++ stdcxx/branches/4.3.x/src/facet.cpp Tue May 26 19:33:39 2009
@@ -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
@@ -77,7 +77,7 @@
};
// find facet's category name
- for (_RWSTD_SIZE_T i = 0; i != sizeof cats / sizeof *cats; ++i) {
+ for (size_t i = 0; i != sizeof cats / sizeof *cats; ++i) {
if (category == cats [i].cat)
return cats [i].name;
}
@@ -103,17 +103,16 @@
| 0;
-
-__rw_facet::__rw_facet (_RWSTD_SIZE_T __ref /* = 0 */)
+__rw_facet::__rw_facet (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);
+ _RWSTD_ASSERT ((!_C_name && !_C_buf) || (_C_name && _C_buf));
static const char destroyed[] = "*** destroyed facet ***";
@@ -135,14 +134,14 @@
// (derived facets may want to set `impdata' to their own,
// not necessarily memory mapped, data w/o setting `impsize'
// to something meaningful
- if ((_RWSTD_SIZE_T)(-1) == _C_impsize)
+ if (size_t (-1) == _C_impsize)
::operator delete (_RWSTD_CONST_CAST (void*, _C_impdata));
else if (_C_impdata && _C_impsize)
__rw_release_facet_data (_C_impdata, _C_impsize);
}
-void __rw_facet::_C_set_name (const char *name, char *buf, _RWSTD_SIZE_T size)
+void __rw_facet::_C_set_name (const char *name, char *buf, size_t size)
{
_RWSTD_ASSERT (0 != name);
_RWSTD_ASSERT (0 != buf || 0 == size);
@@ -151,7 +150,7 @@
_RWSTD_ASSERT (0 == _C_name);
_RWSTD_ASSERT (0 == _C_buf);
- _RWSTD_SIZE_T len = ::strlen (name) + 1;
+ size_t len = strlen (name) + 1;
char *tmp = len <= size ? buf : new char [len];
@@ -186,7 +185,7 @@
// implementation database mapping data
const void* pdata = 0;
- _RWSTD_SIZE_T sz = 0;
+ size_t sz = 0;
_RWSTD_ASSERT (0 != _C_pid);
const int cat = __rw_get_cat (int (*_C_pid));
@@ -218,8 +217,8 @@
pdata = __rw_get_facet_data (cat, sz, strip_name.data ());
}
else if ( pstr && pstr [4] == '-' && !pstr [6]
- && ( '4' == pstr [5] && sizeof (wchar_t) == 4
- || '2' == pstr [5] && sizeof (wchar_t) == 2)) {
+ && ( ('4' == pstr [5] && sizeof (wchar_t) == 4)
+ || ('2' == pstr [5] && sizeof (wchar_t) == 2))) {
// @UCS-4 is only recognized where sizeof (wchar_t) == 4
// @UCS-2 is only recognized where sizeof (wchar_t) == 2
@@ -245,11 +244,11 @@
// set `impsize' to non-zero value to avoid subsequent
// attempts at reinitialization
- _C_impsize = (_RWSTD_SIZE_T)-1;
+ _C_impsize = size_t (-1);
return 0;
}
- if (!is_wcodecvt_byname || pstr && pdata) {
+ if (!is_wcodecvt_byname || (pstr && pdata)) {
_C_impdata = pdata;
_C_impsize = sz;
return _C_impdata;
@@ -297,7 +296,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 +324,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);
@@ -358,8 +357,8 @@
// to hold (pointers to) all standard facets for 8 locales
static __rw_facet* std_facet_buf [__rw_facet::_C_last_type * 8];
static __rw_facet** std_facets = std_facet_buf;
- static _RWSTD_SIZE_T n_std_facets = 0;
- static _RWSTD_SIZE_T std_facet_bufsize =
+ static size_t n_std_facets = 0;
+ static size_t std_facet_bufsize =
sizeof std_facet_buf / sizeof *std_facet_buf;
// acquire lock
@@ -381,7 +380,7 @@
sizeof pfacet, &cmpfacets);
if (pf) {
- const _RWSTD_SIZE_T inx =
+ const size_t inx =
_RWSTD_STATIC_CAST (const __rw_facet* const*, pf)
- _RWSTD_CONST_CAST (const __rw_facet* const*, std_facets);
@@ -389,7 +388,7 @@
if (0 == __rw_locale::_C_remove_ref (*pfacet)) {
- static const _RWSTD_SIZE_T bufsize =
+ static const size_t bufsize =
sizeof std_facet_buf / sizeof *std_facet_buf;
--n_std_facets;
@@ -431,7 +430,7 @@
else {
// facet is an ordinary (unnamed) standard facet
- const _RWSTD_SIZE_T ref = __rw_locale::_C_remove_ref (*pfacet);
+ const size_t ref = __rw_locale::_C_remove_ref (*pfacet);
_RWSTD_ASSERT (ref + 1U != 0);
_RWSTD_UNUSED (ref);
}
@@ -485,7 +484,7 @@
// set the facet's numeric id
*__rw_access::_C_get_pid (*pfacet) =
- _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, (type + 1) / 2);
+ _RWSTD_STATIC_CAST (size_t, (type + 1) / 2);
if (__rw_access::_C_get_type (*pfacet) != type) {
// set the type of the facet if not already set
@@ -517,7 +516,7 @@
}
-const void* __rw_get_facet_data (int cat, _RWSTD_SIZE_T &impsize,
+const void* __rw_get_facet_data (int cat, size_t &impsize,
const char* name, const char* encoding)
{
if (__rw_facet::_C_use_libc == (__rw_facet::_C_opts &
@@ -582,7 +581,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, size_t sz) _THROWS (())
{
__rw_munmap (pv, sz);
}
@@ -593,10 +592,10 @@
// all others (i.e., id's of all user-defined facet types or
// specializations of standard facets on user-defined types)
// are in the range (__rw_facet::_C_last_type, ...)
-static _RWSTD_SIZE_T __rw_id_gen = __rw_facet::_C_last_type + 1;
+static size_t __rw_id_gen = __rw_facet::_C_last_type + 1;
-_RWSTD_SIZE_T __rw_facet_id::_C_init () const
+size_t __rw_facet_id::_C_init () const _THROWS (())
{
// return immediately if already initialized
if (_C_id)
@@ -607,8 +606,7 @@
// of standard facets has a chance of completing at the step above
// generate a unique id
- const _RWSTD_SIZE_T new_id =
- _RWSTD_ATOMIC_PREINCREMENT (__rw_id_gen, false);
+ const size_t new_id = _RWSTD_ATOMIC_PREINCREMENT (__rw_id_gen, false);
#ifndef _RWSTD_NO_MUTABLE
Modified: stdcxx/branches/4.3.x/src/ios.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/ios.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/ios.cpp (original)
+++ stdcxx/branches/4.3.x/src/ios.cpp Tue May 26 19:33:39 2009
@@ -104,19 +104,19 @@
// if basefield is set, clear the base mask and set
// the numeric base bits according to the basefield
case oct:
- ifl = ifl & mask | 8U << _RWSTD_IOS_BASEOFF;
+ ifl = (ifl & mask) | 8U << _RWSTD_IOS_BASEOFF;
break;
case dec:
- ifl = ifl & mask | 10U << _RWSTD_IOS_BASEOFF;
+ ifl = (ifl & mask) | 10U << _RWSTD_IOS_BASEOFF;
break;
case hex:
- ifl = ifl & mask | 16U << _RWSTD_IOS_BASEOFF;
+ ifl = (ifl & mask) | 16U << _RWSTD_IOS_BASEOFF;
break;
case _RWSTD_IOS_BIN:
- ifl = ifl & mask | 2U << _RWSTD_IOS_BASEOFF;
+ ifl = (ifl & mask) | 2U << _RWSTD_IOS_BASEOFF;
break;
case 0:
Modified: stdcxx/branches/4.3.x/src/iostore.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/iostore.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/iostore.cpp (original)
+++ stdcxx/branches/4.3.x/src/iostore.cpp Tue May 26 19:33:39 2009
@@ -42,19 +42,19 @@
// will grow an array of POD elements, never shrinks
static void*
-__rw_realloc (void *array, _RWSTD_SIZE_T size, _RWSTD_SIZE_T &n, int inx)
+__rw_realloc (void *array, size_t size, size_t &n, int inx)
{
if (inx < 0)
return 0; // bad index
- if (_RWSTD_STATIC_CAST (_RWSTD_SIZE_T, inx) < n)
+ if (_RWSTD_STATIC_CAST (size_t, inx) < n)
return array; // no need to reallocate
void *tmp;
_TRY {
// make sure index is dereferencable (cast prevents HP aCC warnings)
- tmp = operator new (_RWSTD_STATIC_CAST (_RWSTD_SIZE_T, ++inx) * size);
+ tmp = operator new (_RWSTD_STATIC_CAST (size_t, ++inx) * size);
}
_CATCH (...) {
return 0;
@@ -70,7 +70,7 @@
memset (_RWSTD_STATIC_CAST (char*, tmp) + n * size, 0, (inx - n) * size);
// modify passed-in size
- n = _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, inx);
+ n = _RWSTD_STATIC_CAST (size_t, inx);
operator delete (array);
@@ -158,7 +158,7 @@
return;
_C_usr_data::_C_event_cb *cba = _C_usr->_C_cbarray;
- _RWSTD_SIZE_T cbsize = _C_usr->_C_cbsize;
+ size_t cbsize = _C_usr->_C_cbsize;
// verify consistency (either both are 0 or neither is)
_RWSTD_ASSERT (!!cba == !!cbsize);
@@ -196,7 +196,7 @@
}
// 27.4.2.6, p1 - call callbacks in opposite order of registration
- for (_RWSTD_SIZE_T i = cbsize; i-- > 0; ) {
+ for (size_t i = cbsize; i-- > 0; ) {
_RWSTD_ASSERT (cba && cba [i]._C_fn);
@@ -231,8 +231,7 @@
// succeeds irrespective of rdstate()
void ios_base::
-_C_copyfmt (const ios_base &rhs,
- void *dst, const void *src, _RWSTD_SIZE_T size)
+_C_copyfmt (const ios_base &rhs, void *dst, const void *src, size_t size)
{
if (this == &rhs)
return;
@@ -244,7 +243,7 @@
void* *pa = 0;
EventCB *cba = 0;
- _RWSTD_SIZE_T a_size [3]; // sizes of arrays above
+ size_t a_size [3]; // sizes of arrays above
unsigned fmtfl; // formatting flags
streamsize prec; // new precision
@@ -390,7 +389,7 @@
}
// copy all but masked flags(), leave masked flags alone
- _C_fmtfl = fmtfl & flagmask | _C_fmtfl & ~flagmask;
+ _C_fmtfl = (fmtfl & flagmask) | (_C_fmtfl & ~flagmask);
_C_prec = prec;
_C_wide = wide;
_C_loc = loc;
@@ -440,7 +439,7 @@
if (ia) {
_RWSTD_ASSERT ( _C_usr->_C_isize
- > _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, inx));
+ > _RWSTD_STATIC_CAST (size_t, inx));
return (_C_usr->_C_iarray = ia)[inx];
}
@@ -470,7 +469,7 @@
if (pa) {
_RWSTD_ASSERT ( _C_usr->_C_psize
- > _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, inx));
+ > _RWSTD_STATIC_CAST (size_t, inx));
return (_C_usr->_C_parray = pa)[inx];
}
@@ -496,8 +495,8 @@
typedef _C_usr_data::_C_event_cb EventCB;
- _RWSTD_SIZE_T sz = 0;
- EventCB *cba = 0;
+ size_t sz = 0;
+ EventCB *cba = 0;
if (_C_usr) {
sz = _C_usr->_C_cbsize;
Modified: stdcxx/branches/4.3.x/src/iso2022.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/iso2022.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/iso2022.cpp (original)
+++ stdcxx/branches/4.3.x/src/iso2022.cpp Tue May 26 19:33:39 2009
@@ -30,7 +30,7 @@
#include <rw/_defs.h>
-#include <string.h> // for strxxx()
+#include <string.h> // for size_t, strxxx()
#include <iosfwd> // for mbstate_t
#include <loc/_codecvt.h>
@@ -166,9 +166,9 @@
// Database file mappings
struct __rw_db_map_t
{
- const void* pv; // pointer to mapping
- _RWSTD_SIZE_T size; // size of mapping
- const char* name; // canonical name
+ const void* pv; // pointer to mapping
+ size_t size; // size of mapping
+ const char* name; // canonical name
};
@@ -668,8 +668,8 @@
{
// length of a designating sequence in ISO-2022-JP and
// ISO-2022-JP-2 is 3 or 4 elements
- _RWSTD_SIZE_T len = sizeof (ISO_2022_JP_SET_ASCII) - 1U;
- _RWSTD_SIZE_T sslen = 0;
+ size_t len = sizeof (ISO_2022_JP_SET_ASCII) - 1U;
+ size_t sslen = 0;
// register designation
bool g2 = false;
@@ -735,7 +735,7 @@
// insert the designation
if (reg != state.g_map [2]) {
// FIXME - check correctness
- if (_RWSTD_STATIC_CAST (_RWSTD_SIZE_T, to_end - to) < len)
+ if (_RWSTD_STATIC_CAST (size_t, to_end - to) < len)
return CODECVT_PARTIAL;
if (len) {
@@ -751,7 +751,7 @@
// insert the single shift function
// FIXME - check correctness
- if (_RWSTD_STATIC_CAST (_RWSTD_SIZE_T, to_end - to) < len)
+ if (_RWSTD_STATIC_CAST (size_t, to_end - to) < len)
return CODECVT_PARTIAL;
if (sslen) {
@@ -766,7 +766,7 @@
} else {
// FIXME - check correctness
- if (_RWSTD_STATIC_CAST (_RWSTD_SIZE_T, to_end - to) < len)
+ if (_RWSTD_STATIC_CAST (size_t, to_end - to) < len)
return CODECVT_PARTIAL;
if (len) {
@@ -1493,7 +1493,7 @@
if (from == from_end || to == to_end)
return CODECVT_OK;
- _RWSTD_SIZE_T ret = __rw_itoutf8 (*from, ptmp);
+ size_t ret = __rw_itoutf8 (*from, ptmp);
unsigned int wc = tbl [UChar (*ptmp)];
while (wc & 0x80000000) {
@@ -1512,7 +1512,7 @@
}
// store the encoding sequence at destination
- _RWSTD_SIZE_T offset = wc + sizeof (_RW::__rw_codecvt_t);
+ size_t offset = wc + sizeof (_RW::__rw_codecvt_t);
while (impl_raw [offset]) {
if (to == to_end)
return CODECVT_PARTIAL;
@@ -1566,7 +1566,7 @@
const unsigned int* tbl = tbls;
_RWSTD_ASSERT(tbls);
- _RWSTD_SIZE_T ret = __rw_itoutf8 (*from, ptmp);
+ size_t ret = __rw_itoutf8 (*from, ptmp);
bool success = true;
unsigned int wc = tbl [UChar (*ptmp)];
@@ -1587,7 +1587,7 @@
continue;
// store the encoding sequence at destination
- _RWSTD_SIZE_T offset = wc + sizeof (_RW::__rw_codecvt_t);
+ size_t offset = wc + sizeof (_RW::__rw_codecvt_t);
while (impl_raw [offset])
*to++ = impl_raw [offset++];
@@ -1856,10 +1856,10 @@
}
-_RWSTD_SIZE_T
+size_t
__rw_iso2022jp_do_length (_RWSTD_MBSTATE_T& state,
const char* from, const char* from_end,
- _RWSTD_SIZE_T max)
+ size_t max)
{
_RWSTD_ASSERT(from <= from_end);
@@ -1901,7 +1901,7 @@
}
-_RWSTD_SIZE_T
+size_t
__rw_iso2022jp_do_max_length ()
{
return 2;
@@ -2076,10 +2076,10 @@
}
-_RWSTD_SIZE_T
+size_t
__rw_iso2022jp2_do_length (_RWSTD_MBSTATE_T& state,
const char* from, const char* from_end,
- _RWSTD_SIZE_T max)
+ size_t max)
{
_RWSTD_ASSERT(from <= from_end);
@@ -2144,7 +2144,7 @@
}
-_RWSTD_SIZE_T
+size_t
__rw_iso2022jp2_do_max_length ()
{
return 2;
Modified: stdcxx/branches/4.3.x/src/locale_body.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/locale_body.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/locale_body.cpp (original)
+++ stdcxx/branches/4.3.x/src/locale_body.cpp Tue May 26 19:33:39 2009
@@ -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)));
@@ -1072,18 +1072,18 @@
// detect categores of all byname facets not all of which
// belong to the same named locale)
if ( (_C_std_facet_bits & _C_all) != _C_all
- || (_C_byname_facet_bits & _C_collate)
- && (_C_byname_facet_bits & _C_collate) != _C_collate
- || (_C_byname_facet_bits & _C_ctype)
- && (_C_byname_facet_bits & _C_ctype) != _C_ctype
- || (_C_byname_facet_bits & _C_monetary)
- && (_C_byname_facet_bits & _C_monetary) != _C_monetary
- || (_C_byname_facet_bits & _C_numeric)
- && (_C_byname_facet_bits & _C_numeric) != _C_numeric
- || (_C_byname_facet_bits & _C_time)
- && (_C_byname_facet_bits & _C_time) != _C_time
- || (_C_byname_facet_bits & _C_messages)
- && (_C_byname_facet_bits & _C_messages) != _C_messages)
+ || ( (_C_byname_facet_bits & _C_collate)
+ && (_C_byname_facet_bits & _C_collate) != _C_collate)
+ || ( (_C_byname_facet_bits & _C_ctype)
+ && (_C_byname_facet_bits & _C_ctype) != _C_ctype)
+ || ( (_C_byname_facet_bits & _C_monetary)
+ && (_C_byname_facet_bits & _C_monetary) != _C_monetary)
+ || ( (_C_byname_facet_bits & _C_numeric)
+ && (_C_byname_facet_bits & _C_numeric) != _C_numeric)
+ || ( (_C_byname_facet_bits & _C_time)
+ && (_C_byname_facet_bits & _C_time) != _C_time)
+ || ( (_C_byname_facet_bits & _C_messages)
+ && (_C_byname_facet_bits & _C_messages) != _C_messages))
return false;
// check whether all _byname facets in each category belong
Modified: stdcxx/branches/4.3.x/src/locale_body.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/locale_body.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/locale_body.h (original)
+++ stdcxx/branches/4.3.x/src/locale_body.h Tue May 26 19:33:39 2009
@@ -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.3.x/src/locale_combine.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/locale_combine.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/locale_combine.cpp (original)
+++ stdcxx/branches/4.3.x/src/locale_combine.cpp Tue May 26 19:33:39 2009
@@ -64,7 +64,7 @@
// `cat' must be a locale::category (and not a LC_XXX value)
_RWSTD_ASSERT (__rw_locale::_C_check_category (cat));
- for (_RWSTD_SIZE_T i = 0; i != __rw_n_cats; ++i) {
+ for (size_t i = 0; i != __rw_n_cats; ++i) {
const char *nxt1 = strchr (name_1, *_RWSTD_CAT_SEP);
const char *nxt2 = strchr (name_2, *_RWSTD_CAT_SEP);
@@ -77,8 +77,8 @@
// convert a LC_XXX constant to a locale::category value
const int c = __rw_locale::_C_LC2category (__rw_cats [i].cat);
- const char *from; // copy from where
- _RWSTD_SIZE_T len; // this many chars
+ const char *from; // copy from where
+ size_t len; // this many chars
if (cat & c) { // category comes from `other'
from = name_2;
@@ -122,7 +122,7 @@
// and fixed in __rw_locale::__rw_locale, but related to the use of
// memcpy.
- for(_RWSTD_SIZE_T i = 0; i != _C_n_std_facets; i++)
+ for (size_t i = 0; i != _C_n_std_facets; i++)
_C_std_facets [i] = rhs._C_std_facets [i];
#endif // i86/gcc 3.x
@@ -130,8 +130,8 @@
_RWSTD_ASSERT (!pfacet || pfacet->_C_pid);
// get facet's index into one of the facet arrays
- _RWSTD_SIZE_T inx = pfacet
- ? rhs._C_get_facet_inx (*pfacet->_C_pid) : (_RWSTD_SIZE_T)(-1);
+ size_t inx = pfacet
+ ? rhs._C_get_facet_inx (*pfacet->_C_pid) : size_t (-1);
// extend size if facet isn't installed in `rhs'
_C_n_usr_facets = rhs._C_n_usr_facets
@@ -158,7 +158,7 @@
if (inx < _C_n_std_facets) {
_C_std_facets [inx] = pf;
- const _RWSTD_SIZE_T facet_bit = 1UL << inx;
+ const size_t facet_bit = 1UL << inx;
// set or clear a corresponding bit based on whether
// the facet is one of the standard facets or not
@@ -179,7 +179,7 @@
// _C_name =
// _C_make_name (_C_namebuf, sizeof _C_namebuf, rhs, *pfacet);
}
- else if ((_RWSTD_SIZE_T)(-1) == inx)
+ else if (size_t (-1) == inx)
_C_usr_facets [_C_n_usr_facets - 1] = pf;
else
_C_usr_facets [inx - _C_n_std_facets] = pf;
@@ -187,7 +187,7 @@
if (!_C_name) {
// simply copy name from `rhs'
- const _RWSTD_SIZE_T size = strlen (rhs._C_name) + 1;
+ const size_t size = strlen (rhs._C_name) + 1;
char* const name = size <= sizeof _C_namebuf
? _C_namebuf : new char [size];
@@ -235,13 +235,13 @@
// compute and assign facet bitmaps
const int bits = _C_LC2facet_bits (cat);
- _C_std_facet_bits = one._C_std_facet_bits & ~bits
- | other._C_std_facet_bits & bits;
+ _C_std_facet_bits = (one._C_std_facet_bits & ~bits)
+ | (other._C_std_facet_bits & bits);
- _C_byname_facet_bits = one._C_byname_facet_bits & ~bits
- | other._C_byname_facet_bits & bits;
+ _C_byname_facet_bits = (one._C_byname_facet_bits & ~bits)
+ | (other._C_byname_facet_bits & bits);
- for (_RWSTD_SIZE_T i = 0; i != _C_n_std_facets; ++i) {
+ for (size_t i = 0; i != _C_n_std_facets; ++i) {
// each facet is stored at an index equal to its (id - 1)
// convert an LC_XXX constant to a locale::category value
@@ -260,7 +260,7 @@
}
// increment the ref count of user-defined facets (if any)
- for (_RWSTD_SIZE_T j = 0; j != _C_n_usr_facets; ++j) {
+ for (size_t j = 0; j != _C_n_usr_facets; ++j) {
_RWSTD_ASSERT (_C_usr_facets [j]);
@@ -314,8 +314,7 @@
// compute the number of the bit in _C_std_facet_bits or
//_C_byname_facet_bits corresponding to the facet being
// used (i.e., `*pfacet')
- const _RWSTD_SIZE_T facet_bit =
- (_RWSTD_SIZE_T)1U << (*pfacet->_C_pid - 1U);
+ const size_t facet_bit = size_t (1U) << (*pfacet->_C_pid - 1U);
// a locale object is globally managed if all its facets are objects
// of standard facet types (ordinary or byname) that were constructed
@@ -345,8 +344,7 @@
const int cat_bits = _C_LC2facet_bits (facet_cat);
// get the index into the _C_std_facets array for `pfacet'
- const _RWSTD_SIZE_T facet_inx =
- _C_get_facet_inx (*pfacet->_C_pid);
+ const size_t facet_inx = _C_get_facet_inx (*pfacet->_C_pid);
managed = true;
@@ -356,7 +354,7 @@
// _byname facets that are not installed yet (i.e., whose
// pointers are 0 come from a locale whose name is given
// by the name of the whole locale
- for (_RWSTD_SIZE_T i = 0; i != _C_n_std_facets; ++i) {
+ for (size_t i = 0; i != _C_n_std_facets; ++i) {
// skip facets from other categories
if (!((1 << i) & cat_bits))
@@ -520,7 +518,7 @@
// a match; if found, remember its position (duplicates
// are not allowed)
- for (_RWSTD_SIZE_T i = 0; i != __rw_n_cats; ++i) {
+ for (size_t i = 0; i != __rw_n_cats; ++i) {
if (!strncmp (__rw_cats [i].name, s, endcat - s)) {
if (pcatnames [i])
return 0; // error: duplicate LC_XXX
@@ -534,8 +532,8 @@
}
// compose a normalized locale name out of category names
- _RWSTD_SIZE_T size = 0;
- for (_RWSTD_SIZE_T i = 0; i != __rw_n_cats; ++i) {
+ size_t size = 0;
+ for (size_t i = 0; i != __rw_n_cats; ++i) {
if (!pcatnames [i]) {
// use "C" for missing LC_XXX values
@@ -547,7 +545,7 @@
if (!endcat)
endcat = pcatnames [i] + strlen (pcatnames [i]);
- const _RWSTD_SIZE_T catsize = endcat - pcatnames [i];
+ const size_t catsize = endcat - pcatnames [i];
// append name followed by the libc "native" separator
realname.append (pcatnames [i], catsize);
@@ -707,8 +705,8 @@
_RWSTD_ASSERT (0 != _C_body);
// find the index at which the facet is stored in one of the facet arrays
- const _RWSTD_SIZE_T inx = _C_body->_C_get_facet_inx (fid._C_id);
- if ((_RWSTD_SIZE_T)(-1) == inx)
+ const size_t inx = _C_body->_C_get_facet_inx (fid._C_id);
+ if (size_t (-1) == inx)
return 0;
const locale::facet* const pfacet = inx < _RW::__rw_locale::_C_n_std_facets
Modified: stdcxx/branches/4.3.x/src/locale_eq.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/locale_eq.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/locale_eq.cpp (original)
+++ stdcxx/branches/4.3.x/src/locale_eq.cpp Tue May 26 19:33:39 2009
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -84,10 +84,10 @@
// share the exact same facets (otherwise the bits may or may not
// be the same)
_RWSTD_ASSERT ( !eql
- || _C_body->_C_std_facet_bits
- == rhs._C_body->_C_std_facet_bits
- && _C_body->_C_byname_facet_bits
- == rhs._C_body->_C_byname_facet_bits);
+ || ( _C_body->_C_std_facet_bits
+ == rhs._C_body->_C_std_facet_bits
+ && _C_body->_C_byname_facet_bits
+ == rhs._C_body->_C_byname_facet_bits));
// the names of both objects must be the same if the two objects
// share the exact same facets (otherwise the names may or may not
@@ -118,7 +118,7 @@
// locales with the same (non-0) number of user-defined
// facets compare equal iff all the facets are identical
- for (_RWSTD_SIZE_T i = 0; i != _C_body->_C_n_usr_facets; ++i) {
+ for (size_t i = 0; i != _C_body->_C_n_usr_facets; ++i) {
const _RW::__rw_facet* const pf = _C_body->_C_usr_facets [i];
Modified: stdcxx/branches/4.3.x/src/locale_name.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/locale_name.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/locale_name.cpp (original)
+++ stdcxx/branches/4.3.x/src/locale_name.cpp Tue May 26 19:33:39 2009
@@ -31,12 +31,14 @@
#include <rw/_defs.h>
#include <new>
-#include <string.h>
+#include <string.h> // for size_t, strchr(), strlen()
#include <loc/_facet.h>
#include <loc/_locale.h>
#include "locale_body.h"
+#include "setlocale.h" // for __rw_cats
+
#if 6 == _RWSTD_HP_aCC_MAJOR && _RWSTD_HP_aCC_MINOR <= 1600
// silence bogus HP aCC 6.16/cadvise warning #20200-D:
@@ -68,7 +70,7 @@
string result;
- _RWSTD_SIZE_T i = 0;
+ size_t i = 0;
for (const char *catnm = _C_body->_C_name; *catnm; ) {
Modified: stdcxx/branches/4.3.x/src/memattr.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/memattr.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/memattr.cpp (original)
+++ stdcxx/branches/4.3.x/src/memattr.cpp Tue May 26 19:33:39 2009
@@ -30,7 +30,7 @@
#define _RWSTD_LIB_SRC
#include <errno.h> // for ENOMEM, errno
-#include <string.h> // for memchr
+#include <string.h> // for memchr(), size_t
#ifndef EFAULT
# define EFAULT 14 // Linux value
@@ -97,7 +97,7 @@
_RWSTD_NAMESPACE (__rw) {
_RWSTD_EXPORT _RWSTD_SSIZE_T
-__rw_memattr (const void *addr, _RWSTD_SIZE_T nbytes, int attr)
+__rw_memattr (const void *addr, size_t nbytes, int attr)
{
// FIXME: allow attr to be set to the equivalent of PROT_READ,
// PROT_WRITE, and (perhaps also) PROT_EXEC, or any combination
@@ -109,19 +109,19 @@
const int errno_save = errno;
// determine the system page size in bytes
- static const _RWSTD_SIZE_T pgsz = size_t (GETPAGESIZE ());
+ static const size_t pgsz = size_t (GETPAGESIZE ());
// compute the address of the beginning of the page
// to which the address `addr' belongs
caddr_t const page =
_RWSTD_REINTERPRET_CAST (caddr_t,
- _RWSTD_REINTERPRET_CAST (_RWSTD_SIZE_T, addr) & ~(pgsz - 1));
+ _RWSTD_REINTERPRET_CAST (size_t, addr) & ~(pgsz - 1));
// compute the maximum number of pages occuppied by the memory
// region pointed to by `addr' (nbytes may be -1 as a request
// to compute, in a safe way, the length of the string pointed
// to by `addr')
- _RWSTD_SIZE_T npages = nbytes ? nbytes / pgsz + 1 : 0;
+ size_t npages = nbytes ? nbytes / pgsz + 1 : 0;
for (size_t i = 0; i < npages; ++i) {
@@ -216,7 +216,7 @@
// be safe since the first byte of the range has
// been determined to be readable
- const _RWSTD_SIZE_T maxpage =
+ const size_t maxpage =
next == page ? pgsz - DIST (addr, next) : pgsz;
const void* const pnul =
Modified: stdcxx/branches/4.3.x/src/memory.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/memory.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/memory.cpp (original)
+++ stdcxx/branches/4.3.x/src/memory.cpp Tue May 26 19:33:39 2009
@@ -23,7 +23,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -33,7 +33,7 @@
#include <rw/_mutex.h>
#include <new>
-#include <stdlib.h>
+#include <stdlib.h> // for free(), malloc(), size_t
#include <rw/_defs.h>
@@ -42,7 +42,7 @@
_RWSTD_EXPORT void*
-__rw_allocate (_RWSTD_SIZE_T nbytes, int /* = 0 */)
+__rw_allocate (size_t nbytes, int /* = 0 */)
{
void *ptr = 0;
@@ -57,7 +57,7 @@
// operator new() doesn't check for argument overflow,
// check before calling it and fail if `n' looks too big
- if (nbytes < (_RWSTD_SIZE_T)-1 - 256)
+ if (nbytes < size_t (-1) - 256)
ptr = ::operator new (nbytes);
#endif // _RWSTD_NO_NEW_OFLOW_SAFE
@@ -76,7 +76,7 @@
_RWSTD_EXPORT void
-__rw_deallocate (void *p, _RWSTD_SIZE_T, int /* = 0 */)
+__rw_deallocate (void *p, size_t, int /* = 0 */) _THROWS (())
{
::operator delete (p);
}
@@ -104,7 +104,7 @@
# ifdef _RWSTD_NO_OPERATOR_NEW_NOTHROW
_RWSTD_EXPORT void*
-operator new (_RWSTD_SIZE_T __size, const _STD::nothrow_t&) _NEW_THROWS (())
+operator new (size_t __size, const _STD::nothrow_t&) _NEW_THROWS (())
{
return malloc (__size);
}
@@ -126,7 +126,7 @@
# ifdef _RWSTD_NO_OPERATOR_NEW_ARRAY
_RWSTD_EXPORT void*
-operator new[] (_RWSTD_SIZE_T __size) _NEW_THROWS ((_RWSTD_BAD_ALLOC))
+operator new[] (size_t __size) _NEW_THROWS ((_RWSTD_BAD_ALLOC))
{
return ::operator new (__size);
}
@@ -136,7 +136,7 @@
# ifdef _RWSTD_NO_OPERATOR_NEW_ARRAY_NOTHROW
_RWSTD_EXPORT void*
-operator new[] (_RWSTD_SIZE_T __size, const _STD::nothrow_t&) _NEW_THROWS (())
+operator new[] (size_t __size, const _STD::nothrow_t&) _NEW_THROWS (())
{
_TRY {
return ::operator new (__size);
@@ -178,7 +178,7 @@
#ifdef _MSC_VER
-typedef int (*__rw_new_handler_t)(_RWSTD_SIZE_T);
+typedef int (*__rw_new_handler_t)(size_t);
_RWSTD_DLLIMPORT __rw_new_handler_t _set_new_handler (__rw_new_handler_t);
@@ -186,7 +186,7 @@
static _STD::new_handler __rw_new_handler /* = 0 */;
-static int __rw_new_handler_imp (_RWSTD_SIZE_T)
+static int __rw_new_handler_imp (size_t)
{
_RWSTD_ASSERT (0 != __rw_new_handler);
Modified: stdcxx/branches/4.3.x/src/mman.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/mman.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/mman.cpp (original)
+++ stdcxx/branches/4.3.x/src/mman.cpp Tue May 26 19:33:39 2009
@@ -45,6 +45,7 @@
#include <sys/types.h>
#include <fcntl.h>
+#include <stdlib.h> // for size_t
_RWSTD_NAMESPACE (__rw) {
@@ -53,7 +54,7 @@
// maps a named file into memory as shared, read-only, returns
// the beginning address on success and fills `size' with the
// size of the file; returns 0 on failure
-void* __rw_mmap (const char* fname, _RWSTD_SIZE_T *size)
+void* __rw_mmap (const char* fname, size_t *size) // nothrow
{
_RWSTD_ASSERT (0 != fname);
_RWSTD_ASSERT (0 != size);
@@ -130,12 +131,14 @@
// read() takes a size_t argument, convert off_t to it
const size_t mapsize = size_t (sb.st_size);
- void* data = operator new (mapsize);
- const ssize_t nread = read (fd, data, mapsize);
-
- if (size_t (nread) != mapsize) {
- operator delete (data);
- data = 0;
+ void* data = malloc (mapsize);
+ if (data) {
+ const ssize_t nread = read (fd, data, mapsize);
+
+ if (size_t (nread) != mapsize) {
+ free (data);
+ data = 0;
+ }
}
#endif // _MSC_VER
@@ -144,7 +147,7 @@
}
-void __rw_munmap (const void* pcv, _RWSTD_SIZE_T size)
+void __rw_munmap (const void* pcv, size_t size) // nothrow
{
_RWSTD_ASSERT (pcv && size);
Modified: stdcxx/branches/4.3.x/src/mman.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/mman.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/mman.h (original)
+++ stdcxx/branches/4.3.x/src/mman.h Tue May 26 19:33:39 2009
@@ -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.
*
**************************************************************************/
@@ -39,10 +39,10 @@
// maps a named file into memory as shared, read-only, returns
// the beginning address on success and fills 'size' with the
// size of the file; returns 0 on failure
-void* __rw_mmap (const char*, _RWSTD_SIZE_T*);
+void* __rw_mmap (const char*, _RWSTD_SIZE_T*) _RWSTD_ATTRIBUTE_NOTHROW;
// unmaps a memory region
-void __rw_munmap (const void*, _RWSTD_SIZE_T);
+void __rw_munmap (const void*, _RWSTD_SIZE_T) _RWSTD_ATTRIBUTE_NOTHROW;
} // namespace __rw
Modified: stdcxx/branches/4.3.x/src/num_get.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/num_get.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/num_get.cpp (original)
+++ stdcxx/branches/4.3.x/src/num_get.cpp Tue May 26 19:33:39 2009
@@ -147,7 +147,8 @@
_RWSTD_SIZE_T grpn = ngrpings;
// find the last non-zero grouping if it exists (see below)
- while (grpn-- != ngrpings && !grping [grpn]);
+ while (grpn-- != ngrpings && !grping [grpn])
+ /* silence gcc -Wempty-body warning */;
// the index of the last meaningful grouping (e.g., `grphi' of
// "\3\0\0\0" is 2 since the redundant NULs can be safely ignored)
@@ -545,7 +546,7 @@
_RWSTD_ASSERT (0 != end);
- if ('.' == *end || end == buf && '.' == buf [1]) {
+ if ('.' == *end || (end == buf && '.' == buf [1])) {
// on failure caused by an unrecognized decimal point
// set teporarily the global locale to "C" and reparse
__rw_setlocale loc ("C", _RWSTD_LC_NUMERIC);
@@ -649,7 +650,7 @@
_RWSTD_ASSERT (0 != end);
- if ('.' == *end || end == buf && '.' == buf [1]) {
+ if ('.' == *end || (end == buf && '.' == buf [1])) {
// on failure caused by an unrecognized decimal point
// set teporarily the global locale to "C" and reparse
__rw_setlocale loc ("C", _RWSTD_LC_NUMERIC);
@@ -728,7 +729,7 @@
_RWSTD_ASSERT (0 != end);
- if ('.' == *end || end == buf && '.' == buf [1]) {
+ if ('.' == *end || (end == buf && '.' == buf [1])) {
// on failure caused by an unrecognized decimal point
// set teporarily the global locale to "C" and reparse
__rw_setlocale loc ("C", _RWSTD_LC_NUMERIC);
@@ -794,9 +795,9 @@
// note that grouping is optional and parsing fails due to bad format
// only if the positions thousands_sep's do not match those specified
// by grouping; in such cases, the value is still stored
- if ( *grouping && ngroups > 1
- && 0 > __rw_check_grouping (groups, ngroups, grouping, ngroupings)
- || !*grouping && ngroups > 1)
+ if ( ( *grouping && ngroups > 1
+ && 0 > __rw_check_grouping (groups, ngroups, grouping, ngroupings))
+ || (!*grouping && ngroups > 1))
err |= _RWSTD_IOS_FAILBIT;
return err;