svn commit: r1158420 - /stdcxx/site/status/2011-08.txt
Author: sebor Date: Tue Aug 16 18:48:45 2011 New Revision: 1158420 URL: http://svn.apache.org/viewvc?rev=1158420view=rev Log: 2011-08-16 Martin Sebor se...@apache.org * 2011-08.txt: Board report for August 2011. To be copied into https://svn.apache.org/repos/private/foundation/board/board_agenda_2011_08_17.txt Added: stdcxx/site/status/2011-08.txt (with props) Added: stdcxx/site/status/2011-08.txt URL: http://svn.apache.org/viewvc/stdcxx/site/status/2011-08.txt?rev=1158420view=auto == --- stdcxx/site/status/2011-08.txt (added) +++ stdcxx/site/status/2011-08.txt Tue Aug 16 18:48:45 2011 @@ -0,0 +1,5 @@ +Notable changes since previous report (May 2011): + + There have been no changes to Apache stdcxx. An inetersted contributor + seems to have opted to set up a fork of stdcxx at www.spi-inc.org (or + is in the process of doing so). Propchange: stdcxx/site/status/2011-08.txt -- svn:eol-style = native Propchange: stdcxx/site/status/2011-08.txt -- svn:keywords = Id
svn commit: r1070346 - /stdcxx/site/status/2011-02.txt
Author: sebor Date: Mon Feb 14 00:54:28 2011 New Revision: 1070346 URL: http://svn.apache.org/viewvc?rev=1070346view=rev Log: 2011-02-13 Martin Sebor se...@apache.org * status/stdcxx-status/2010-11.txt: Board report for February 2011. To be copied into https://svn.apache.org/repos/private/foundation/board/board_agenda_2011_02_16.txt Added: stdcxx/site/status/2011-02.txt (with props) Added: stdcxx/site/status/2011-02.txt URL: http://svn.apache.org/viewvc/stdcxx/site/status/2011-02.txt?rev=1070346view=auto == --- stdcxx/site/status/2011-02.txt (added) +++ stdcxx/site/status/2011-02.txt Mon Feb 14 00:54:28 2011 @@ -0,0 +1,32 @@ +Notable changes since previous report (November 2010): + + Stdcxx continues to be dormant. All but committer have moved on + to other projects. The only remaining committer (the VP of the + project) is too busy with his day job to make even small changes, + or to put out the long-awaited patch release, stdcxx 4.2.2. + + A number of users and organizations have been using the project + and expressed interest in contributing to it. Several submitted + patches, others have offered help with the project build and test + infrastructure. Unfortunately, since no committer is available to + review patches and guide the contributors through the ASF process + to enable them to gain commit privileges there seems to be little + hope of reviving stdcxx. + + A possible solution that would allow contributions to resume is + to grant commit privileges to the handful of contributors who have + already submitted some patches or expressed serious interest in + contributing going forward. + + Another alternative is to move stdcxx to a repository outside of + ASF such as SourceForge or similar where interested developers + could start committing changes on their own right away, without + going through the training process. This seems to the preferred + solution among at least some of the interested users. + + Are there any other options? + +Future plans: + + Unless the issue with contributions can be resolved in the next + quarter I suggest to retire the project. Propchange: stdcxx/site/status/2011-02.txt -- svn:eol-style = native Propchange: stdcxx/site/status/2011-02.txt -- svn:keywords = Id
svn commit: r1035812 - /stdcxx/site/status/2010-11.txt
Author: sebor Date: Tue Nov 16 21:01:51 2010 New Revision: 1035812 URL: http://svn.apache.org/viewvc?rev=1035812view=rev Log: 2010-11-16 Martin Sebor se...@apache.org * status/stdcxx-status/2010-11.txt: Board report for November 2010. To be copied into https://svn.apache.org/repos/private/foundation/board/board_agenda_2010_11_17.txt Added: stdcxx/site/status/2010-11.txt (with props) Added: stdcxx/site/status/2010-11.txt URL: http://svn.apache.org/viewvc/stdcxx/site/status/2010-11.txt?rev=1035812view=auto == --- stdcxx/site/status/2010-11.txt (added) +++ stdcxx/site/status/2010-11.txt Tue Nov 16 21:01:51 2010 @@ -0,0 +1,10 @@ +Notable changes since previous report (September 2010): + + No project activity since the last report. + +Future plans: + + I'm considering stepping down as chair of stdcxx. I haven't had + time to spend on the project or to help interested contributors + become committers. Unless another committer steps up willing to + take on the responsibility stdcxx might need to be retired. Propchange: stdcxx/site/status/2010-11.txt -- svn:eol-style = native Propchange: stdcxx/site/status/2010-11.txt -- svn:keywords = Id
svn commit: r979869 - /stdcxx/trunk/doc/stdlibref/basic-string.html
Author: sebor Date: Tue Jul 27 21:00:50 2010 New Revision: 979869 URL: http://svn.apache.org/viewvc?rev=979869view=rev Log: 2010-07-27 Martin Sebor se...@apache.org STDCXX-1047 * stdlibref/basic-string.html: Corrected typos and poor formatting. Modified: stdcxx/trunk/doc/stdlibref/basic-string.html Modified: stdcxx/trunk/doc/stdlibref/basic-string.html URL: http://svn.apache.org/viewvc/stdcxx/trunk/doc/stdlibref/basic-string.html?rev=979869r1=979868r2=979869view=diff == --- stdcxx/trunk/doc/stdlibref/basic-string.html (original) +++ stdcxx/trunk/doc/stdlibref/basic-string.html Tue Jul 27 21:00:50 2010 @@ -549,7 +549,7 @@ template lt;class InputIteratorgt; /TABLE/UL /UL -A NAME=sec7H3Destructors/H3/A +A NAME=sec7H3Destructor/H3/A A NAME=idx327/APREB~basic_string/B ();/PRE UL @@ -1117,26 +1117,28 @@ void A NAME=sec12H3Nonmember Operators/H3/A -A NAME=idx373/APREtemplatelt;class charT, class traits, class Allocatorgt; -basic_string -Boperator+/B(const basic_stringamp; lhs, const basic_stringamp; rhs);/PRE +A NAME=idx373/APRE +templatelt;class charT, class traits, class Allocatorgt; +basic_stringlt;charT, traits allocatorgt; +Boperator+/B(const basic_stringlt;charT, traits allocatorgt; amp;lhs, const basic_stringlt;charT, traits allocatorgt; amp;rhs);/PRE UL PReturns a string of length SAMPlhs.size() + rhs.size()/SAMP, where the first SAMPlhs.size()/SAMP elements are copies of the elements of SAMPlhs/SAMP, and the next SAMPrhs.size()/SAMP elements are copies of the elements of SAMPrhs/SAMP./P /UL -A NAME=idx374/APREtemplatelt;class charT, class traits, class Allocatorgt; -basic_string -Boperator+/B(const charT* lhs, const basic_stringamp; rhs); +A NAME=idx374/APRE +templatelt;class charT, class traits, class Allocatorgt; +basic_stringlt;charT, traits allocatorgt; +Boperator+/B(const charT* lhs, const basic_stringlt;charT, traits allocatorgt; amp;rhs); templatelt;class charT, class traits, class Allocatorgt; -basic_string -Boperator+/B(charT lhs, const basic_stringamp; rhs); +basic_stringlt;charT, traits allocatorgt; +Boperator+/B(charT lhs, const basic_stringlt;charT, traits allocatorgt; amp; rhs); templatelt;class charT, class traits, class Allocatorgt; -basic_string -Boperator+/B(const basic_stringamp; lhs, const charT* rhs); +basic_stringlt;charT, traits allocatorgt; +Boperator+/B(const basic_stringlt;charT, traits allocatorgt; amp;lhs, const charT* rhs); templatelt;class charT, class traits, class Allocatorgt; -basic_string -Boperator+/B(const basic_stringamp; lhs, charT rhs);/PRE +basic_stringlt;charT, traits allocatorgt; +Boperator+/B(const basic_stringlt;charT, traits allocatorgt; amp;lhs, charT rhs);/PRE UL PReturns a string that represents the concatenation of two string-like entities. These functions return, respectively:/P @@ -1148,21 +1150,23 @@ lhs + basic_string(1, rhs) /UL -A NAME=idx375/APREtemplatelt;class charT, class traits, class Allocatorgt; +A NAME=idx375/APRE +templatelt;class charT, class traits, class Allocatorgt; bool -Boperator==/B(const basic_stringamp; lhs, - const basic_stringamp; rhs);/PRE +Boperator==/B(const basic_stringlt;charT, traits allocatorgt; amp;lhs, +const basic_stringlt;charT, traits allocatorgt; amp;rhs);/PRE UL PReturns a boolean value of SAMPtrue/SAMP if SAMPlhs/SAMP and SAMPrhs/SAMP are equal, and SAMPfalse/SAMP if they are not. Equality is defined by the SAMPcompare()/SAMP member function./P /UL -A NAME=idx376/APREtemplatelt;class charT, class traits, class Allocatorgt; +A NAME=idx376/APRE +templatelt;class charT, class traits, class Allocatorgt; bool -Boperator==/B(const charT* lhs, const basic_stringamp; rhs); +Boperator==/B(const charT* lhs, const basic_stringlt;charT, traits allocatorgt; amp;rhs); templatelt;class charT, class traits, class Allocatorgt; bool -Boperator==/B(const basic_stringamp; lhs, const charT* rhs);/PRE +Boperator==/B(const basic_stringlt;charT, traits allocatorgt; amp;lhs, const charT* rhs);/PRE UL PReturns a boolean value indicating whether SAMPlhs/SAMP and SAMPrhs/SAMP are equal. Equality is defined by the SAMPcompare()/SAMP member function. These functions return, respectively:/P @@ -1172,21 +1176,23 @@ lhs == basic_string(rhs) /UL -A NAME=idx377/APREtemplatelt;class charT, class traits, class Allocatorgt; +A NAME=idx377/APRE +templatelt;class charT, class traits, class Allocatorgt; bool -Boperator!=/B(const basic_stringamp; lhs, - const basic_stringamp; rhs);/PRE +Boperator!=/B(const basic_stringlt;charT, traits allocatorgt; amp;lhs, +const basic_stringlt;charT, traits allocatorgt; amp;rhs);/PRE UL PReturns a boolean value representing the inequality of SAMPlhs/SAMP and SAMPrhs/SAMP. Inequality is defined by the SAMPcompare()/SAMP member function./P /UL -A NAME=idx378/APREtemplatelt;class charT
svn commit: r960407 - in /stdcxx/branches/4.2.x: include/fstream src/iostream.cpp tests/iostream/27.filebuf.cpp tests/regress/27.filebuf.members.stdcxx-308.cpp
Author: sebor Date: Sun Jul 4 23:09:25 2010 New Revision: 960407 URL: http://svn.apache.org/viewvc?rev=960407view=rev Log: 2010-07-04 Martin Sebor se...@apache.org STDCXX-1049 * include/fstream (basic_filebuf::basic_filebuf, basic_filebuf::open, basic_filebuf::fd, basic_filebuf::attach, basic_filebuf::detach): Guarded POSIX extensions using _RWSTD_NO_NATIVE_IO. (basic_ifstream, basic_ofstream, basic_fstream): Same. * src/iostream.cpp (unistd.h): Included only if _RWSTD_NO_NATIVE_IO is not defined. (_RWSTD_DEFINE_STREAM_OBJECT): Modified to use stdin, stdout, and stderr when _RWSTD_NO_NATIVE_IO is defined, otherwise STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO. (ios_base::Init::Init): Adjusted. * tests/iostream/27.filebuf.cpp (test_ctors, test_attach): Avoided testing POSIX extensions above when _RWSTD_NO_NATIVE_IO is defined. * tests/regress/27.filebuf.members.stdcxx-308.cpp: Same. Modified: stdcxx/branches/4.2.x/include/fstream stdcxx/branches/4.2.x/src/iostream.cpp stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp stdcxx/branches/4.2.x/tests/regress/27.filebuf.members.stdcxx-308.cpp Modified: stdcxx/branches/4.2.x/include/fstream URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/fstream?rev=960407r1=960406r2=960407view=diff == --- stdcxx/branches/4.2.x/include/fstream (original) +++ stdcxx/branches/4.2.x/include/fstream Sun Jul 4 23:09:25 2010 @@ -128,6 +128,9 @@ private: // ctor extensions - associate this with an open file and // optionally set buffer size and caller-allocated buffer // NOTE: passed in buffer will NOT be deallocated + +#ifndef _RWSTD_NO_NATIVE_IO + _EXPLICIT basic_filebuf (int __fd, char_type* __buf = 0, _RWSTD_STREAMSIZE __bufsz = _RWSTD_DEFAULT_BUFSIZE) @@ -136,9 +139,11 @@ private: _C_open (__fd, 0, __buf, __bufsz); } +#endif // _RWSTD_NO_NATIVE_IO + public: -#ifndef _RWSTD_NO_EXT_FILEBUF +#if !defined(_RWSTD_NO_EXT_FILEBUF) || defined(_RWSTD_NO_NATIVE_IO) // extension enabled only if the macro stdin is also #defined // i.e., if the header cstdio or stdio.h has been #included @@ -154,7 +159,7 @@ public: } # endif // stdin -#endif // _RWSTD_NO_EXT_FILEBUF +#endif // !_RWSTD_NO_EXT_FILEBUF || _RWSTD_NO_NATIVE_IO // 27.8.1.2, p3 virtual ~basic_filebuf (); @@ -168,11 +173,15 @@ public: // and optionally set buffer size and caller-allocated buffer // NOTE: passed in buffer will NOT be deallocated +# ifndef _RWSTD_NO_NATIVE_IO + basic_filebuf* open (int __fd, char_type *__buf = 0, _RWSTD_STREAMSIZE __bufsz = _RWSTD_DEFAULT_BUFSIZE) { return _C_open (__fd, 0, __buf, __bufsz); } +# endif // _RWSTD_NO_NATIVE_IO + # ifdef stdin // extension enabled only if the macro stdin is also #defined @@ -184,7 +193,9 @@ public: } # endif // stdin - + +# ifndef _RWSTD_NO_NATIVE_IO + // extension - return the associated file descriptor int fd () const { return _RW::__rw_fileno (_C_file, this-_C_state); @@ -201,6 +212,7 @@ public: return close (false) ? __fd : -1; } +# endif // _RWSTD_NO_NATIVE_IO #endif // _RWSTD_NO_EXT_FILEBUF // 27.8.1.3, p6, argument is an extension @@ -387,6 +399,9 @@ public: #ifndef _RWSTD_NO_EXT_FILEBUF // extensions - associate this with an open file and set buffer + +# ifndef _RWSTD_NO_NATIVE_IO + _EXPLICIT basic_ifstream (int __fd, char_type *__buf = 0, _RWSTD_STREAMSIZE __n = _RWSTD_DEFAULT_BUFSIZE) @@ -394,6 +409,8 @@ public: open (__fd, __buf, __n); } +# endif // _RWSTD_NO_NATIVE_IO + # ifdef stdin _EXPLICIT @@ -430,12 +447,17 @@ public: #ifndef _RWSTD_NO_EXT_FILEBUF // extensions - associate this with an open file and set buffer + +# ifndef _RWSTD_NO_NATIVE_IO + void open (int __fd, char_type *__buf=0, _RWSTD_STREAMSIZE __n = _RWSTD_DEFAULT_BUFSIZE) { this-clear (rdbuf ()-open (__fd, __buf, __n) ? ios_base::goodbit : ios_base::failbit); } +# endif // _RWSTD_NO_NATIVE_IO + # ifdef stdin void open (FILE *__fptr, char_type *__buf=0, @@ -487,12 +509,17 @@ public: #ifndef _RWSTD_NO_EXT_FILEBUF // extensions - associate this with an open file and set buffer + +# ifndef _RWSTD_NO_NATIVE_IO + _EXPLICIT basic_ofstream (int __fd, char_type *__buf = 0, _RWSTD_STREAMSIZE __n = _RWSTD_DEFAULT_BUFSIZE) : basic_ostreamchar_type, traits_type (rdbuf ()) { open (__fd, __buf, __n); } + +# endif // _RWSTD_NO_NATIVE_IO # ifdef stdin @@ -530,12 +557,17 @@ public: #ifndef _RWSTD_NO_EXT_FILEBUF // extensions - associate
svn commit: r945441 - /stdcxx/site/status/2010-05.text
Author: sebor Date: Mon May 17 23:53:42 2010 New Revision: 945441 URL: http://svn.apache.org/viewvc?rev=945441view=rev Log: 2010-05-17 Martin Sebor se...@apache.org * status/stdcxx-status/2010-05.text: Board report for May 2010. To be copied into: https://svn.apache.org/repos/private/foundation/board/board_agenda_2010_05_19.txt Added: stdcxx/site/status/2010-05.text (with props) Added: stdcxx/site/status/2010-05.text URL: http://svn.apache.org/viewvc/stdcxx/site/status/2010-05.text?rev=945441view=auto == --- stdcxx/site/status/2010-05.text (added) +++ stdcxx/site/status/2010-05.text Mon May 17 23:53:42 2010 @@ -0,0 +1,17 @@ +Notable changes since previous report (February 2010): + + There has been virtually no project activity since the last report. + Only a handful issues were reported, some privately to the VP of + the project. No existing issues have been resolved. + + No new committers or PMC members have been added. + + The Sun KDE project uses and ships (or plans to ship) the last stable + release of stdcxx, 4.2.1, with KDE as the default implementation of + the C++ Standard Library. There is interest in continuing to do so + but no KDE volunteers have stepped up so far to help with stdcxx. + +Future plans: + + Release the stdcxx 4.2.2 bugfix update. Attempt to increase project + activity and find and set up an alternate build and test infrastructure. Propchange: stdcxx/site/status/2010-05.text -- svn:eol-style = native
svn commit: r881089 - /stdcxx/site/status/2009-11.text
Author: sebor Date: Tue Nov 17 01:44:40 2009 New Revision: 881089 URL: http://svn.apache.org/viewvc?rev=881089view=rev Log: 2009-11-16 Martin Sebor se...@apache.org * status/2009-11.text: Board report for November 2009. To be copied into https://svn.apache.org/repos/private/foundation/board/board_agenda_2009_11_18.txt. Added: stdcxx/site/status/2009-11.text Added: stdcxx/site/status/2009-11.text URL: http://svn.apache.org/viewvc/stdcxx/site/status/2009-11.text?rev=881089view=auto == --- stdcxx/site/status/2009-11.text (added) +++ stdcxx/site/status/2009-11.text Tue Nov 17 01:44:40 2009 @@ -0,0 +1,38 @@ +Notable changes since previous report (August 2009): + + All stdcxx activity, including mailing list traffic and source code + repository commits, continues to be very low. + +Future plans: + + Release the stdcxx 4.2.2 bugfix update. Attempt to increase project + activity to get help with providing experimental support for C++ 0x + in stdcxx 4.3.0, and complete support in 5.0. Migrate nightly build + and test infrastructure away from Rogue Wave based resources. + +Community: + + 16 committers (N/C) + 11 PMC members (N/C) + +Bug tracking database changes since the last report: + + Total issues: 1034 (+4) + Outstanding: 342 (+1) + Resolved: 166 (N/C) + Closed:526 (+3) + +Planned releases: + + 4.2.2 Winter 2009 (was Summer 2009) + 4.3.0 Spring 2009 (was Winter 2009) + 5.0.0 2010 - 2011 + +Release history: + + 4.2.1 May 1, 2008 + 4.2.0 October 29, 2007 (incubating) + 4.1.3 January 30, 2006 (incubating) + 4.1.2 September 7, 2005 (snapshot, incubating) + +N/C = No Change.
svn commit: r814381 - /stdcxx/site/index.html
Author: sebor Date: Sun Sep 13 20:44:28 2009 New Revision: 814381 URL: http://svn.apache.org/viewvc?rev=814381view=rev Log: 2009-09-13 Martin Sebor se...@apache.org * index.html (Committers): Updated affiliation. Modified: stdcxx/site/index.html Modified: stdcxx/site/index.html URL: http://svn.apache.org/viewvc/stdcxx/site/index.html?rev=814381r1=814380r2=814381view=diff == --- stdcxx/site/index.html (original) +++ stdcxx/site/index.html Sun Sep 13 20:44:28 2009 @@ -926,7 +926,7 @@ /a /td td - a class=external hrefhttp://www.aquevix.com/; + a class=external href=http://www.aquevix.com/; Aquevix, Ltd./a /td tdMay 19, 2005/td @@ -992,7 +992,11 @@ Martin Sebor /a /td -td!-- affiliation --/td +td +a class=external href=http://www.cisco.com; +Cisco Systems, Inc. +/a +/td tdMay 19, 2005/td td/td /tr
svn commit: r814401 - /stdcxx/branches/4.2.x/include/valarray
Author: sebor Date: Sun Sep 13 22:25:08 2009 New Revision: 814401 URL: http://svn.apache.org/viewvc?rev=814401view=rev Log: 2009-09-13 Martin Sebor se...@apache.org STDCXX-791 * include/valarray (valarray::valarray(const gslice_array, gslice_array::operator=, gslice_array::operator*=, gslice_array::operator/=, gslice_array::operator+=, gslice_array::operator-=, gslice_array::operator%=, gslice_array::operator^=, gslice_array::operator=, gslice_array::operator|=, gslice_array::operator=, gslice_array::operator=): Parenthesized logic expression to silence gcc -Wparentheses warning. (Missed in r814400). Modified: stdcxx/branches/4.2.x/include/valarray Modified: stdcxx/branches/4.2.x/include/valarray URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/valarray?rev=814401r1=814400r2=814401view=diff == --- stdcxx/branches/4.2.x/include/valarray (original) +++ stdcxx/branches/4.2.x/include/valarray Sun Sep 13 22:25:08 2009 @@ -1856,8 +1856,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted () || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] = __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -1871,8 +1871,7 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( !gsl-is_reseted() || !__cpt gsl-ind_numb() ) -{ +while (!gsl-is_reseted () || (!__cpt gsl-ind_numb ())) { (*_C_array)[__i] = value; __i= gsl-next_ind(); __cpt++; @@ -1889,8 +1888,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted () || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] *= __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -1904,8 +1903,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted () || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] /= __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -1919,8 +1918,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted () || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] += __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -1934,8 +1933,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted() || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] -= __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -1950,8 +1949,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted () || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] %= __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -1965,8 +1964,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted () || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] ^= __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -1980,8 +1979,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted() || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] = __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -1995,8 +1994,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted() || (!__cpt gsl-ind_numb ())) +__cpt __rhs.size ()) { (*_C_array)[__i] |= __rhs[__cpt]; __i= gsl-next_ind(); __cpt++; @@ -2010,8 +2009,8 @@ _RWSTD_SIZE_T __i = gsl-next_ind(); _RWSTD_SIZE_T __cpt = 0; -while( (!gsl-is_reseted() || !__cpt gsl-ind_numb()) __cpt __rhs.size() ) -{ +while ( (!gsl-is_reseted () || (!__cpt gsl-ind_numb
svn commit: r814409 - in /stdcxx/branches/4.2.x: tests/containers/ tests/localization/ tests/regress/ util/
Author: sebor Date: Sun Sep 13 22:34:54 2009 New Revision: 814409 URL: http://svn.apache.org/viewvc?rev=814409view=rev Log: 2009-09-13 Martin Sebor se...@apache.org * tests/localization/22.locale.ctype.tolower.cpp (locale_list): Removed unused global variable to silence gcc -Wshadow warnings. * tests/localization/22.locale.messages.mt.cpp (run_test): Silenced gcc's -Wunused warning, corrected a logic error in a preprocessor conditional and fixed a typo. * tests/localization/22.locale.statics.mt.cpp (test_global): Changed type of a local variable to avoid gcc's -Wsign-compare warnings. * tests/regress/22.locale.messages.stdcxx-542.cpp (run_test): Same. * tests/containers/23.bitset.cpp (test_ctors, stress_ctors, test_operators, test_other, stress_count, test_elem_access, test_to_string): Corrected formatting directive for size_t argument. * tests/regress/23.set.stdcxx-216.cpp (Value::Value(unsigned): Renamed a function formal argument to avoid a gcc -Wshadow warning. Removed commented out debugging code. * tests/regress/21.string.append.stdcxx-438.cpp (operator new): Threw std::bad_alloc on failure as required instead of returning null to silence a gcc warning. * tests/regress/21.string.replace.stdcxx-175.cpp (main): Removed unused arguments to silence gcc -Wunused warnings. * tests/regress/23.list.special.stdcxx-334.cpp (operator==, operator!=, main): Same. * tests/regress/23.list.insert.stdcxx-331.cpp (main): Same. * tests/regress/21.string.stdcxx-466.cpp (main): Same. * tests/regress/23.list.cons.stdcxx-268.cpp (main): Same. * util/locale.cpp (write_coll_info): Removed an empty else branch to silence a gcc -Wmissing-braces warning. * util/exec.cpp (wait_for_child): Added braces to silence a gcc -Wmissing-braces warning. Modified: stdcxx/branches/4.2.x/tests/containers/23.bitset.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.ctype.tolower.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.messages.mt.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.statics.mt.cpp stdcxx/branches/4.2.x/tests/regress/21.string.append.stdcxx-438.cpp stdcxx/branches/4.2.x/tests/regress/21.string.replace.stdcxx-175.cpp stdcxx/branches/4.2.x/tests/regress/21.string.stdcxx-466.cpp stdcxx/branches/4.2.x/tests/regress/22.locale.messages.stdcxx-542.cpp stdcxx/branches/4.2.x/tests/regress/23.list.cons.stdcxx-268.cpp stdcxx/branches/4.2.x/tests/regress/23.list.insert.stdcxx-331.cpp stdcxx/branches/4.2.x/tests/regress/23.list.special.stdcxx-334.cpp stdcxx/branches/4.2.x/tests/regress/23.set.stdcxx-216.cpp stdcxx/branches/4.2.x/util/exec.cpp stdcxx/branches/4.2.x/util/locale.cpp Modified: stdcxx/branches/4.2.x/tests/containers/23.bitset.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/containers/23.bitset.cpp?rev=814409r1=814408r2=814409view=diff == --- stdcxx/branches/4.2.x/tests/containers/23.bitset.cpp (original) +++ stdcxx/branches/4.2.x/tests/containers/23.bitset.cpp Sun Sep 13 22:34:54 2009 @@ -388,25 +388,25 @@ const ULong bmask = ULong (::bitmax (N)); { // bitset::bitset() -rw_info (0, 0, __LINE__, std::bitset%d::bitset(), N); +rw_info (0, 0, __LINE__, std::bitset%zu::bitset(), N); const std::bitsetN b; rw_assert (0 == b.to_ulong (), 0, __LINE__, - bitset%d::bitset ().to_ulong() == 0, got %#lx, + bitset%zu::bitset ().to_ulong() == 0, got %#lx, b.to_ulong ()); } { // bitset::bitset (unsigned long) -rw_info (0, 0, __LINE__, std::bitset%d::bitset (unsigned long), N); +rw_info (0, 0, __LINE__, std::bitset%zu::bitset (unsigned long), N); const std::bitsetN b (ULONG_MAX bmask); rw_assert ((ULONG_MAX bmask) == b.to_ulong (), 0, __LINE__, - bitset%d::bitset (%#lx).to_ulong() == 0, got %#lx, + bitset%zu::bitset (%#lx).to_ulong() == 0, got %#lx, N, ULONG_MAX bmask, b.to_ulong ()); } { // bitset (const string str, size_t pos = 0, size_t n = (size_t)-1); -rw_info (0, 0, __LINE__, std::bitset%d::bitset (string), N); +rw_info (0, 0, __LINE__, std::bitset%zu::bitset (string), N); test_setN ts; ts.set (); @@ -416,12 +416,12 @@ if (N = sizeof (unsigned long) * CHAR_BIT) rw_assert (b == bmask, 0, __LINE__, - bitset%d::bitset(string(\%s\).to_ulong() + bitset%zu::bitset(string(\%s\).to_ulong() == %#x, got %#x, N, ts.bits (), bmask, b.to_ulong
svn commit: r805093 - /stdcxx/site/status/2009-08.text
Author: sebor Date: Mon Aug 17 18:57:34 2009 New Revision: 805093 URL: http://svn.apache.org/viewvc?rev=805093view=rev Log: 2009-08-17 Martin Sebor se...@apache.org * status/2009-08.text: Board report for August 2009. To be copied into https://svn.apache.org/repos/private/foundation/board/board_agenda_2009_08_19.txt. Added: stdcxx/site/status/2009-08.text (with props) Added: stdcxx/site/status/2009-08.text URL: http://svn.apache.org/viewvc/stdcxx/site/status/2009-08.text?rev=805093view=auto == --- stdcxx/site/status/2009-08.text (added) +++ stdcxx/site/status/2009-08.text Mon Aug 17 18:57:34 2009 @@ -0,0 +1,39 @@ +Notable changes since previous report (May 2009): + + Stdcxx continues to be very quiet with only a handful of minor bug + fixes having been committed in this period. + +Future plans: + + Put out the delayed stdcxx 4.2.2 release and resume work on adding + experimental support for C++ 0x in stdcxx 4.3.0, with complete support + expected in 5.0. Change nightly testing infrastructure to avoid relying + on Rogue Wave resources. + +Community: + + 16 committers (N/C) + 11 PMC members (N/C) + + +Bug tracking database changes since the last report: + + Total issues: 1030 (+5) + Outstanding: 341 (+4) + Resolved: 166 (+1) + Closed:523 (N/C) + +Planned releases: + + 4.2.2 Summer 2009 (was Spring 2009) + 4.3.0 Winter 2009 (was Fall 2009) + 5.0.0 2010 (was end of 2009) + +Release history: + + 4.2.1 May 1, 2008 + 4.2.0 October 29, 2007 (incubating) + 4.1.3 January 30, 2006 (incubating) + 4.1.2 September 7, 2005 (snapshot, incubating) + +N/C = No Change. Propchange: stdcxx/site/status/2009-08.text -- svn:eol-style = native
svn commit: r792173 - /stdcxx/branches/4.3.x/bin/genxviews
Author: sebor Date: Wed Jul 8 15:03:21 2009 New Revision: 792173 URL: http://svn.apache.org/viewvc?rev=792173view=rev Log: 2009-07-08 Martin Sebor se...@apache.org Merged revs 785855 and 785832 from 4.2.x. 2009-06-17 Martin Sebor se...@apache.org * bin/genxviews: Added Visual C++ 8.0 to Windows 2008 per Andrew's latest comment: http://markmail.org/message/fj5qoqpggpkhewzr 2009-06-17 Martin Sebor se...@apache.org * bin/genxviews: Updated according to: http://markmail.org/message/qc3hjoloav3i7wec Modified: stdcxx/branches/4.3.x/bin/genxviews Modified: stdcxx/branches/4.3.x/bin/genxviews URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/bin/genxviews?rev=792173r1=792172r2=792173view=diff == --- stdcxx/branches/4.3.x/bin/genxviews (original) +++ stdcxx/branches/4.3.x/bin/genxviews Wed Jul 8 15:03:21 2009 @@ -434,6 +434,10 @@ linux_redhat_el-5.0-em64t-gcc-4.1.1-*-*-log.gz.txt \ linux_redhat_el-5.0-em64t-gcc-4.1.1.html +process_results Red Hat Enterprise Linux 5.0 EM64T Intel C++ 11.0 \ +linux_redhat_el-5.0-em64t-icc-11.0-*-*-log.gz.txt \ +linux_redhat_el-5.0-em64t-icc-11.0.html + process_results Red Hat Enterprise Linux 5.0 EM64T Intel C++ 10.0 \ linux_redhat_el-5.0-em64t-icc-10.0-*-*-log.gz.txt \ linux_redhat_el-5.0-em64t-icc-10.0.html @@ -585,6 +589,19 @@ win_xp-2-x86-gcc-3.4.4.html # Windows ## + +process_results Windows 2008 EM64T MSVC 9.0 \ +win_2008-0-em64t-msvc-9.0-*-*-log.gz.txt \ + win_2008_0-em64t-msvc-9.0.html + +process_results Windows 2008 EM64T MSVC 8.0 \ +win_2008-0-em64t-msvc-8.0-*-*-log.gz.txt \ + win_2008_0-em64t-msvc-8.0.html + +process_results Windows 2008 EM64T Intel C++ 11.0 \ +win_2008-0-em64t-icl-11.0-*-*-log.gz.txt \ + win_2008_0-em64t-icl-11.0.html + process_results Windows Vista EM64T MSVC 9.0 \ win_vista-0-em64t-msvc-9.0-*-*-log.gz.txt \ win_vista_0-em64t-msvc-9.0.html @@ -593,6 +610,10 @@ win_vista-0-em64t-msvc-8.0-*-*-log.gz.txt \ win_vista_0-em64t-msvc-8.0.html +process_results Windows Vista EM64T Intel C++ 11.0 \ +win_vista-0-em64t-icl-11.0-*-*-log.gz.txt \ + win_vista_0-em64t-icl-11.0.html + process_results Windows Vista EM64T Intel C++ 10.0 \ win_vista-0-em64t-icl-10.0-*-*-log.gz.txt \ win_vista_0-em64t-icl-10.0.html @@ -605,6 +626,10 @@ win_xp-2-x86-msvc-7.1-*-*-log.gz.txt \ win_xp_2-x86-msvc-7.1.html +process_results Windows XP, SP2 x86 Intel C++ 11.0 \ +win_xp-2-x86-icl-11.0-*-*-log.gz.txt \ + win_xp_2-x86-icl-11.0.html + process_results Windows XP, SP2 x86 Intel C++ 10.0 \ win_xp-2-x86-icl-10.0-*-*-log.gz.txt \ win_xp_2-x86-icl-10.0.html
svn commit: r792174 - /stdcxx/trunk/bin/genxviews
Author: sebor Date: Wed Jul 8 15:03:40 2009 New Revision: 792174 URL: http://svn.apache.org/viewvc?rev=792174view=rev Log: 2009-07-08 Martin Sebor se...@apache.org Merged revs 785855 and 785832 from 4.2.x. 2009-06-17 Martin Sebor se...@apache.org * bin/genxviews: Added Visual C++ 8.0 to Windows 2008 per Andrew's latest comment: http://markmail.org/message/fj5qoqpggpkhewzr 2009-06-17 Martin Sebor se...@apache.org * bin/genxviews: Updated according to: http://markmail.org/message/qc3hjoloav3i7wec Modified: stdcxx/trunk/bin/genxviews Modified: stdcxx/trunk/bin/genxviews URL: http://svn.apache.org/viewvc/stdcxx/trunk/bin/genxviews?rev=792174r1=792173r2=792174view=diff == --- stdcxx/trunk/bin/genxviews (original) +++ stdcxx/trunk/bin/genxviews Wed Jul 8 15:03:40 2009 @@ -434,6 +434,10 @@ linux_redhat_el-5.0-em64t-gcc-4.1.1-*-*-log.gz.txt \ linux_redhat_el-5.0-em64t-gcc-4.1.1.html +process_results Red Hat Enterprise Linux 5.0 EM64T Intel C++ 11.0 \ +linux_redhat_el-5.0-em64t-icc-11.0-*-*-log.gz.txt \ +linux_redhat_el-5.0-em64t-icc-11.0.html + process_results Red Hat Enterprise Linux 5.0 EM64T Intel C++ 10.0 \ linux_redhat_el-5.0-em64t-icc-10.0-*-*-log.gz.txt \ linux_redhat_el-5.0-em64t-icc-10.0.html @@ -585,6 +589,19 @@ win_xp-2-x86-gcc-3.4.4.html # Windows ## + +process_results Windows 2008 EM64T MSVC 9.0 \ +win_2008-0-em64t-msvc-9.0-*-*-log.gz.txt \ + win_2008_0-em64t-msvc-9.0.html + +process_results Windows 2008 EM64T MSVC 8.0 \ +win_2008-0-em64t-msvc-8.0-*-*-log.gz.txt \ + win_2008_0-em64t-msvc-8.0.html + +process_results Windows 2008 EM64T Intel C++ 11.0 \ +win_2008-0-em64t-icl-11.0-*-*-log.gz.txt \ + win_2008_0-em64t-icl-11.0.html + process_results Windows Vista EM64T MSVC 9.0 \ win_vista-0-em64t-msvc-9.0-*-*-log.gz.txt \ win_vista_0-em64t-msvc-9.0.html @@ -593,6 +610,10 @@ win_vista-0-em64t-msvc-8.0-*-*-log.gz.txt \ win_vista_0-em64t-msvc-8.0.html +process_results Windows Vista EM64T Intel C++ 11.0 \ +win_vista-0-em64t-icl-11.0-*-*-log.gz.txt \ + win_vista_0-em64t-icl-11.0.html + process_results Windows Vista EM64T Intel C++ 10.0 \ win_vista-0-em64t-icl-10.0-*-*-log.gz.txt \ win_vista_0-em64t-icl-10.0.html @@ -605,6 +626,10 @@ win_xp-2-x86-msvc-7.1-*-*-log.gz.txt \ win_xp_2-x86-msvc-7.1.html +process_results Windows XP, SP2 x86 Intel C++ 11.0 \ +win_xp-2-x86-icl-11.0-*-*-log.gz.txt \ + win_xp_2-x86-icl-11.0.html + process_results Windows XP, SP2 x86 Intel C++ 10.0 \ win_xp-2-x86-icl-10.0-*-*-log.gz.txt \ win_xp_2-x86-icl-10.0.html
svn commit: r785832 - /stdcxx/branches/4.2.x/bin/genxviews
Author: sebor Date: Wed Jun 17 22:05:47 2009 New Revision: 785832 URL: http://svn.apache.org/viewvc?rev=785832view=rev Log: 2009-06-17 Martin Sebor se...@apache.org * bin/genxviews: Updated according to: http://markmail.org/message/qc3hjoloav3i7wec Modified: stdcxx/branches/4.2.x/bin/genxviews Modified: stdcxx/branches/4.2.x/bin/genxviews URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/bin/genxviews?rev=785832r1=785831r2=785832view=diff == --- stdcxx/branches/4.2.x/bin/genxviews (original) +++ stdcxx/branches/4.2.x/bin/genxviews Wed Jun 17 22:05:47 2009 @@ -434,6 +434,10 @@ linux_redhat_el-5.0-em64t-gcc-4.1.1-*-*-log.gz.txt \ linux_redhat_el-5.0-em64t-gcc-4.1.1.html +process_results Red Hat Enterprise Linux 5.0 EM64T Intel C++ 11.0 \ +linux_redhat_el-5.0-em64t-icc-11.0-*-*-log.gz.txt \ +linux_redhat_el-5.0-em64t-icc-11.0.html + process_results Red Hat Enterprise Linux 5.0 EM64T Intel C++ 10.0 \ linux_redhat_el-5.0-em64t-icc-10.0-*-*-log.gz.txt \ linux_redhat_el-5.0-em64t-icc-10.0.html @@ -585,6 +589,15 @@ win_xp-2-x86-gcc-3.4.4.html # Windows ## + +process_results Windows 2008 EM64T MSVC 9.0 \ +win_2008-0-em64t-msvc-9.0-*-*-log.gz.txt \ + win_2008_0-em64t-msvc-9.0.html + +process_results Windows 2008 EM64T Intel C++ 11.0 \ +win_2008-0-em64t-icl-11.0-*-*-log.gz.txt \ + win_2008_0-em64t-icl-11.0.html + process_results Windows Vista EM64T MSVC 9.0 \ win_vista-0-em64t-msvc-9.0-*-*-log.gz.txt \ win_vista_0-em64t-msvc-9.0.html @@ -593,6 +606,10 @@ win_vista-0-em64t-msvc-8.0-*-*-log.gz.txt \ win_vista_0-em64t-msvc-8.0.html +process_results Windows Vista EM64T Intel C++ 11.0 \ +win_vista-0-em64t-icl-11.0-*-*-log.gz.txt \ + win_vista_0-em64t-icl-11.0.html + process_results Windows Vista EM64T Intel C++ 10.0 \ win_vista-0-em64t-icl-10.0-*-*-log.gz.txt \ win_vista_0-em64t-icl-10.0.html @@ -605,6 +622,10 @@ win_xp-2-x86-msvc-7.1-*-*-log.gz.txt \ win_xp_2-x86-msvc-7.1.html +process_results Windows XP, SP2 x86 Intel C++ 11.0 \ +win_xp-2-x86-icl-11.0-*-*-log.gz.txt \ + win_xp_2-x86-icl-11.0.html + process_results Windows XP, SP2 x86 Intel C++ 10.0 \ win_xp-2-x86-icl-10.0-*-*-log.gz.txt \ win_xp_2-x86-icl-10.0.html
svn commit: r785855 - /stdcxx/branches/4.2.x/bin/genxviews
Author: sebor Date: Wed Jun 17 23:32:51 2009 New Revision: 785855 URL: http://svn.apache.org/viewvc?rev=785855view=rev Log: 2009-06-17 Martin Sebor se...@apache.org * bin/genxviews: Added Visual C++ 8.0 to Windows 2008 per Andrew's latest comment: http://markmail.org/message/fj5qoqpggpkhewzr Modified: stdcxx/branches/4.2.x/bin/genxviews Modified: stdcxx/branches/4.2.x/bin/genxviews URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/bin/genxviews?rev=785855r1=785854r2=785855view=diff == --- stdcxx/branches/4.2.x/bin/genxviews (original) +++ stdcxx/branches/4.2.x/bin/genxviews Wed Jun 17 23:32:51 2009 @@ -594,6 +594,10 @@ win_2008-0-em64t-msvc-9.0-*-*-log.gz.txt \ win_2008_0-em64t-msvc-9.0.html +process_results Windows 2008 EM64T MSVC 8.0 \ +win_2008-0-em64t-msvc-8.0-*-*-log.gz.txt \ + win_2008_0-em64t-msvc-8.0.html + process_results Windows 2008 EM64T Intel C++ 11.0 \ win_2008-0-em64t-icl-11.0-*-*-log.gz.txt \ win_2008_0-em64t-icl-11.0.html
svn commit: r778780 - in /stdcxx/branches/4.2.x/src: iosdata.h iostore.cpp
Author: sebor Date: Tue May 26 15:59:17 2009 New Revision: 778780 URL: http://svn.apache.org/viewvc?rev=778780view=rev Log: 2009-05-26 Martin Sebor se...@apache.org STDCXX-1036 * src/iosdata.h (ios_base::_C_usr_data::_C_alloc, ios_base::_C_usr_data::_C_dealloc): Moved functions from here... * src/iostore.cpp: ...to here and outlined to silence gcc 4.4 -Winline warnings. Modified: stdcxx/branches/4.2.x/src/iosdata.h stdcxx/branches/4.2.x/src/iostore.cpp Modified: stdcxx/branches/4.2.x/src/iosdata.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/iosdata.h?rev=778780r1=778779r2=778780view=diff == --- stdcxx/branches/4.2.x/src/iosdata.h (original) +++ stdcxx/branches/4.2.x/src/iosdata.h Tue May 26 15:59:17 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. * **/ @@ -30,8 +30,6 @@ #define _RWSTD_IOSDATA_H_INCLUDED -#include string.h - #include rw/_iosbase.h #include rw/_defs.h @@ -68,66 +66,6 @@ static _C_usr_data _C_std_usr_data [2]; }; - -inline /* static */ ios_base::_C_usr_data* -ios_base::_C_usr_data::_C_alloc (_C_fire_fun pfire) -{ -_TRY { -// rely on 0-initialization of PODs -_C_usr_data* const pdata = new _C_usr_data (); - -#ifdef _RWSTD_NO_NEW_THROWS - -if (!pdata) -return 0; - -#endif // _RWSTD_NO_NEW_THROWS - -_RWSTD_ASSERT (0 != pdata); - -#ifndef _RWSTD_NO_POD_ZERO_INIT - -// assert that the POD ctor above zeroed out all members -_RWSTD_ASSERT (!pdata-_C_tie); -_RWSTD_ASSERT (!pdata-_C_iarray); -_RWSTD_ASSERT (!pdata-_C_parray); -_RWSTD_ASSERT (!pdata-_C_cbarray); -_RWSTD_ASSERT (!pdata-_C_isize); -_RWSTD_ASSERT (!pdata-_C_psize); -_RWSTD_ASSERT (!pdata-_C_cbsize); - -#else // if defined (_RWSTD_NO_POD_ZERO_INIT) - -memset (pdata, 0, sizeof *pdata); - -#endif // _RWSTD_NO_POD_ZERO_INIT - -pdata-_C_fire = pfire; - -return pdata; -} -_CATCH (...) { -return 0; -} -} - - -inline /* static */ void -ios_base::_C_usr_data::_C_dealloc (_C_usr_data *ptr) -{ -if (ptr) { -operator delete (ptr-_C_iarray); -operator delete (ptr-_C_parray); -operator delete (ptr-_C_cbarray); - -if ( ptr != _C_usr_data::_C_std_usr_data - ptr != _C_usr_data::_C_std_usr_data + 1) -delete ptr; -} -} - - } // namespace std - #endif // _RWSTD_IOSDATA_H_INCLUDED Modified: stdcxx/branches/4.2.x/src/iostore.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/iostore.cpp?rev=778780r1=778779r2=778780view=diff == --- stdcxx/branches/4.2.x/src/iostore.cpp (original) +++ stdcxx/branches/4.2.x/src/iostore.cpp Tue May 26 15:59:17 2009 @@ -84,6 +84,64 @@ _RWSTD_NAMESPACE (std) { +/* static */ ios_base::_C_usr_data* +ios_base::_C_usr_data::_C_alloc (_C_fire_fun pfire) +{ +_TRY { +// rely on zero-initialization of PODs +_C_usr_data* const pdata = new _C_usr_data (); + +#ifdef _RWSTD_NO_NEW_THROWS + +if (!pdata) +return 0; + +#endif // _RWSTD_NO_NEW_THROWS + +_RWSTD_ASSERT (0 != pdata); + +#ifndef _RWSTD_NO_POD_ZERO_INIT + +// assert that the POD ctor above zeroed out all members +_RWSTD_ASSERT (!pdata-_C_tie); +_RWSTD_ASSERT (!pdata-_C_iarray); +_RWSTD_ASSERT (!pdata-_C_parray); +_RWSTD_ASSERT (!pdata-_C_cbarray); +_RWSTD_ASSERT (!pdata-_C_isize); +_RWSTD_ASSERT (!pdata-_C_psize); +_RWSTD_ASSERT (!pdata-_C_cbsize); + +#else // if defined (_RWSTD_NO_POD_ZERO_INIT) + +memset (pdata, 0, sizeof *pdata); + +#endif // _RWSTD_NO_POD_ZERO_INIT + +pdata-_C_fire = pfire; + +return pdata; +} +_CATCH (...) { +return 0; +} +} + + +/* static */ void +ios_base::_C_usr_data::_C_dealloc (_C_usr_data *ptr) +{ +if (ptr) { +operator delete (ptr-_C_iarray); +operator delete (ptr-_C_parray); +operator delete (ptr-_C_cbarray); + +if ( ptr != _C_usr_data::_C_std_usr_data + ptr != _C_usr_data::_C_std_usr_data + 1) +delete ptr; +} +} + + /* static */ int ios_base::xalloc () { // outlined to hide implementation details
svn commit: r778800 - /stdcxx/branches/4.2.x/src/num_put.cpp
Author: sebor Date: Tue May 26 17:05:35 2009 New Revision: 778800 URL: http://svn.apache.org/viewvc?rev=778800view=rev Log: 2009-05-26 Martin Sebor se...@apache.org STDCXX-1036 * src/num_put.cpp (__rw_dtoa): Called the unsigned overload of __rw_dtoa only once to avoid gcc 4.4 -Winline warning (and for a small efficiency gain). Modified: stdcxx/branches/4.2.x/src/num_put.cpp Modified: stdcxx/branches/4.2.x/src/num_put.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/num_put.cpp?rev=778800r1=778799r2=778800view=diff == --- stdcxx/branches/4.2.x/src/num_put.cpp (original) +++ stdcxx/branches/4.2.x/src/num_put.cpp Tue May 26 17:05:35 2009 @@ -153,7 +153,7 @@ const size_t len = begin - end; - memmove (buf, end, len); +memmove (buf, end, len); return len; } @@ -185,7 +185,7 @@ const size_t len = begin - end; - memmove (buf, end, len); +memmove (buf, end, len); return len; } @@ -194,13 +194,23 @@ static inline size_t __rw_dtoa (char *buf, _LLong i, unsigned flags) { +size_t n; + if (i 0) { +// prepend the minus sign and clear the showpos bit in flags +// and the sign bit in the number flags = ~_RWSTD_IOS_SHOWPOS; *buf++ = '-'; -return 1 + __rw_dtoa (buf, _RWSTD_STATIC_CAST (_ULLong, -i), flags); + +i = -i; + +// remember to add 1 for the minus sign +n = 1; } - -return __rw_dtoa (buf, _RWSTD_STATIC_CAST (_ULLong, i), flags); +else +n = 0; // no sign here + +return n + __rw_dtoa (buf, _RWSTD_STATIC_CAST (_ULLong, i), flags); } @@ -314,7 +324,7 @@ } -static inline size_t +static inline size_t __rw_dtoa (char *buf, unsigned long i, unsigned flags) { // get the maximum number of decimal digits for an unsigned long @@ -343,7 +353,7 @@ // move the contents of the buffer to the beginning const size_t len = begin - end; - memmove (buf, end, len); +memmove (buf, end, len); return len; } @@ -352,14 +362,23 @@ static inline size_t __rw_dtoa (char *buf, long i, unsigned flags) { +size_t n; + if (i 0) { +// prepend the minus sign and clear the showpos bit in flags +// and the sign bit in the number flags = ~_RWSTD_IOS_SHOWPOS; *buf++ = '-'; -return 1 + __rw_dtoa (buf, _RWSTD_STATIC_CAST (unsigned long, -i), - flags); + +i = -i; + +// remember to add 1 for the minus sign +n = 1; } - -return __rw_dtoa (buf, _RWSTD_STATIC_CAST (unsigned long, i), flags); +else +n = 0; // no sign here + +return n + __rw_dtoa (buf, _RWSTD_STATIC_CAST (unsigned long, i), flags); }
svn commit: r778803 - /stdcxx/branches/4.2.x/src/iso2022.cpp
Author: sebor Date: Tue May 26 17:15:07 2009 New Revision: 778803 URL: http://svn.apache.org/viewvc?rev=778803view=rev Log: 2009-05-26 Martin Sebor se...@apache.org STDCXX-1036 * src/iso2022.cpp (__rw_allocate_state): Outlined rarely called function to silence gcc 4.4 -Winline warnings: inlining failed: call is unlikely and code size would grow. Modified: stdcxx/branches/4.2.x/src/iso2022.cpp Modified: stdcxx/branches/4.2.x/src/iso2022.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/iso2022.cpp?rev=778803r1=778802r2=778803view=diff == --- stdcxx/branches/4.2.x/src/iso2022.cpp (original) +++ stdcxx/branches/4.2.x/src/iso2022.cpp Tue May 26 17:15:07 2009 @@ -1,6 +1,6 @@ /*** * - * rw_iso2022.cpp + * iso2022.cpp * * $Id$ * @@ -416,8 +416,8 @@ // returns an index in the array of state structures or -1 if none // is available; ISO-2022-JP and ISO-2022-JP-2 assume different // initializations -static inline -int __rw_allocate_state () +static inline int +__rw_allocate_state () { _RWSTD_MT_CLASS_GUARD (__rw_iso2022_state_t); @@ -434,8 +434,8 @@ // deallocates state and makes it available for future conversions // if `initial_only' is non-zero suceeds only if the `iso_state' // argument represents an initial shift state -static inline -void __rw_deallocate_state (__rw_iso2022_state_t iso_state, +static void +__rw_deallocate_state (__rw_iso2022_state_t iso_state, _RWSTD_MBSTATE_T state, bool initial_only) {
svn commit: r778845 - in /stdcxx/branches/4.3.x/src: iosdata.h iostore.cpp iso2022.cpp num_put.cpp
Author: sebor Date: Tue May 26 18:55:28 2009 New Revision: 778845 URL: http://svn.apache.org/viewvc?rev=778845view=rev Log: 2009-05-26 Martin Sebor se...@apache.org Merged revs 778780, 778800, and 778803 from 4.2.x. STDCXX-1036 * src/iosdata.h (ios_base::_C_usr_data::_C_alloc, ios_base::_C_usr_data::_C_dealloc): Moved functions from here... * src/iostore.cpp: ...to here and outlined to silence gcc 4.4 -Winline warnings. * src/num_put.cpp (__rw_dtoa): Called the unsigned overload of __rw_dtoa only once to avoid gcc 4.4 -Winline warning (and for a small efficiency gain). * src/iso2022.cpp (__rw_allocate_state): Outlined rarely called function to silence gcc 4.4 -Winline warnings: inlining failed: call is unlikely and code size would grow. Modified: stdcxx/branches/4.3.x/src/iosdata.h stdcxx/branches/4.3.x/src/iostore.cpp stdcxx/branches/4.3.x/src/iso2022.cpp stdcxx/branches/4.3.x/src/num_put.cpp Modified: stdcxx/branches/4.3.x/src/iosdata.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/iosdata.h?rev=778845r1=778844r2=778845view=diff == --- stdcxx/branches/4.3.x/src/iosdata.h (original) +++ stdcxx/branches/4.3.x/src/iosdata.h Tue May 26 18:55:28 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. * **/ @@ -30,8 +30,6 @@ #define _RWSTD_IOSDATA_H_INCLUDED -#include string.h - #include rw/_iosbase.h #include rw/_defs.h @@ -68,66 +66,6 @@ static _C_usr_data _C_std_usr_data [2]; }; - -inline /* static */ ios_base::_C_usr_data* -ios_base::_C_usr_data::_C_alloc (_C_fire_fun pfire) -{ -_TRY { -// rely on 0-initialization of PODs -_C_usr_data* const pdata = new _C_usr_data (); - -#ifdef _RWSTD_NO_NEW_THROWS - -if (!pdata) -return 0; - -#endif // _RWSTD_NO_NEW_THROWS - -_RWSTD_ASSERT (0 != pdata); - -#ifndef _RWSTD_NO_POD_ZERO_INIT - -// assert that the POD ctor above zeroed out all members -_RWSTD_ASSERT (!pdata-_C_tie); -_RWSTD_ASSERT (!pdata-_C_iarray); -_RWSTD_ASSERT (!pdata-_C_parray); -_RWSTD_ASSERT (!pdata-_C_cbarray); -_RWSTD_ASSERT (!pdata-_C_isize); -_RWSTD_ASSERT (!pdata-_C_psize); -_RWSTD_ASSERT (!pdata-_C_cbsize); - -#else // if defined (_RWSTD_NO_POD_ZERO_INIT) - -memset (pdata, 0, sizeof *pdata); - -#endif // _RWSTD_NO_POD_ZERO_INIT - -pdata-_C_fire = pfire; - -return pdata; -} -_CATCH (...) { -return 0; -} -} - - -inline /* static */ void -ios_base::_C_usr_data::_C_dealloc (_C_usr_data *ptr) -{ -if (ptr) { -operator delete (ptr-_C_iarray); -operator delete (ptr-_C_parray); -operator delete (ptr-_C_cbarray); - -if ( ptr != _C_usr_data::_C_std_usr_data - ptr != _C_usr_data::_C_std_usr_data + 1) -delete ptr; -} -} - - } // namespace std - #endif // _RWSTD_IOSDATA_H_INCLUDED Modified: stdcxx/branches/4.3.x/src/iostore.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/iostore.cpp?rev=778845r1=778844r2=778845view=diff == --- stdcxx/branches/4.3.x/src/iostore.cpp (original) +++ stdcxx/branches/4.3.x/src/iostore.cpp Tue May 26 18:55:28 2009 @@ -84,6 +84,64 @@ _RWSTD_NAMESPACE (std) { +/* static */ ios_base::_C_usr_data* +ios_base::_C_usr_data::_C_alloc (_C_fire_fun pfire) +{ +_TRY { +// rely on zero-initialization of PODs +_C_usr_data* const pdata = new _C_usr_data (); + +#ifdef _RWSTD_NO_NEW_THROWS + +if (!pdata) +return 0; + +#endif // _RWSTD_NO_NEW_THROWS + +_RWSTD_ASSERT (0 != pdata); + +#ifndef _RWSTD_NO_POD_ZERO_INIT + +// assert that the POD ctor above zeroed out all members +_RWSTD_ASSERT (!pdata-_C_tie); +_RWSTD_ASSERT (!pdata-_C_iarray); +_RWSTD_ASSERT (!pdata-_C_parray); +_RWSTD_ASSERT (!pdata-_C_cbarray); +_RWSTD_ASSERT (!pdata-_C_isize); +_RWSTD_ASSERT (!pdata-_C_psize); +_RWSTD_ASSERT (!pdata-_C_cbsize); + +#else // if defined (_RWSTD_NO_POD_ZERO_INIT) + +memset (pdata, 0, sizeof *pdata); + +#endif // _RWSTD_NO_POD_ZERO_INIT + +pdata-_C_fire = pfire; + +return pdata; +} +_CATCH (...) { +return 0; +} +} + + +/* static */ void +ios_base::_C_usr_data::_C_dealloc (_C_usr_data *ptr) +{ +if (ptr) { +operator delete (ptr-_C_iarray); +operator delete (ptr-_C_parray); +operator delete (ptr-_C_cbarray
svn commit: r763018 - /stdcxx/branches/4.2.x/doc/stdlibug/14-3.html
Author: sebor Date: Tue Apr 7 22:37:23 2009 New Revision: 763018 URL: http://svn.apache.org/viewvc?rev=763018view=rev Log: 2009-04-07 Martin Sebor se...@apache.org STDCXX-1033 * doc/stdlibug/14-3.html: Corrected a typo. Modified: stdcxx/branches/4.2.x/doc/stdlibug/14-3.html Modified: stdcxx/branches/4.2.x/doc/stdlibug/14-3.html URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/doc/stdlibug/14-3.html?rev=763018r1=763017r2=763018view=diff == --- stdcxx/branches/4.2.x/doc/stdlibug/14-3.html (original) +++ stdcxx/branches/4.2.x/doc/stdlibug/14-3.html Tue Apr 7 22:37:23 2009 @@ -44,8 +44,8 @@ [, Compare ] ); } /PRE/UL -PFollowing the call on SAMPstd::nth_element()/SAMP, the nth largest value is copied into the position denoted by the middle BIA HREF=../stdlibref/iterator.htmliterator/A/I/B. The region between the first BIiterator/I/B and the middle iterator will have values no larger than the nth element, while the region between the middle BIiterator/I/B and the end will hold values no smaller than the nth element./P -PThe example program illustrates finding the fifth largest value in a BIA HREF=../stdlibref/vector.htmlvector/A/I/B of random numbers./P +PFollowing the call on SAMPstd::nth_element()/SAMP, the nth smallest value (as determined by the optional SAMPCompare/SAMP predicate, or by SAMPstd::less/SAMP, when none is specified) is copied into the position denoted by the middle BIA HREF=../stdlibref/iterator.htmliterator/A/I/B. The region between the first BIiterator/I/B and the middle iterator will have values no larger than the nth element, while the region between the middle BIiterator/I/B and the end will hold values no smaller than the nth element./P +PThe example program illustrates finding the fifth smallest value in a BIA HREF=../stdlibref/vector.htmlvector/A/I/B of random numbers./P A NAME=idx355!/A ULPRE @@ -57,11 +57,11 @@ std::vectorlt;intgt; aVec(10); std::generate(aVec.begin(), aVec.end(), randomValue); - // now find the 5th largest + // now find the 5th smallest value std::vectorlt;intgt;::iterator nth = aVec.begin() + 4; std::nth_element(aVec.begin(), nth, aVec.end()); - std::cout lt;lt; fifth largest is lt;lt; *nth lt;lt; std::endl; + std::cout lt;lt; fifth smallest is lt;lt; *nth lt;lt; std::endl; } /PRE/UL
svn commit: r763020 - /stdcxx/branches/4.3.x/doc/stdlibug/14-3.html
Author: sebor Date: Tue Apr 7 22:46:46 2009 New Revision: 763020 URL: http://svn.apache.org/viewvc?rev=763020view=rev Log: 2009-04-07 Martin Sebor se...@apache.org STDCXX-1033 * doc/stdlibug/14-3.html: Corrected a typo. Modified: stdcxx/branches/4.3.x/doc/stdlibug/14-3.html (contents, props changed) Modified: stdcxx/branches/4.3.x/doc/stdlibug/14-3.html URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/doc/stdlibug/14-3.html?rev=763020r1=763019r2=763020view=diff == --- stdcxx/branches/4.3.x/doc/stdlibug/14-3.html (original) +++ stdcxx/branches/4.3.x/doc/stdlibug/14-3.html Tue Apr 7 22:46:46 2009 @@ -44,8 +44,8 @@ [, Compare ] ); } /PRE/UL -PFollowing the call on SAMPstd::nth_element()/SAMP, the nth largest value is copied into the position denoted by the middle BIA HREF=../stdlibref/iterator.htmliterator/A/I/B. The region between the first BIiterator/I/B and the middle iterator will have values no larger than the nth element, while the region between the middle BIiterator/I/B and the end will hold values no smaller than the nth element./P -PThe example program illustrates finding the fifth largest value in a BIA HREF=../stdlibref/vector.htmlvector/A/I/B of random numbers./P +PFollowing the call on SAMPstd::nth_element()/SAMP, the nth smallest value (as determined by the optional SAMPCompare/SAMP predicate, or by SAMPstd::less/SAMP, when none is specified) is copied into the position denoted by the middle BIA HREF=../stdlibref/iterator.htmliterator/A/I/B. The region between the first BIiterator/I/B and the middle iterator will have values no larger than the nth element, while the region between the middle BIiterator/I/B and the end will hold values no smaller than the nth element./P +PThe example program illustrates finding the fifth smallest value in a BIA HREF=../stdlibref/vector.htmlvector/A/I/B of random numbers./P A NAME=idx355!/A ULPRE @@ -57,11 +57,11 @@ std::vectorlt;intgt; aVec(10); std::generate(aVec.begin(), aVec.end(), randomValue); - // now find the 5th largest + // now find the 5th smallest value std::vectorlt;intgt;::iterator nth = aVec.begin() + 4; std::nth_element(aVec.begin(), nth, aVec.end()); - std::cout lt;lt; fifth largest is lt;lt; *nth lt;lt; std::endl; + std::cout lt;lt; fifth smallest is lt;lt; *nth lt;lt; std::endl; } /PRE/UL Propchange: stdcxx/branches/4.3.x/doc/stdlibug/14-3.html -- svn:mergeinfo = /stdcxx/branches/4.2.x/doc/stdlibug/14-3.html:763018
svn commit: r763021 - /stdcxx/trunk/doc/stdlibug/14-3.html
Author: sebor Date: Tue Apr 7 22:46:58 2009 New Revision: 763021 URL: http://svn.apache.org/viewvc?rev=763021view=rev Log: 2009-04-07 Martin Sebor se...@apache.org STDCXX-1033 * doc/stdlibug/14-3.html: Corrected a typo. Modified: stdcxx/trunk/doc/stdlibug/14-3.html (contents, props changed) Modified: stdcxx/trunk/doc/stdlibug/14-3.html URL: http://svn.apache.org/viewvc/stdcxx/trunk/doc/stdlibug/14-3.html?rev=763021r1=763020r2=763021view=diff == --- stdcxx/trunk/doc/stdlibug/14-3.html (original) +++ stdcxx/trunk/doc/stdlibug/14-3.html Tue Apr 7 22:46:58 2009 @@ -44,8 +44,8 @@ [, Compare ] ); } /PRE/UL -PFollowing the call on SAMPstd::nth_element()/SAMP, the nth largest value is copied into the position denoted by the middle BIA HREF=../stdlibref/iterator.htmliterator/A/I/B. The region between the first BIiterator/I/B and the middle iterator will have values no larger than the nth element, while the region between the middle BIiterator/I/B and the end will hold values no smaller than the nth element./P -PThe example program illustrates finding the fifth largest value in a BIA HREF=../stdlibref/vector.htmlvector/A/I/B of random numbers./P +PFollowing the call on SAMPstd::nth_element()/SAMP, the nth smallest value (as determined by the optional SAMPCompare/SAMP predicate, or by SAMPstd::less/SAMP, when none is specified) is copied into the position denoted by the middle BIA HREF=../stdlibref/iterator.htmliterator/A/I/B. The region between the first BIiterator/I/B and the middle iterator will have values no larger than the nth element, while the region between the middle BIiterator/I/B and the end will hold values no smaller than the nth element./P +PThe example program illustrates finding the fifth smallest value in a BIA HREF=../stdlibref/vector.htmlvector/A/I/B of random numbers./P A NAME=idx355!/A ULPRE @@ -57,11 +57,11 @@ std::vectorlt;intgt; aVec(10); std::generate(aVec.begin(), aVec.end(), randomValue); - // now find the 5th largest + // now find the 5th smallest value std::vectorlt;intgt;::iterator nth = aVec.begin() + 4; std::nth_element(aVec.begin(), nth, aVec.end()); - std::cout lt;lt; fifth largest is lt;lt; *nth lt;lt; std::endl; + std::cout lt;lt; fifth smallest is lt;lt; *nth lt;lt; std::endl; } /PRE/UL Propchange: stdcxx/trunk/doc/stdlibug/14-3.html -- svn:mergeinfo = /stdcxx/branches/4.2.x/doc/stdlibug/14-3.html:763018
svn commit: r746865 - /stdcxx/branches/4.2.x/src/atomic-cxx.S
Author: sebor Date: Mon Feb 23 03:10:07 2009 New Revision: 746865 URL: http://svn.apache.org/viewvc?rev=746865view=rev Log: 2009-02-22 Martin Sebor se...@apache.org * src/atomic-cxx.S: Fixed a typo in a comment. Modified: stdcxx/branches/4.2.x/src/atomic-cxx.S Modified: stdcxx/branches/4.2.x/src/atomic-cxx.S URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/atomic-cxx.S?rev=746865r1=746864r2=746865view=diff == --- stdcxx/branches/4.2.x/src/atomic-cxx.S (original) +++ stdcxx/branches/4.2.x/src/atomic-cxx.S Mon Feb 23 03:10:07 2009 @@ -1,6 +1,6 @@ /*** * - * atomic.S + * atomic-cxx.S * * $Id$ * @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 2003-2006 Rogue Wave Software. + * Copyright 2003-2006 Rogue Wave Software, Inc. * **/
svn commit: r746867 - /stdcxx/trunk/src/atomic-cxx.S
Author: sebor Date: Mon Feb 23 03:12:37 2009 New Revision: 746867 URL: http://svn.apache.org/viewvc?rev=746867view=rev Log: 2009-02-22 Martin Sebor se...@apache.org * src/atomic-cxx.S: Merged rev 746865 from 4.2.x. Modified: stdcxx/trunk/src/atomic-cxx.S (contents, props changed) Modified: stdcxx/trunk/src/atomic-cxx.S URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/atomic-cxx.S?rev=746867r1=746866r2=746867view=diff == --- stdcxx/trunk/src/atomic-cxx.S (original) +++ stdcxx/trunk/src/atomic-cxx.S Mon Feb 23 03:12:37 2009 @@ -1,6 +1,6 @@ /*** * - * atomic.S + * atomic-cxx.S * * $Id$ * @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 2003-2006 Rogue Wave Software. + * Copyright 2003-2006 Rogue Wave Software, Inc. * **/ Propchange: stdcxx/trunk/src/atomic-cxx.S -- svn:mergeinfo = /stdcxx/branches/4.2.x/src/atomic-cxx.S:746865
svn commit: r744581 - in /stdcxx/branches/4.2.x: etc/config/src/UNISTD_DECL.cpp src/file.cpp src/locale_core.cpp src/mman.cpp src/setlocale.cpp tests/src/file.cpp tests/src/locale.cpp
Author: sebor Date: Sat Feb 14 22:54:58 2009 New Revision: 744581 URL: http://svn.apache.org/viewvc?rev=744581view=rev Log: 2009-02-14 Martin Sebor se...@roguewave.com STDCXX-1029 * etc/config/src/UNISTD_DECL.cpp: Reverted rev 731368 using the 'svn merge -r731368:731367 .' command. * src/setlocale.cpp: Reverted rev 731371. * src/locale_core.cpp: Same. * src/mman.cpp: Same. * src/file.cpp: Same. * tests/src/file.cpp: Reverted 731374. * tests/src/locale.cpp: Same. Modified: stdcxx/branches/4.2.x/etc/config/src/UNISTD_DECL.cpp stdcxx/branches/4.2.x/src/file.cpp stdcxx/branches/4.2.x/src/locale_core.cpp stdcxx/branches/4.2.x/src/mman.cpp stdcxx/branches/4.2.x/src/setlocale.cpp stdcxx/branches/4.2.x/tests/src/file.cpp stdcxx/branches/4.2.x/tests/src/locale.cpp Modified: stdcxx/branches/4.2.x/etc/config/src/UNISTD_DECL.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/src/UNISTD_DECL.cpp?rev=744581r1=744580r2=744581view=diff == --- stdcxx/branches/4.2.x/etc/config/src/UNISTD_DECL.cpp (original) +++ stdcxx/branches/4.2.x/etc/config/src/UNISTD_DECL.cpp Sat Feb 14 22:54:58 2009 @@ -24,12 +24,6 @@ #include config.h -#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ - // work around gcc bug 37405 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 -# define __wur /* empty */ -#endif // gcc 4.3 on Linux - #include sys/types.h #include fcntl.h #include stdio.h Modified: stdcxx/branches/4.2.x/src/file.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/file.cpp?rev=744581r1=744580r2=744581view=diff == --- stdcxx/branches/4.2.x/src/file.cpp (original) +++ stdcxx/branches/4.2.x/src/file.cpp Sat Feb 14 22:54:58 2009 @@ -37,12 +37,6 @@ # define _RWSTD_NO_DEPRECATED_C_HEADERS #endif // _RWSTD_NO_DEPRECATED_C_HEADERS -#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ - // work around gcc bug 37405 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 -# define __wur /* empty */ -#endif // gcc 4.3 on Linux - #include errno.h// for ENAMETOOLONG, ERANGE, errno #include stddef.h // for ptrdiff_t #include stdio.h// for P_tmpdir, std{err,in,out}, remove(), tmpnam() Modified: stdcxx/branches/4.2.x/src/locale_core.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/locale_core.cpp?rev=744581r1=744580r2=744581view=diff == --- stdcxx/branches/4.2.x/src/locale_core.cpp (original) +++ stdcxx/branches/4.2.x/src/locale_core.cpp Sat Feb 14 22:54:58 2009 @@ -30,12 +30,6 @@ #include rw/_defs.h -#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ - // work around gcc bug 37405 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 -# define __wur /* empty */ -#endif // gcc 4.3 on Linux - #ifdef __SUNPRO_CC // working around SunPro bug 568 # include time.h Modified: stdcxx/branches/4.2.x/src/mman.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/mman.cpp?rev=744581r1=744580r2=744581view=diff == --- stdcxx/branches/4.2.x/src/mman.cpp (original) +++ stdcxx/branches/4.2.x/src/mman.cpp Sat Feb 14 22:54:58 2009 @@ -29,12 +29,6 @@ #define _RWSTD_LIB_SRC #include rw/_defs.h -#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ - // work around gcc bug 37405 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 -# define __wur /* empty */ -#endif // gcc 4.3 on Linux - #ifndef _MSC_VER // unistd.h is included here because of PR #26255 # include unistd.h Modified: stdcxx/branches/4.2.x/src/setlocale.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/setlocale.cpp?rev=744581r1=744580r2=744581view=diff == --- stdcxx/branches/4.2.x/src/setlocale.cpp (original) +++ stdcxx/branches/4.2.x/src/setlocale.cpp Sat Feb 14 22:54:58 2009 @@ -33,12 +33,6 @@ #include rw/_defs.h -#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ - // work around gcc bug 37405 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 -# define __wur /* empty */ -#endif // gcc 4.3 on Linux - #if defined (__linux__) !defined (_XOPEN_SOURCE) // need S_IFDIR on Linux # define _XOPEN_SOURCE Modified: stdcxx/branches/4.2.x/tests/src/file.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/file.cpp?rev=744581r1=744580r2=744581view=diff == --- stdcxx/branches/4.2.x/tests/src/file.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/file.cpp Sat Feb 14 22:54:58 2009 @@ -32,12 +32,6 @@ #include rw_file.h
svn propchange: r744581 - svn:log
Author: sebor Revision: 744581 Modified property: svn:log Modified: svn:log at Sat Feb 14 23:33:53 2009 -- --- svn:log (original) +++ svn:log Sat Feb 14 23:33:53 2009 @@ -1,4 +1,4 @@ -2009-02-14 Martin Sebor se...@roguewave.com +2009-02-14 Martin Sebor se...@apache.org STDCXX-1029 * etc/config/src/UNISTD_DECL.cpp: Reverted rev 731368 using
svn commit: r731371 - in /stdcxx/branches/4.2.x/src: file.cpp locale_core.cpp mman.cpp setlocale.cpp
Author: sebor Date: Sun Jan 4 13:46:02 2009 New Revision: 731371 URL: http://svn.apache.org/viewvc?rev=731371view=rev Log: 2009-01-04 Martin Sebor se...@apache.org STDCXX-1029 * src/file.cpp [__linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__] (__wur): #defined to an empty comment to work around gcc 4.3.1 bug 37405: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 * src/locale_core.cpp: Ditto. * src/setlocale.cpp: Ditto. * src/mman.cpp: Ditto. Modified: stdcxx/branches/4.2.x/src/file.cpp stdcxx/branches/4.2.x/src/locale_core.cpp stdcxx/branches/4.2.x/src/mman.cpp stdcxx/branches/4.2.x/src/setlocale.cpp Modified: stdcxx/branches/4.2.x/src/file.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/file.cpp?rev=731371r1=731370r2=731371view=diff == --- stdcxx/branches/4.2.x/src/file.cpp (original) +++ stdcxx/branches/4.2.x/src/file.cpp Sun Jan 4 13:46:02 2009 @@ -37,6 +37,12 @@ # define _RWSTD_NO_DEPRECATED_C_HEADERS #endif // _RWSTD_NO_DEPRECATED_C_HEADERS +#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ + // work around gcc bug 37405 + // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 +# define __wur /* empty */ +#endif // gcc 4.3 on Linux + #include errno.h// for ENAMETOOLONG, ERANGE, errno #include stddef.h // for ptrdiff_t #include stdio.h// for P_tmpdir, std{err,in,out}, remove(), tmpnam() Modified: stdcxx/branches/4.2.x/src/locale_core.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/locale_core.cpp?rev=731371r1=731370r2=731371view=diff == --- stdcxx/branches/4.2.x/src/locale_core.cpp (original) +++ stdcxx/branches/4.2.x/src/locale_core.cpp Sun Jan 4 13:46:02 2009 @@ -30,6 +30,12 @@ #include rw/_defs.h +#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ + // work around gcc bug 37405 + // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 +# define __wur /* empty */ +#endif // gcc 4.3 on Linux + #ifdef __SUNPRO_CC // working around SunPro bug 568 # include time.h Modified: stdcxx/branches/4.2.x/src/mman.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/mman.cpp?rev=731371r1=731370r2=731371view=diff == --- stdcxx/branches/4.2.x/src/mman.cpp (original) +++ stdcxx/branches/4.2.x/src/mman.cpp Sun Jan 4 13:46:02 2009 @@ -29,6 +29,12 @@ #define _RWSTD_LIB_SRC #include rw/_defs.h +#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ + // work around gcc bug 37405 + // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 +# define __wur /* empty */ +#endif // gcc 4.3 on Linux + #ifndef _MSC_VER // unistd.h is included here because of PR #26255 # include unistd.h Modified: stdcxx/branches/4.2.x/src/setlocale.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/setlocale.cpp?rev=731371r1=731370r2=731371view=diff == --- stdcxx/branches/4.2.x/src/setlocale.cpp (original) +++ stdcxx/branches/4.2.x/src/setlocale.cpp Sun Jan 4 13:46:02 2009 @@ -1,6 +1,6 @@ /*** * - * rw_setlocale.cpp - implementation of the __rw_setlocale class + * setlocale.cpp - implementation of the __rw_setlocale class * * This is an internal header file used to implement the C++ Standard * Library. It should never be #included directly by a program. @@ -25,7 +25,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. * **/ @@ -33,6 +33,12 @@ #include rw/_defs.h +#if defined __linux__ 4 == __GNUC__ 3 == __GNUC_MINOR__ + // work around gcc bug 37405 + // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37405 +# define __wur /* empty */ +#endif // gcc 4.3 on Linux + #if defined (__linux__) !defined (_XOPEN_SOURCE) // need S_IFDIR on Linux # define _XOPEN_SOURCE
svn commit: r731135 - in /stdcxx/branches/4.2.x: examples/tutorial/alg3.cpp include/iomanip
Author: sebor Date: Sat Jan 3 16:18:32 2009 New Revision: 731135 URL: http://svn.apache.org/viewvc?rev=731135view=rev Log: 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. Modified: stdcxx/branches/4.2.x/examples/tutorial/alg3.cpp stdcxx/branches/4.2.x/include/iomanip Modified: stdcxx/branches/4.2.x/examples/tutorial/alg3.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/examples/tutorial/alg3.cpp?rev=731135r1=731134r2=731135view=diff == --- stdcxx/branches/4.2.x/examples/tutorial/alg3.cpp (original) +++ stdcxx/branches/4.2.x/examples/tutorial/alg3.cpp Sat Jan 3 16:18:32 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.2.x/include/iomanip URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/iomanip?rev=731135r1=731134r2=731135view=diff == --- stdcxx/branches/4.2.x/include/iomanip (original) +++ stdcxx/branches/4.2.x/include/iomanip Sat Jan 3 16:18:32 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));
svn commit: r731136 - in /stdcxx/branches/4.2.x/include: algorithm algorithm.cc rw/_tree.cc
Author: sebor Date: Sat Jan 3 16:19:35 2009 New Revision: 731136 URL: http://svn.apache.org/viewvc?rev=731136view=rev Log: 2009-01-03 Martin Sebor se...@roguewave.com * include/rw/_tree.cc [_RWSTDDEBUG](__rb_tree::insert, __rb_tree::erase): Rewrote a for loop to silence gcc warning: suggest a space before ‘;’ or explicit braces around empty body in ‘for’ statement. * include/algorithm (find, find_if): Same. * include/algorithm.cc (__unguarded_partition, next_permutation, prev_permutation): Rewrote a while loop to silence said gcc warning. Modified: stdcxx/branches/4.2.x/include/algorithm stdcxx/branches/4.2.x/include/algorithm.cc stdcxx/branches/4.2.x/include/rw/_tree.cc Modified: stdcxx/branches/4.2.x/include/algorithm URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/algorithm?rev=731136r1=731135r2=731136view=diff == --- stdcxx/branches/4.2.x/include/algorithm (original) +++ stdcxx/branches/4.2.x/include/algorithm Sat Jan 3 16:19:35 2009 @@ -93,7 +93,8 @@ { _RWSTD_ASSERT_RANGE (__first, __last); -for (; !(__first == __last) !(*__first == __val); ++__first); +while (!(__first == __last) !(*__first == __val)) +++__first; return __first; } @@ -105,7 +106,8 @@ { _RWSTD_ASSERT_RANGE (__first, __last); -for (; !(__first == __last) __pred (*__first) == false; ++__first); +while (!(__first == __last) __pred (*__first) == false) +++__first; return __first; } Modified: stdcxx/branches/4.2.x/include/algorithm.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/algorithm.cc?rev=731136r1=731135r2=731136view=diff == --- stdcxx/branches/4.2.x/include/algorithm.cc (original) +++ stdcxx/branches/4.2.x/include/algorithm.cc Sat Jan 3 16:19:35 2009 @@ -791,9 +791,10 @@ _RWSTD_ASSERT_RANGE (__first, __last); for ( ; ; ++__first) { -for (; __comp (*__first, __pivot); ++__first); +while (__comp (*__first, __pivot)) +++__first; -while (__comp (__pivot, *--__last)); +while (__comp (__pivot, *--__last)) { /* no-op */ } if (!(__first __last)) return __first; @@ -1826,7 +1827,7 @@ _BidirIter __j = __last; -while (__comp (*__i, *--__j) == false); +while (__comp (*__i, *--__j) == false) { /* no-op */ } _STD::iter_swap (__i, __j); @@ -1870,7 +1871,7 @@ _BidirIter __j = __last; -while (__comp (*--__j, *__i) == false); +while (__comp (*--__j, *__i) == false) { /* no-op */ } _STD::iter_swap (__i, __j); Modified: stdcxx/branches/4.2.x/include/rw/_tree.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_tree.cc?rev=731136r1=731135r2=731136view=diff == --- stdcxx/branches/4.2.x/include/rw/_tree.cc (original) +++ stdcxx/branches/4.2.x/include/rw/_tree.cc Sat Jan 3 16:19:35 2009 @@ -338,7 +338,8 @@ { // verify the consistency of the tree size_type __two_logN = 0; -for (size_type __i = size () + 1; __i = 1; ++__two_logN); +for (size_type __i = size () + 1; __i = 1; ) +++__two_logN; __two_logN *= 2; @@ -408,7 +409,8 @@ { // verify the consistency of the tree size_type __two_logN = 0; -for (size_type __i = size () + 1; __i = 1; ++__two_logN); +for (size_type __i = size () + 1; __i = 1; ) +++__two_logN; __two_logN *= 2; @@ -844,7 +846,8 @@ // return end() __tmp = end (); } else -for (__tmp = end (); !(__first == __last); __tmp = erase (__first++)); +for (__tmp = end (); !(__first == __last); __tmp = erase (__first)) +++__first; return __tmp; }
svn commit: r725458 - in /stdcxx/branches/4.3.x: include/streambuf.cc tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp
Author: sebor Date: Wed Dec 10 14:08:12 2008 New Revision: 725458 URL: http://svn.apache.org/viewvc?rev=725458view=rev Log: 2008-12-10 Martin Sebor [EMAIL PROTECTED] Merged revs 723461 and 723465 from 4.2.x. 2008-12-04 Martin Sebor [EMAIL PROTECTED] STDCXX-1026 * include/streambuf.cc (basic_streambuf::xsgetn): Removed assumption that empty get area implies empty pending sequence. * tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp: New test. 2008-12-04 Martin Sebor [EMAIL PROTECTED] * streambuf.cc (basic_streambuf::uflow): Reverted _TYPENAME to typename change inadvertently introduced in rev 723461. Added: stdcxx/branches/4.3.x/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp (with props) Modified: stdcxx/branches/4.3.x/include/streambuf.cc Modified: stdcxx/branches/4.3.x/include/streambuf.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/streambuf.cc?rev=725458r1=725457r2=725458view=diff == --- stdcxx/branches/4.3.x/include/streambuf.cc (original) +++ stdcxx/branches/4.3.x/include/streambuf.cc Wed Dec 10 14:08:12 2008 @@ -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. * **/ @@ -90,23 +90,35 @@ // number of characters available in get area streamsize __navail = egptr () - gptr (); -if (0 == __navail) -break; - -if (__navail __n) -__navail = __n; - -// copy contents of get area to the destination buffer -traits_type::copy (__buf + __nget, gptr (), __navail); - -// increment pointers and counts by the number of characters copied -gbump (__navail); -__n-= __navail; -__nget += __navail; - -// break out on underflow error -if (traits_type::eq_int_type (__c, traits_type::eof ())) +if (0 __navail) { +if (__navail __n) +__navail = __n; + +// copy contents of get area to the destination buffer +traits_type::copy (__buf + __nget, gptr (), __navail); + +// increment pointers and counts by the number of characters +// copied +gbump (__navail); +__n-= __navail; +__nget += __navail; +} +else if (traits_type::eq_int_type (__c, traits_type::eof ())) { +// break out on underflow() failure (e.g., reaching EOF) break; +} +else { +// unbuffered mode: empty pending seuqence but non-EOF +// overflow() return value + +// append character returned by underflow() +traits_type::assign (__buf [__nget], + traits_type::to_char_type (__c)); + +// avoid incrementing egptr() but adjust counters +--__n; +++__nget; +} } return __nget; Added: stdcxx/branches/4.3.x/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp?rev=725458view=auto == --- stdcxx/branches/4.3.x/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp (added) +++ stdcxx/branches/4.3.x/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp Wed Dec 10 14:08:12 2008 @@ -0,0 +1,58 @@ +/ + * + * 27.streambuf.sgetn.stdcxx-1026.cpp - regression test for STDCXX-1026 + * + * http://issues.apache.org/jira/browse/STDCXX-1026 + * + * $Id$ + * + *** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + **/ + +#include cassert +#include
svn commit: r725460 - in /stdcxx/trunk: include/streambuf.cc tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp
Author: sebor Date: Wed Dec 10 14:11:41 2008 New Revision: 725460 URL: http://svn.apache.org/viewvc?rev=725460view=rev Log: 2008-12-10 Martin Sebor [EMAIL PROTECTED] Merged rev 723461 and 723465 from 4.2.x. 2008-12-04 Martin Sebor [EMAIL PROTECTED] STDCXX-1026 * include/streambuf.cc (basic_streambuf::xsgetn): Removed assumption that empty get area implies empty pending sequence. * tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp: New test. 2008-12-04 Martin Sebor [EMAIL PROTECTED] * streambuf.cc (basic_streambuf::uflow): Reverted _TYPENAME to typename change inadvertently introduced in rev 723461. Added: stdcxx/trunk/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp (with props) Modified: stdcxx/trunk/include/streambuf.cc Modified: stdcxx/trunk/include/streambuf.cc URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/streambuf.cc?rev=725460r1=725459r2=725460view=diff == --- stdcxx/trunk/include/streambuf.cc (original) +++ stdcxx/trunk/include/streambuf.cc Wed Dec 10 14:11:41 2008 @@ -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. * **/ @@ -90,23 +90,35 @@ // number of characters available in get area streamsize __navail = egptr () - gptr (); -if (0 == __navail) -break; - -if (__navail __n) -__navail = __n; - -// copy contents of get area to the destination buffer -traits_type::copy (__buf + __nget, gptr (), __navail); - -// increment pointers and counts by the number of characters copied -gbump (__navail); -__n-= __navail; -__nget += __navail; - -// break out on underflow error -if (traits_type::eq_int_type (__c, traits_type::eof ())) +if (0 __navail) { +if (__navail __n) +__navail = __n; + +// copy contents of get area to the destination buffer +traits_type::copy (__buf + __nget, gptr (), __navail); + +// increment pointers and counts by the number of characters +// copied +gbump (__navail); +__n-= __navail; +__nget += __navail; +} +else if (traits_type::eq_int_type (__c, traits_type::eof ())) { +// break out on underflow() failure (e.g., reaching EOF) break; +} +else { +// unbuffered mode: empty pending seuqence but non-EOF +// overflow() return value + +// append character returned by underflow() +traits_type::assign (__buf [__nget], + traits_type::to_char_type (__c)); + +// avoid incrementing egptr() but adjust counters +--__n; +++__nget; +} } return __nget; Added: stdcxx/trunk/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp?rev=725460view=auto == --- stdcxx/trunk/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp (added) +++ stdcxx/trunk/tests/regress/27.streambuf.sgetn.stdcxx-1026.cpp Wed Dec 10 14:11:41 2008 @@ -0,0 +1,58 @@ +/ + * + * 27.streambuf.sgetn.stdcxx-1026.cpp - regression test for STDCXX-1026 + * + * http://issues.apache.org/jira/browse/STDCXX-1026 + * + * $Id$ + * + *** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + **/ + +#include cassert +#include istream +#include streambuf + +int main () +{ +static int x = '0'; + +struct: std
svn commit: r723465 - /stdcxx/branches/4.2.x/include/streambuf.cc
Author: sebor Date: Thu Dec 4 14:06:42 2008 New Revision: 723465 URL: http://svn.apache.org/viewvc?rev=723465view=rev Log: 2008-12-04 Martin Sebor [EMAIL PROTECTED] * streambuf.cc (basic_streambuf::uflow): Reverted _TYPENAME to typename change inadvertently introduced in rev 723461. Modified: stdcxx/branches/4.2.x/include/streambuf.cc Modified: stdcxx/branches/4.2.x/include/streambuf.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/streambuf.cc?rev=723465r1=723464r2=723465view=diff == --- stdcxx/branches/4.2.x/include/streambuf.cc (original) +++ stdcxx/branches/4.2.x/include/streambuf.cc Thu Dec 4 14:06:42 2008 @@ -50,7 +50,7 @@ template class _CharT, class _Traits -typename basic_streambuf_CharT, _Traits::int_type +_TYPENAME basic_streambuf_CharT, _Traits::int_type basic_streambuf_CharT, _Traits:: uflow () {
svn commit: r720080 - /stdcxx/branches/4.2.x/doc/stdlibref/ios-base.html
Author: sebor Date: Sun Nov 23 17:04:36 2008 New Revision: 720080 URL: http://svn.apache.org/viewvc?rev=720080view=rev Log: 2008-11-23 Martin Sebor [EMAIL PROTECTED] STDCXX-1025 * doc/stdlibref/ios-base.html (ios_base::flags, ios_base::setf): Improved/corrected wording. (ios_base::unsetf, ios_base::setf): Moved up just below flags(). Modified: stdcxx/branches/4.2.x/doc/stdlibref/ios-base.html Modified: stdcxx/branches/4.2.x/doc/stdlibref/ios-base.html URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/doc/stdlibref/ios-base.html?rev=720080r1=720079r2=720080view=diff == --- stdcxx/branches/4.2.x/doc/stdlibref/ios-base.html (original) +++ stdcxx/branches/4.2.x/doc/stdlibref/ios-base.html Sun Nov 23 17:04:36 2008 @@ -390,7 +390,28 @@ A NAME=idx678/APREfmtflags Bflags/B(fmtflags fmtfl); /PRE UL -PSaves the format control information, then sets it to SAMPfmtfl/SAMP and returns the previously saved value./P +PSets SAMPflags()/SAMP to SAMPfmtfl/SAMP and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx686/APREfmtflags +Bsetf/B(fmtflags fmtfl); /PRE +UL +PSets SAMPflags()/SAMP to SAMP(fmtfl | flags())/SAMP and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx687/APREfmtflags +Bsetf/B(fmtflags fmtfl, fmtflags mask); /PRE +UL +PClears SAMPmask/SAMP in SAMPflags()/SAMP, sets SAMP(fmtfl amp; mask)/SAMP in SAMPflags()/SAMP, and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx689/APREvoid +Bunsetf/B(fmtflags mask); /PRE +UL +PClears SAMPmask/SAMP in SAMPflags()/SAMP./P /UL @@ -443,20 +464,6 @@ /UL -A NAME=idx686/APREfmtflags -Bsetf/B(fmtflags fmtfl); /PRE -UL -PSaves the format control information, then sets it to SAMPfmtfl/SAMP and returns the previously saved value./P -/UL - - -A NAME=idx687/APREfmtflags -Bsetf/B(fmtflags fmtfl, fmtflags mask); /PRE -UL -PSaves the format control information, then clears SAMPmask/SAMP in SAMPflags()/SAMP, sets SAMPfmtfl amp; mask in flags()/SAMP, and returns the previously saved value./P -/UL - - A NAME=idx688/APREbool Bsync_with_stdio/B(bool sync = true); /PRE UL @@ -464,13 +471,6 @@ /UL -A NAME=idx689/APREvoid -Bunsetf/B(fmtflags mask); /PRE -UL -PClears SAMPmask/SAMP in SAMPflags()/SAMP./P -/UL - - A NAME=idx690/APREstreamsize Bwidth/B() const; /PRE UL
svn propchange: r720080 - svn:log
Author: sebor Revision: 720080 Modified property: svn:log Modified: svn:log at Sun Nov 23 17:06:24 2008 -- --- svn:log (original) +++ svn:log Sun Nov 23 17:06:24 2008 @@ -1,4 +1,4 @@ -2008-11-23 Martin Sebor [EMAIL PROTECTED] +2008-11-23 Martin Sebor [EMAIL PROTECTED] STDCXX-1025 * doc/stdlibref/ios-base.html (ios_base::flags, ios_base::setf):
svn commit: r720082 - /stdcxx/branches/4.3.x/doc/stdlibref/ios-base.html
Author: sebor Date: Sun Nov 23 17:07:21 2008 New Revision: 720082 URL: http://svn.apache.org/viewvc?rev=720082view=rev Log: 2008-11-23 Martin Sebor [EMAIL PROTECTED] Merged rev 720080 from 4.2.x. 2008-11-23 Martin Sebor [EMAIL PROTECTED] STDCXX-1025 * doc/stdlibref/ios-base.html (ios_base::flags, ios_base::setf): Improved/corrected wording. (ios_base::unsetf, ios_base::setf): Moved up just below flags(). Modified: stdcxx/branches/4.3.x/doc/stdlibref/ios-base.html Modified: stdcxx/branches/4.3.x/doc/stdlibref/ios-base.html URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/doc/stdlibref/ios-base.html?rev=720082r1=720081r2=720082view=diff == --- stdcxx/branches/4.3.x/doc/stdlibref/ios-base.html (original) +++ stdcxx/branches/4.3.x/doc/stdlibref/ios-base.html Sun Nov 23 17:07:21 2008 @@ -390,7 +390,28 @@ A NAME=idx678/APREfmtflags Bflags/B(fmtflags fmtfl); /PRE UL -PSaves the format control information, then sets it to SAMPfmtfl/SAMP and returns the previously saved value./P +PSets SAMPflags()/SAMP to SAMPfmtfl/SAMP and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx686/APREfmtflags +Bsetf/B(fmtflags fmtfl); /PRE +UL +PSets SAMPflags()/SAMP to SAMP(fmtfl | flags())/SAMP and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx687/APREfmtflags +Bsetf/B(fmtflags fmtfl, fmtflags mask); /PRE +UL +PClears SAMPmask/SAMP in SAMPflags()/SAMP, sets SAMP(fmtfl amp; mask)/SAMP in SAMPflags()/SAMP, and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx689/APREvoid +Bunsetf/B(fmtflags mask); /PRE +UL +PClears SAMPmask/SAMP in SAMPflags()/SAMP./P /UL @@ -443,20 +464,6 @@ /UL -A NAME=idx686/APREfmtflags -Bsetf/B(fmtflags fmtfl); /PRE -UL -PSaves the format control information, then sets it to SAMPfmtfl/SAMP and returns the previously saved value./P -/UL - - -A NAME=idx687/APREfmtflags -Bsetf/B(fmtflags fmtfl, fmtflags mask); /PRE -UL -PSaves the format control information, then clears SAMPmask/SAMP in SAMPflags()/SAMP, sets SAMPfmtfl amp; mask in flags()/SAMP, and returns the previously saved value./P -/UL - - A NAME=idx688/APREbool Bsync_with_stdio/B(bool sync = true); /PRE UL @@ -464,13 +471,6 @@ /UL -A NAME=idx689/APREvoid -Bunsetf/B(fmtflags mask); /PRE -UL -PClears SAMPmask/SAMP in SAMPflags()/SAMP./P -/UL - - A NAME=idx690/APREstreamsize Bwidth/B() const; /PRE UL
svn commit: r720083 - /stdcxx/trunk/doc/stdlibref/ios-base.html
Author: sebor Date: Sun Nov 23 17:07:33 2008 New Revision: 720083 URL: http://svn.apache.org/viewvc?rev=720083view=rev Log: 2008-11-23 Martin Sebor [EMAIL PROTECTED] Merged rev 720080 from 4.2.x. 2008-11-23 Martin Sebor [EMAIL PROTECTED] STDCXX-1025 * doc/stdlibref/ios-base.html (ios_base::flags, ios_base::setf): Improved/corrected wording. (ios_base::unsetf, ios_base::setf): Moved up just below flags(). Modified: stdcxx/trunk/doc/stdlibref/ios-base.html Modified: stdcxx/trunk/doc/stdlibref/ios-base.html URL: http://svn.apache.org/viewvc/stdcxx/trunk/doc/stdlibref/ios-base.html?rev=720083r1=720082r2=720083view=diff == --- stdcxx/trunk/doc/stdlibref/ios-base.html (original) +++ stdcxx/trunk/doc/stdlibref/ios-base.html Sun Nov 23 17:07:33 2008 @@ -390,7 +390,28 @@ A NAME=idx678/APREfmtflags Bflags/B(fmtflags fmtfl); /PRE UL -PSaves the format control information, then sets it to SAMPfmtfl/SAMP and returns the previously saved value./P +PSets SAMPflags()/SAMP to SAMPfmtfl/SAMP and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx686/APREfmtflags +Bsetf/B(fmtflags fmtfl); /PRE +UL +PSets SAMPflags()/SAMP to SAMP(fmtfl | flags())/SAMP and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx687/APREfmtflags +Bsetf/B(fmtflags fmtfl, fmtflags mask); /PRE +UL +PClears SAMPmask/SAMP in SAMPflags()/SAMP, sets SAMP(fmtfl amp; mask)/SAMP in SAMPflags()/SAMP, and returns the previous value of SAMPflags()/SAMP./P +/UL + + +A NAME=idx689/APREvoid +Bunsetf/B(fmtflags mask); /PRE +UL +PClears SAMPmask/SAMP in SAMPflags()/SAMP./P /UL @@ -443,20 +464,6 @@ /UL -A NAME=idx686/APREfmtflags -Bsetf/B(fmtflags fmtfl); /PRE -UL -PSaves the format control information, then sets it to SAMPfmtfl/SAMP and returns the previously saved value./P -/UL - - -A NAME=idx687/APREfmtflags -Bsetf/B(fmtflags fmtfl, fmtflags mask); /PRE -UL -PSaves the format control information, then clears SAMPmask/SAMP in SAMPflags()/SAMP, sets SAMPfmtfl amp; mask in flags()/SAMP, and returns the previously saved value./P -/UL - - A NAME=idx688/APREbool Bsync_with_stdio/B(bool sync = true); /PRE UL @@ -464,13 +471,6 @@ /UL -A NAME=idx689/APREvoid -Bunsetf/B(fmtflags mask); /PRE -UL -PClears SAMPmask/SAMP in SAMPflags()/SAMP./P -/UL - - A NAME=idx690/APREstreamsize Bwidth/B() const; /PRE UL
svn propchange: r717894 - svn:log
Author: sebor Revision: 717894 Modified property: svn:log Modified: svn:log at Sat Nov 15 09:56:42 2008 -- --- svn:log (original) +++ svn:log Sat Nov 15 09:56:42 2008 @@ -1,4 +1,4 @@ -2008-11-15 Martin Sebor [EMAIL PROTECTED] +2008-11-15 Martin Sebor [EMAIL PROTECTED] STDCXX-1024 * doc/stdlibug/34-2.html (34.2.3): Removed ill-formed code example.
svn commit: r717897 - /stdcxx/branches/4.3.x/doc/stdlibug/34-2.html
Author: sebor Date: Sat Nov 15 09:57:18 2008 New Revision: 717897 URL: http://svn.apache.org/viewvc?rev=717897view=rev Log: 2008-11-15 Martin Sebor [EMAIL PROTECTED] Merged rev 717894 from trunk. 2008-11-15 Martin Sebor [EMAIL PROTECTED] STDCXX-1024 * doc/stdlibug/34-2.html (34.2.3): Removed ill-formed code example. Modified: stdcxx/branches/4.3.x/doc/stdlibug/34-2.html Modified: stdcxx/branches/4.3.x/doc/stdlibug/34-2.html URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/doc/stdlibug/34-2.html?rev=717897r1=717896r2=717897view=diff == --- stdcxx/branches/4.3.x/doc/stdlibug/34-2.html (original) +++ stdcxx/branches/4.3.x/doc/stdlibug/34-2.html Sat Nov 15 09:57:18 2008 @@ -158,7 +158,7 @@ PThe effect is the same as in the previous solution, because the standard output stream SAMPstd::cout/SAMP is connected to the C standard file SAMPstdout/SAMP. This is the simplest of all solutions, because it doesn't involve reassigning or sharing stream buffers. The output file stream's buffer is simply connected to the right file. However, this is a nonstandard and nonportable solution./P A NAME=3423H334.2.3 Using Pointers or References to Streams/H3/A A NAME=idx851!/A -PIf you do not want to deal with stream buffers at all, you can also use pointers or references to streams instead. Here is an example:/P +PIf you do not want to deal with stream buffers at all, you can also use pointers to streams instead. Here is an example:/P ULPRE int main(int argc, char *argv[]) @@ -170,7 +170,7 @@ fp = amp;std::cout //3 *fp lt;lt; Hello world! lt;lt; std::endl; //4 - if (fp!=amp;std::cout) + if (fp != amp;std::cout) delete fp; } /PRE/UL @@ -181,25 +181,7 @@ TR VALIGN=topTDSAMP//3/SAMP/TDTDOtherwise, a pointer to SAMPstd::cout/SAMP is used. TR VALIGN=topTDSAMP//4/SAMP/TDTDOutput is written through the pointer to either SAMPstd::cout/SAMP or the named output file. /TABLE -A NAME=idx852!/A -PAn alternative approach could use a reference instead of a pointer:/P - -ULPRE -int main(int argc, char *argv[]) -{ - std::ostreamamp; fr; - if (argc gt; 1) -fr = *(new std::ofstream(argv[1])); - else -fr = std::cout; - - fr lt;lt; Hello world! lt;lt; std::endl; - - if (amp;fr!=amp;std::cout) -delete(amp;fr); -} -/PRE/UL -PWorking with pointers and references has a drawback: you must create an output file stream object on the heap and, in principle, you must worry about deleting the object again, which might lead you into other dire straits./P +PWorking with pointers has a drawback: you must create an output file stream object on the heap and, in principle, you must worry about deleting the object again, which might lead you into other dire straits./P A NAME=idx853!/A PIn summary, creating a copy of a stream is not trivial and should only be done if you really need a copy of a stream object. In many cases, it is more appropriate to use references or pointers to stream objects instead, or to share a stream buffer between two streams. /P BLOCKQUOTEHRB
svn commit: r712454 - /stdcxx/branches/4.2.x/src/locale_body.cpp
Author: sebor Date: Sat Nov 8 16:45:30 2008 New Revision: 712454 URL: http://svn.apache.org/viewvc?rev=712454view=rev Log: 2008-11-08 Martin Sebor [EMAIL PROTECTED] STDCXX-914 * src/locale_body (__rw_locale::_C_manage): Optimized the detection and destruction of the classic C locale. (__rw_locale::_C_is_managed): Optimized the detection of the same. Modified: stdcxx/branches/4.2.x/src/locale_body.cpp 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=712454r1=712453r2=712454view=diff == --- stdcxx/branches/4.2.x/src/locale_body.cpp (original) +++ stdcxx/branches/4.2.x/src/locale_body.cpp Sat Nov 8 16:45:30 2008 @@ -859,6 +859,21 @@ return tmp; } +if (plocale plocale == classic) { +// optimize the destruction of the classic C locale +// the object is never destroyed and its reference count +// never drops to 0 +_RWSTD_ASSERT (__rw_is_C (locname)); +_RWSTD_ASSERT (__rw_is_C (plocale-_C_name)); + +const size_t ref = +_RWSTD_ATOMIC_PREDECREMENT (plocale-_C_ref, false); + +_RWSTD_ASSERT (ref + 1U != 0); +_RWSTD_UNUSED (ref); + +return 0; +} // re-entrant to protect static local data structures // (not the locales themselves) @@ -1066,6 +1081,15 @@ return false; } +_RWSTD_ASSERT (0 == _C_usr_facets); + +if (_C_all == _C_std_facet_bits 0 == _C_byname_facet_bits) { +// optimized for the C locale +_RWSTD_ASSERT (__rw_is_C (_C_name)); + +return true; +} + // unless all facets in the same category come either from // the C locale or from some named locale the locale object // containing the facets is not managed (this test doesn't
svn commit: r709780 - /stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp
Author: sebor Date: Sat Nov 1 14:26:25 2008 New Revision: 709780 URL: http://svn.apache.org/viewvc?rev=709780view=rev Log: 2008-11-01 Martin Sebor [EMAIL PROTECTED] * tests/iostream/27.filebuf.cpp (test_open): Verified that the filebuf::open((char*)0) extension doesn't leak file descriptors. Modified: stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp Modified: stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp?rev=709780r1=709779r2=709780view=diff == --- stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp (original) +++ stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp Sat Nov 1 14:26:25 2008 @@ -870,6 +870,11 @@ BEGIN_MODE (std::ios::in | iomodes [minx], , file name = 0 [extension]); +int fdcount [2]; +int next_fd [2]; + +next_fd [0] = rw_nextfd (fdcount + 0); + // verify that open() succeeds when the first argument // is the null pointer (the call creates a temporary // file and opens it for reading -- such a file may not @@ -882,8 +887,27 @@ rw_assert (fb.is_open (), __FILE__, __LINE__, basic_filebuf%s::is_open(), tname); -// FIXME: verify that the call to close removes the file +// verify that a single file descriptor has been allocated +next_fd [1] = rw_nextfd (fdcount + 1); + +rw_assert ( next_fd [0] + 1 == next_fd [1] +fdcount [0] + 1 == fdcount [1], + __FILE__, __LINE__, + %d file descriptor leak(s) detected after construction, + fdcount [1] - fdcount [0]); + fb.close (); + +// verify that a single file descriptor has been deallocated +next_fd [1] = rw_nextfd (fdcount + 1); + +rw_assert (next_fd [0] == next_fd [1] fdcount [0] == fdcount [1], + __FILE__, __LINE__, + %d file descriptor leak(s) detected after close(), + fdcount [1] - fdcount [0]); + +// FIXME: verify that the temporary file has been deleted +//from the file system } // @@ -894,6 +918,11 @@ BEGIN_MODE (std::ios::out | iomodes [minx], , file name = 0 [extension]); +int fdcount [2]; +int next_fd [2]; + +next_fd [0] = rw_nextfd (fdcount + 0); + // verify that open() succeeds when the first argument // is the null pointer (the call creates a temporary // file and opens it for writing) @@ -904,8 +933,27 @@ rw_assert (fb.is_open (), __FILE__, __LINE__, basic_filebuf%s::is_open(), tname); -// FIXME: verify that the call to close removes the file +// verify that a single file descriptor has been allocated +next_fd [1] = rw_nextfd (fdcount + 1); + +rw_assert ( next_fd [0] + 1 == next_fd [1] +fdcount [0] + 1 == fdcount [1], + __FILE__, __LINE__, + %d file descriptor leak(s) detected after construction, + fdcount [1] - fdcount [0]); + fb.close (); + +// verify that a single file descriptor has been deallocated +next_fd [1] = rw_nextfd (fdcount + 1); + +rw_assert (next_fd [0] == next_fd [1] fdcount [0] == fdcount [1], + __FILE__, __LINE__, + %d file descriptor leak(s) detected after close(), + fdcount [1] - fdcount [0]); + +// FIXME: verify that the temporary file has been deleted +//from the file system } // @@ -916,14 +964,38 @@ BEGIN_MODE (std::ios::in | std::ios::out | iomodes [minx], , file name = 0 [extension]); +int fdcount [2]; +int next_fd [2]; + +next_fd [0] = rw_nextfd (fdcount + 0); + Filebuf fb; fb.open ((const char*)0, mode); rw_assert (fb.is_open (), __FILE__, __LINE__, basic_filebuf%s::is_open(), tname); -// FIXME: verify that the call to close removes the file +// verify that a single file descriptor has been allocated +next_fd [1] = rw_nextfd (fdcount + 1); + +rw_assert ( next_fd [0] + 1 == next_fd [1] +fdcount [0] + 1 == fdcount [1], + __FILE__, __LINE__, + %d file descriptor leak(s) detected after construction, + fdcount [1] - fdcount [0]); + fb.close (); + +// verify that a single file descriptor has been deallocated +next_fd [1] = rw_nextfd (fdcount + 1); + +rw_assert (next_fd
svn commit: r709784 - /stdcxx/branches/4.2.x/src/file.cpp
Author: sebor Date: Sat Nov 1 14:49:58 2008 New Revision: 709784 URL: http://svn.apache.org/viewvc?rev=709784view=rev Log: 2008-11-01 Scott Zhong [EMAIL PROTECTED] Martin Sebor [EMAIL PROTECTED] STDCXX-1019 * src/file.cpp (ENAMETOOLONG, PATH_MAX): Defined macro to a known value when not #defined by system headers. (__rw_mkstemp): Used the value of TMPDIR when set and not empty. Replaced calls to the POSIX unlink() function with the standard C function remove(). Modified: stdcxx/branches/4.2.x/src/file.cpp Modified: stdcxx/branches/4.2.x/src/file.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/file.cpp?rev=709784r1=709783r2=709784view=diff == --- stdcxx/branches/4.2.x/src/file.cpp (original) +++ stdcxx/branches/4.2.x/src/file.cpp Sat Nov 1 14:49:58 2008 @@ -37,11 +37,12 @@ # define _RWSTD_NO_DEPRECATED_C_HEADERS #endif // _RWSTD_NO_DEPRECATED_C_HEADERS -#include errno.h// for ERANGE, errno +#include errno.h// for ENAMETOOLONG, ERANGE, errno #include stddef.h // for ptrdiff_t -#include stdio.h// for P_tmpdir, std{err,in,out}, tmpnam() +#include stdio.h// for P_tmpdir, std{err,in,out}, remove(), tmpnam() #include stdlib.h // for mkstemp(), strtoul(), size_t #include ctype.h// for isalpha(), isspace(), toupper() +#include string.h // for memcpy() #if defined (_WIN32) !defined (__CYGWIN__) @@ -58,6 +59,24 @@ # define _BINARY 0 #endif +#ifndef ENAMETOOLONG + // hardcode based on the known value on each platform +# ifdef _RWSTD_OS_AIX +#define ENAMETOOLONG86 +# elif defined _RWSTD_OS_FREEBSD +#define ENAMETOOLONG63 +# elif defined _RWSTD_OS_HP_UX +#define ENAMETOOLONG 248 +# elif defined _RWSTD_OS_LINUX +#define ENAMETOOLONG36 +# elif defined _RWSTD_OS_SUN_OS +#define ENAMETOOLONG78 +# endif +#endif // ENAMETOOLONG + +#ifndef PATH_MAX +# define PATH_MAX 1024 +#endif #include rw/_file.h #include rw/_defs.h @@ -257,18 +276,48 @@ #define P_tmpdir /tmp # endif // P_tmpdir -char fnamebuf[] = P_tmpdir /.rwtmpXX; +// use TMPDIR and fall back on P_tmpdir as per POSIX +const char *tmpdir = getenv (TMPDIR); +if (0 == tmpdir || '\0' == *tmpdir) +tmpdir = P_tmpdir; + +// template for temporary file name +static const char rwtmpXX[] = /.rwtmpXX; + +// buffer for temporary pathname +char pathbuf [PATH_MAX]; + +// check to see if the buffer is large enough +const size_t len = strlen (tmpdir) - 1; +if (sizeof pathbuf len + sizeof rwtmpXX) { + +# ifdef ENAMETOOLONG +// fail according to POSIX rules +errno = ENAMETOOLONG; +# endif // ENAMETOOLONG -fd = mkstemp (fnamebuf); +return -1; +} +// construct a template for temporary pathname +memcpy (pathbuf, tmpdir, len); +memcpy (pathbuf + len, rwtmpXX, sizeof rwtmpXX); + +// call mkstemp() to create a temporary file and fill +// pathbuf with its pathname +fd = mkstemp (pathbuf); + +// immediately delete the temporary file on success +// the open descriptor will refer to the file until +// it's explicitly closed or until the process exits if (fd = 0) -unlink (fnamebuf); +remove (pathbuf); #else // if defined (_RWSTD_NO_MKSTEMP) modebits |= _RWSTD_O_EXCL | _RWSTD_O_CREAT; -#ifdef _WIN32 +# ifdef _WIN32 // tempnam(const char *dir, const char *prefix) will generate // a unique file name for a directory chosen by the following rules: @@ -286,7 +335,7 @@ //exist, tempnam will use the current working directory to //generate unique names. Currently, if both TMP and dir specify //names of directories that do not exist, the tempnam function -// call will fail. +//call will fail. // // The name returned by tempnam will be a concatenation of prefix // and a sequential number, which will combine to create a unique @@ -294,7 +343,7 @@ // names that have no extension. tempnam uses malloc to allocate // space for the filename; the program is responsible for freeing // this space when it is no longer needed. -char* const fname = tempnam (P_tmpdir, .rwtmp); +char* const fname = tempnam (tmpdir, .rwtmp); if (!fname) return -1; @@ -317,10 +366,10 @@ fd = open (fname, modebits, prot); -// unlink the file, forcing the OS to delete it when +// remove the file, forcing the OS to delete it when // the last file descriptor that refers to it is closed if (fd = 0) -unlink (fname); +remove (fname); # endif // _WIN32 #endif // _RWSTD_NO_MKSTEMP
svn propchange: r706515 - svn:log
Author: sebor Revision: 706515 Modified property: svn:log Modified: svn:log at Wed Oct 22 20:39:40 2008 -- --- svn:log (original) +++ svn:log Wed Oct 22 20:39:40 2008 @@ -3,6 +3,3 @@ STDCXX-401 * tests/src/file.cpp (rw_tmpnam): use TMPDIR variable from environment if defined. --This line, and those below, will be ignored-- - -Mfile.cpp
svn commit: r706515 - /stdcxx/branches/4.2.x/tests/src/file.cpp
Author: sebor Date: Mon Oct 20 21:54:34 2008 New Revision: 706515 URL: http://svn.apache.org/viewvc?rev=706515view=rev Log: 2008-10-20 Scott Zhong [EMAIL PROTECTED] STDCXX-401 * tests/src/file.cpp (rw_tmpnam): use TMPDIR variable from environment if defined. -This line, and those below, will be ignored-- Mfile.cpp Modified: stdcxx/branches/4.2.x/tests/src/file.cpp Modified: stdcxx/branches/4.2.x/tests/src/file.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/file.cpp?rev=706515r1=706514r2=706515view=diff == --- stdcxx/branches/4.2.x/tests/src/file.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/file.cpp Mon Oct 20 21:54:34 2008 @@ -208,8 +208,13 @@ #ifndef _RWSTD_NO_MKSTEMP # define TMP_TEMPLATE tmpfile-XX +const char *tmpdir = getenv (TMPDIR); +if (tmpdir == NULL) { +tmpdir = P_tmpdir; +} + if (!buf) { -static char fname_buf [sizeof (P_tmpdir) + sizeof (TMP_TEMPLATE)]; +static char fname_buf [PATH_MAX]; buf = fname_buf; *buf = '\0'; @@ -217,13 +222,13 @@ if ('\0' == *buf) { // copy the template to the buffer; make sure there is exactly -// one path separator character between P_tmpdir and the file +// one path separator character between tmpdir and the file // name template (it doesn't really matter how many there are // as long as it's at least one, but one looks better than two // in diagnostic messages) -size_t len = sizeof (P_tmpdir) - 1; +size_t len = strlen (tmpdir) - 1; -memcpy (buf, P_tmpdir, len); +memcpy (buf, tmpdir, len); if (_RWSTD_PATH_SEP != buf [len - 1]) buf [len++] = _RWSTD_PATH_SEP; @@ -251,7 +256,7 @@ # ifdef _WIN32 // create a temporary file name -char* fname = tempnam (P_tmpdir, .rwtest-tmp); +char* fname = tempnam (tmpdir, .rwtest-tmp); if (fname) { @@ -272,7 +277,7 @@ else { fprintf (stderr, %s:%d: tempnam(\%s\, \%s\) failed: %s\n, __FILE__, __LINE__, - P_tmpdir, .rwtest-tmp, strerror (errno)); + tmpdir, .rwtest-tmp, strerror (errno)); } # else
svn commit: r703739 - /stdcxx/branches/4.2.x/etc/config/xfail.txt
Author: sebor Date: Sat Oct 11 15:00:19 2008 New Revision: 703739 URL: http://svn.apache.org/viewvc?rev=703739view=rev Log: 2008-10-11 Martin Sebor [EMAIL PROTECTED] * etc/config/xfail.txt: Added description of the status field. Modified: stdcxx/branches/4.2.x/etc/config/xfail.txt Modified: stdcxx/branches/4.2.x/etc/config/xfail.txt URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/xfail.txt?rev=703739r1=703738r2=703739view=diff == --- stdcxx/branches/4.2.x/etc/config/xfail.txt (original) +++ stdcxx/branches/4.2.x/etc/config/xfail.txt Sat Oct 11 15:00:19 2008 @@ -23,6 +23,14 @@ # compiler ::= acc | compaq | eccp | gcc | icc | icl | mipspro # | msvc | sunpro | vacpp # +# status ::= COMP | LINK | EXEC | WARN | DIFF | signal | exit +# +# where +# +# signal ::= signal name such as SIGABRT, SIGBUS, or SIGSEGV +# +# exit ::= non-zero exit status (between 1 and 126) +#
svn commit: r703741 - /stdcxx/trunk/etc/config/xfail.txt
Author: sebor Date: Sat Oct 11 15:02:26 2008 New Revision: 703741 URL: http://svn.apache.org/viewvc?rev=703741view=rev Log: 2008-10-11 Martin Sebor [EMAIL PROTECTED] Merged rev 703739 from 4.2.x. * etc/config/xfail.txt: Added description of the status field. Modified: stdcxx/trunk/etc/config/xfail.txt Modified: stdcxx/trunk/etc/config/xfail.txt URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/xfail.txt?rev=703741r1=703740r2=703741view=diff == --- stdcxx/trunk/etc/config/xfail.txt (original) +++ stdcxx/trunk/etc/config/xfail.txt Sat Oct 11 15:02:26 2008 @@ -23,6 +23,14 @@ # compiler ::= acc | compaq | eccp | gcc | icc | icl | mipspro # | msvc | sunpro | vacpp # +# status ::= COMP | LINK | EXEC | WARN | DIFF | signal | exit +# +# where +# +# signal ::= signal name such as SIGABRT, SIGBUS, or SIGSEGV +# +# exit ::= non-zero exit status (between 1 and 126) +#
svn commit: r703740 - /stdcxx/branches/4.3.x/etc/config/xfail.txt
Author: sebor Date: Sat Oct 11 15:02:13 2008 New Revision: 703740 URL: http://svn.apache.org/viewvc?rev=703740view=rev Log: 2008-10-11 Martin Sebor [EMAIL PROTECTED] Merged rev 703739 from 4.2.x. * etc/config/xfail.txt: Added description of the status field. Modified: stdcxx/branches/4.3.x/etc/config/xfail.txt Modified: stdcxx/branches/4.3.x/etc/config/xfail.txt URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/etc/config/xfail.txt?rev=703740r1=703739r2=703740view=diff == --- stdcxx/branches/4.3.x/etc/config/xfail.txt (original) +++ stdcxx/branches/4.3.x/etc/config/xfail.txt Sat Oct 11 15:02:13 2008 @@ -23,6 +23,14 @@ # compiler ::= acc | compaq | eccp | gcc | icc | icl | mipspro # | msvc | sunpro | vacpp # +# status ::= COMP | LINK | EXEC | WARN | DIFF | signal | exit +# +# where +# +# signal ::= signal name such as SIGABRT, SIGBUS, or SIGSEGV +# +# exit ::= non-zero exit status (between 1 and 126) +#
svn commit: r700162 - /stdcxx/branches/4.2.x/src/collate.cpp
Author: sebor Date: Mon Sep 29 09:14:44 2008 New Revision: 700162 URL: http://svn.apache.org/viewvc?rev=700162view=rev Log: 2008-09-29 Martin Sebor [EMAIL PROTECTED] * src/collate.cpp (__rw_strnxfrm): Plugged a memory leak. Modified: stdcxx/branches/4.2.x/src/collate.cpp Modified: stdcxx/branches/4.2.x/src/collate.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/collate.cpp?rev=700162r1=700161r2=700162view=diff == --- stdcxx/branches/4.2.x/src/collate.cpp (original) +++ stdcxx/branches/4.2.x/src/collate.cpp Mon Sep 29 09:14:44 2008 @@ -536,8 +536,12 @@ const size_t dst_size = strxfrm (just_in_case_buf, psrc, 0); // check for strxfrm() errors -if (0 == (dst_size 1)) +if (0 == (dst_size 1)) { +if (pbuf != buf) +delete[] pbuf; + return _STD::string (); +} size_t res_size = res.size ();
svn commit: r699389 - /stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html
Author: sebor Date: Fri Sep 26 09:09:19 2008 New Revision: 699389 URL: http://svn.apache.org/viewvc?rev=699389view=rev Log: 2008-09-26 Martin Sebor [EMAIL PROTECTED] STDCXX-1017 * doc/stdlibref/bind1st.html (Description): Corrected confusing text. Updated code snippet to use the standard three-argument count_if() algorithm instead of the obsolete four-argument extension. Modified: stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html Modified: stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html?rev=699389r1=699388r2=699389view=diff == --- stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html (original) +++ stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html Fri Sep 26 09:09:19 2008 @@ -64,14 +64,13 @@ A NAME=sec4H3Description/H3/A PBecause so many functions included in the C++ Standard Library take other functions as arguments, the library includes classes that let you build new function objects out of old ones. Both SAMPA HREF=bind1st.htmlbind1st()/A/SAMP and SAMPA HREF=bind1st.htmlbind2nd()/A/SAMP are functions that take as arguments a binary function object SAMPf/SAMP and a value SAMPx,/SAMP and return, respectively, classes BIA HREF=bind1st.htmlbinder1st/A/I/B and BIA HREF=bind1st.htmlbinder2nd/A/I/B. The underlying function object must be a subclass of BIA HREF=binary-function.htmlbinary_function/A/I/B./P PClass BIA HREF=bind1st.htmlbinder1st/A/I/B binds the value to the first argument of the binary function, and BIA HREF=bind1st.htmlbinder2nd/A/I/B does the same thing for the second argument of the function. The resulting classes can be used in place of a unary predicate in other function calls./P -PFor example, you could use the SAMPA HREF=count.htmlcount_if()/A/SAMP algorithm to count all elements in a BIA HREF=vector.htmlvector/A/I/B that are less than or equal to 7, using the following:/P +PFor example, you could use the SAMPA HREF=count.htmlcount_if()/A/SAMP algorithm to count all elements in a BIA HREF=vector.htmlvector/A/I/B that are less than 7, using the following:/P ULPRE -vectorlt;intgt; v;brint littleNums;br -count_if(v.begin, v.end, bind1st(greaterlt;intgt;(),7), - littleNums) +std::vectorlt;intgt; v (/* ... */); +int littleNums = std::count_if (v.begin (), v.end (), std::bind1st (std::lesslt;intgt;(), 7)); /PRE/UL -PThis function adds one to SAMPlittleNums/SAMP each time the element is greater thannbsp;7./P +PThe function counts the number of elements in the range [SAMPv.begin()/SAMP, SAMPv.end()/SAMP) as denoted by the first two iterator arguments that satisfy the predicate specified by the third argument and returns the result./P A NAME=sec5H3Interface/H3/A ULPREnamespace std {
svn commit: r699390 - /stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html
Author: sebor Date: Fri Sep 26 09:11:07 2008 New Revision: 699390 URL: http://svn.apache.org/viewvc?rev=699390view=rev Log: 2008-09-26 Martin Sebor [EMAIL PROTECTED] * doc/stdlibref/bind1st.html (Example): Updated to sync with rev 699379. Modified: stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html Modified: stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html?rev=699390r1=699389r2=699390view=diff == --- stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html (original) +++ stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html Fri Sep 26 09:11:07 2008 @@ -125,52 +125,65 @@ #include lt;algorithmgt; // for find_if #include lt;functionalgt; // for equal_to, bind1st, bind2nd -#include lt;iostreamgt;// for cout, endl +#include lt;iostreamgt;// for cout +#include lt;iteratorgt;// for ostream_iterator #include lt;vectorgt; // for vector - int main () { -typedef std::vectorlt;int, std::allocatorlt;intgt; gt; vector; -typedef std::equal_tolt;vector::value_typegt; equal_to; +typedef std::vectorlt;intgt; Vector; +typedef std::equal_tolt;Vector::value_typegt; EqualTo; + +const Vector::value_type arr [] = { 1, 2, 3, 4, 5 }; -const vector::value_type arr [] = { 1, 2, 3, 4 }; +// Initialize a vector with the array elements. +const Vector v1 (arr, arr + sizeof arr / sizeof *arr); -// Set up a vector. -vector v1 (arr + 0, arr + sizeof arr / sizeof *arr); +// Value to look for. +const Vector::value_type x (3); -// Create an 'equal to 3' unary predicate by binding 3 to -// the equal_to binary predicate. -std::binder1stlt;equal_togt; equal_to_3 = - bind1st (equal_to (), 3); +// Create an 'equal to 3' unary predicate by binding the value +// 3 to the EqualTo binary predicate. +const std::binder1stlt;EqualTogt; equal_to_3 = +std::bind1st (EqualTo (), x); // Now use this new predicate in a call to find_if. -vector::iterator it1 = std::find_if (v1.begin (), - v1.end (), - equal_to_3); +const Vector::const_iterator it1 = +std::find_if (v1.begin (), v1.end (), equal_to_3); // Even better, construct the new predicate on the fly. -vector::iterator it2 = -std::find_if (v1.begin (), v1.end (), - std::bind1st (equal_to (), 3)); +const Vector::const_iterator it2 = +std::find_if (v1.begin (), v1.end (), std::bind1st (EqualTo (), x)); // And now the same thing using bind2nd. -// Same result since equal_to is commutative. -vector::iterator it3 = -std::find_if (v1.begin (), v1.end (), - std::bind2nd (equal_to (), 3)); +// Same result since EqualTo is commutative. +const Vector::const_iterator it3 = +std::find_if (v1.begin (), v1.end (), std::bind2nd (EqualTo (), x)); + +// Use the same predicate to count the number of elements +// equal to 3. +const Vector::size_type n = +std::count_if (v1.begin (), v1.end (), std::bind2nd (EqualTo (), x)); // Output results. -std::cout lt;lt; *it1 lt;lt; lt;lt; *it2 lt;lt; - lt;lt; *it3 lt;lt; std::endl; +std::ostream_iteratorlt;Vector::value_typegt; out (std::cout, ); -return 0; -} +std::cout lt;lt; The vector { ; +std::copy (v1.begin (), v1.end (), out); +std::cout lt;lt; } contains lt;lt; n lt;lt; element equal to + lt;lt; x lt;lt; at offset lt;lt; + it1 - v1.begin () lt;lt; .\n; + +// Exit with status of 0 on success, 1 on failure. +const bool success = 1 == n it1 == it2 it1 == it2 *it1 == x; + +return success ? 0 : 1; +} Program Output: -3 3 3 +The vector { 1 2 3 4 5 } contains 1 element equal to 3 at offset 2. /PRE/UL ULPRE/PRE/UL A NAME=sec7H3See Also/H3/A
svn commit: r693868 - /stdcxx/branches/4.2.x/etc/config/acc.config
Author: sebor Date: Wed Sep 10 08:22:28 2008 New Revision: 693868 URL: http://svn.apache.org/viewvc?rev=693868view=rev Log: 2008-09-10 Martin Sebor [EMAIL PROTECTED] * etc/config/acc.config (WARNFLAGS): Disabled info #20302-D: performance advice: For better performance, consider using profile based optimization emitted after committing r692728 (STDCXX-1014). Modified: stdcxx/branches/4.2.x/etc/config/acc.config Modified: stdcxx/branches/4.2.x/etc/config/acc.config URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/acc.config?rev=693868r1=693867r2=693868view=diff == --- stdcxx/branches/4.2.x/etc/config/acc.config (original) +++ stdcxx/branches/4.2.x/etc/config/acc.config Wed Sep 10 08:22:28 2008 @@ -58,7 +58,10 @@ ifeq ($(shell [ $(aCC_MINOR) -ge 15 ] echo 1),1) # enable performance suggestions for aCC 6.15 and higher -WARNFLAGS += +wperfadvice +# but disable the pointless info #20302-D: performance +# advice: For better performance, consider using profile +# based optimization. +WARNFLAGS += +wperfadvice +W20302 endif # aCC = 6.15 # disabled warnings:
svn commit: r693958 - /stdcxx/branches/4.2.x/include/strstream
Author: sebor Date: Wed Sep 10 12:53:52 2008 New Revision: 693958 URL: http://svn.apache.org/viewvc?rev=693958view=rev Log: 2008-09-10 Martin Sebor [EMAIL PROTECTED] * include/strstream (_C_init): Added the empty exception specification for consistency with the definition of the function idadvertently chnaged in r693942. Modified: stdcxx/branches/4.2.x/include/strstream Modified: stdcxx/branches/4.2.x/include/strstream URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/strstream?rev=693958r1=693957r2=693958view=diff == --- stdcxx/branches/4.2.x/include/strstream (original) +++ stdcxx/branches/4.2.x/include/strstream Wed Sep 10 12:53:52 2008 @@ -51,7 +51,7 @@ typedef basic_streambufchar, char_traitschar _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
svn commit: r692684 - /stdcxx/branches/4.2.x/src/collate.cpp
Author: sebor Date: Sat Sep 6 10:09:52 2008 New Revision: 692684 URL: http://svn.apache.org/viewvc?rev=692684view=rev Log: 2008-09-06 Martin Sebor [EMAIL PROTECTED] * src/collate.cpp: Globally replaced all occurrences of the _RWSTD_SIZE_T macro with the equivalent C typedef. Modified: stdcxx/branches/4.2.x/src/collate.cpp Modified: stdcxx/branches/4.2.x/src/collate.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/collate.cpp?rev=692684r1=692683r2=692684view=diff == --- stdcxx/branches/4.2.x/src/collate.cpp (original) +++ stdcxx/branches/4.2.x/src/collate.cpp Sat Sep 6 10:09:52 2008 @@ -43,7 +43,7 @@ #include limits // for numeric_limits #include limits.h -#include stdlib.h // for wcstombs() +#include stdlib.h // for size_t, wcstombs() #include string.h // for memchr(), memcpy() #ifndef _RWSTD_NO_WCHAR_H @@ -88,7 +88,7 @@ extern C { // declare if not declared in the system header(s) -_RWSTD_SIZE_T wcsxfrm (wchar_t*, const wchar_t*, _RWSTD_SIZE_T) _LIBC_THROWS (); +size_t wcsxfrm (wchar_t*, const wchar_t*, size_t) _LIBC_THROWS (); #define _RWSTD_WCSXFRM wcsxfrm #undef _RWSTD_NO_WCSXFRM @@ -108,8 +108,8 @@ extern C { // declare if not declared in the system header(s) -_RWSTD_DLLIMPORT _RWSTD_SIZE_T -wcstombs (char*, const wchar_t*, _RWSTD_SIZE_T) _LIBC_THROWS (); +_RWSTD_DLLIMPORT size_t +wcstombs (char*, const wchar_t*, size_t) _LIBC_THROWS (); # undef _RWSTD_NO_WCSTOMBS @@ -321,10 +321,10 @@ while (*cur_char end) { // convert the next wchar_t character to a utf8 encoded character -const _RWSTD_SIZE_T nbytes = +const size_t nbytes = _RW::__rw_itoutf8 (**cur_char, utf8_enc); -for (_RWSTD_SIZE_T i = 0; i nbytes; i++) { +for (size_t i = 0; i nbytes; i++) { const unsigned c1 = impl-get_first_char_in_w_ce_tab (cur_tab); const unsigned c2 = impl-get_last_char_in_w_ce_tab (cur_tab); @@ -365,10 +365,10 @@ while (*cur_char end) { // convert the next wchar_t character to a utf8 encoded character -const _RWSTD_SIZE_T nbytes = +const size_t nbytes = _RW::__rw_itoutf8 (**cur_char, utf8_enc); -for (_RWSTD_SIZE_T i = 0; i nbytes; i++) { +for (size_t i = 0; i nbytes; i++) { const unsigned c1 = impl-get_first_char_in_w_tab (cur_tab); if (UChar (utf8_enc [i]) c1) return -1; @@ -476,14 +476,14 @@ // in an array that may contain embedded NULs; these are inserted // into the transformed string static _STD::string -__rw_strnxfrm (const char *src, _RWSTD_SIZE_T nchars) +__rw_strnxfrm (const char *src, size_t nchars) { _STD::string res; char buf [256]; char *pbuf = buf; -_RWSTD_SIZE_T bufsize = sizeof buf; +size_t bufsize = sizeof buf; char *psrc = buf; while (nchars) { @@ -533,13 +533,13 @@ char just_in_case_buf [8]; #endif -const _RWSTD_SIZE_T dst_size = strxfrm (just_in_case_buf, psrc, 0); +const size_t dst_size = strxfrm (just_in_case_buf, psrc, 0); // check for strxfrm() errors if (0 == (dst_size 1)) return _STD::string (); -_RWSTD_SIZE_T res_size = res.size (); +size_t res_size = res.size (); _TRY { // resize the result string to fit itself plus the result @@ -554,7 +554,7 @@ } // transfor the source string up to the terminating NUL -_RWSTD_SIZE_T xfrm_size = +size_t xfrm_size = strxfrm (res [0] + res_size, psrc, dst_size + 1); #if defined _MSC_VER _MSC_VER 1400 @@ -594,8 +594,8 @@ // implements wcsxfrm() using wcstombs() and strxfrm() on platforms // such as some versions of BSD where the function isn't defined in // the C Standard Library -static _RWSTD_SIZE_T -__rw_wcsxfrm (wchar_t *dst, const wchar_t *src, _RWSTD_SIZE_T dstsize) +static size_t +__rw_wcsxfrm (wchar_t *dst, const wchar_t *src, size_t dstsize) { // src must be non-null _RWSTD_ASSERT (0 != src); @@ -608,20 +608,20 @@ // convert wide string to a multibyte string before tranforming it // using strxfrm() and widening the result into the destination buffer -const _RWSTD_SIZE_T srclen = _RWSTD_WCSLEN (src); +const size_t srclen = _RWSTD_WCSLEN (src); // compute the size of the temporary nearrow buffer where to narrow // the source wide string to -const _RWSTD_SIZE_T needbytes = +const size_t needbytes = (dstsize ? dstsize : srclen) * MB_LEN_MAX; char narrow_buf [256]; char* const nbuf = sizeof narrow_buf needbytes ? new char [needbytes + 1] : narrow_buf; -_RWSTD_SIZE_T result; +size_t result; -const _RWSTD_SIZE_T nmbchars = wcstombs (nbuf, src, needbytes); +const
svn commit: r692697 - /stdcxx/branches/4.2.x/src/collate.cpp
Author: sebor Date: Sat Sep 6 10:59:18 2008 New Revision: 692697 URL: http://svn.apache.org/viewvc?rev=692697view=rev Log: 2008-09-06 Martin Sebor [EMAIL PROTECTED] STDCXX-1011 * src/collate.cpp (collate_byname::do_transform): Silenced HP aCC warning #20200: Potential null pointer dereference through return of call to __rw::__rw_get_facet_data(). Optimized the initialization of the facet data so as to take place only in the first iteration of the loop in which it's needed, and not each time. Modified: stdcxx/branches/4.2.x/src/collate.cpp Modified: stdcxx/branches/4.2.x/src/collate.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/collate.cpp?rev=692697r1=692696r2=692697view=diff == --- stdcxx/branches/4.2.x/src/collate.cpp (original) +++ stdcxx/branches/4.2.x/src/collate.cpp Sat Sep 6 10:59:18 2008 @@ -966,6 +966,10 @@ // each character, in the process check for collating elements. const char* tmp_lo = low; +// lazily initialized in the first iteration of the loop +// in which the facet data is needed (possibly never) +const _RW::__rw_codecvt_t* cvt = 0; + for (; tmp_lo high; tmp_lo++) { const char* tmp_lo2 = tmp_lo; int ret = _RW::__rw_get_n_ce_offset (impl, tmp_lo2, high); @@ -983,18 +987,22 @@ if (impl-undefined_optimization) { size_t size; +if (0 == cvt) { +cvt = _RWSTD_STATIC_CAST (const _RW::__rw_codecvt_t*, + _RW::__rw_get_facet_data ( + ccvt_cat, size, _C_name, + impl-codeset_name ())); -const _RW::__rw_codecvt_t *cvt = -_RWSTD_STATIC_CAST (const _RW::__rw_codecvt_t*, -_RW::__rw_get_facet_data ( -ccvt_cat, size, _C_name, -impl-codeset_name ())); +if (0 == cvt) +return string_type (); // error +} if (_RW::__rw_is_invalid (cvt-n_to_w_tab(), tmp_lo2)) -return 0; +return string_type (); // error -const unsigned int *pwt = +const unsigned int* const pwt = impl-get_weight (impl-undefined_weight_idx); + indexes.append (pwt, 1); tmp_lo = tmp_lo2; @@ -1194,6 +1202,10 @@ // is high - low _RW::__rw_pod_arrayconst unsigned int*, 1024 indexes; +// lazily initialized in the first iteration of the loop +// in which the facet data is needed (possibly never) +const _RW::__rw_codecvt_t* cvt = 0; + // first go through the string getting a weight offset for // each character, in the process check for collating elements. for (const wchar_t* tmp_lo =low; tmp_lo high; tmp_lo++) { @@ -1211,11 +1223,17 @@ // database to discover this information if (impl-undefined_optimization) { size_t size; -const _RW::__rw_codecvt_t *cvt = -_RWSTD_STATIC_CAST (const _RW::__rw_codecvt_t*, -_RW::__rw_get_facet_data ( -ccvt_cat, size, _C_name, -impl-codeset_name ())); + + +if (0 == cvt) { +cvt = _RWSTD_STATIC_CAST(const _RW::__rw_codecvt_t*, + _RW::__rw_get_facet_data ( +ccvt_cat, size, _C_name, +impl-codeset_name ())); + +if (0 == cvt) +return string_type (); // error +} char tmp [_RWSTD_MB_MAX];
svn commit: r692728 - /stdcxx/branches/4.2.x/etc/config/acc.config
Author: sebor Date: Sat Sep 6 13:30:16 2008 New Revision: 692728 URL: http://svn.apache.org/viewvc?rev=692728view=rev Log: 2008-09-06 Martin Sebor [EMAIL PROTECTED] STDCXX-1014 * etc/config/acc.config (WARNFLAGS): Enabled the +wperfadvice and +wsecurity warning options for HP aCC 6.15 and 6.05 (with optimization), respectively. Modified: stdcxx/branches/4.2.x/etc/config/acc.config Modified: stdcxx/branches/4.2.x/etc/config/acc.config URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/acc.config?rev=692728r1=692727r2=692728view=diff == --- stdcxx/branches/4.2.x/etc/config/acc.config (original) +++ stdcxx/branches/4.2.x/etc/config/acc.config Sat Sep 6 13:30:16 2008 @@ -46,6 +46,21 @@ ifeq ($(aCC_MAJOR),06) +ifeq ($(findstring optimized,$(BUILDMODE)),optimized) +ifeq ($(shell [ $(aCC_MINOR) -ge 5 ] echo 1),1) +# enable security warnings for aCC 6.05 and higher +# when optimization is enabled (the option implicitly +# enables a limited form of cross module analysis and +# increases compilation times) +WARNFLAGS += +wsecurity +endif # aCC = 6.05 +endif # optimization on + +ifeq ($(shell [ $(aCC_MINOR) -ge 15 ] echo 1),1) +# enable performance suggestions for aCC 6.15 and higher +WARNFLAGS += +wperfadvice +endif # aCC = 6.15 + # disabled warnings: # 2193 zero used for undefined preprocessing identifier # 2236 controlling expression is constant
svn commit: r692757 - /stdcxx/branches/4.2.x/examples/manual/search.cpp
Author: sebor Date: Sat Sep 6 15:42:30 2008 New Revision: 692757 URL: http://svn.apache.org/viewvc?rev=692757view=rev Log: 2008-09-06 Martin Sebor [EMAIL PROTECTED] STDCXX-1007 * examples/manual/search.cpp (main): Silenced HP aCC warning #4320: performance advice: std::endl is expensive because it flushes the stream. Modified: stdcxx/branches/4.2.x/examples/manual/search.cpp Modified: stdcxx/branches/4.2.x/examples/manual/search.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/examples/manual/search.cpp?rev=692757r1=692756r2=692757view=diff == --- stdcxx/branches/4.2.x/examples/manual/search.cpp (original) +++ stdcxx/branches/4.2.x/examples/manual/search.cpp Sat Sep 6 15:42:30 2008 @@ -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. * **/ @@ -46,8 +46,8 @@ // // Print out the original sequence. // - cout endl The subsequence, subseq , was found at the ; - cout endl location identified by a '*' endl ; + cout \nThe subsequence, subseq , was found at the ; + cout \nlocation identified by a '*' \n ; // // Create an iterator to identify the location of // subsequence within sequence. @@ -65,9 +65,10 @@ // // Output sequence to display result. // - for (listchar,allocatorchar ::iterator i = sequence.begin(); i != sequence.end(); i++) + for (listchar,allocatorchar ::iterator i = sequence.begin(); + i != sequence.end(); ++i) cout *i; - cout endl; + cout '\n'; return 0; }
svn commit: r692472 - /stdcxx/branches/4.2.x/src/collate.cpp
Author: sebor Date: Fri Sep 5 09:00:22 2008 New Revision: 692472 URL: http://svn.apache.org/viewvc?rev=692472view=rev Log: 2008-09-05 Martin Sebor [EMAIL PROTECTED] STDCXX-1010 * src/collate.cpp [_RWSTD_OS_SUNOS] (__rw_strnxfrm): Passed NULL to strxfrm() on Solaris to avoid memory corruption due to a bug in some releases of the OS. [_RWSTD_OS_SUNOS] (__rw_wcsnxfrm): Same but for wcsxfrm(). Modified: stdcxx/branches/4.2.x/src/collate.cpp Modified: stdcxx/branches/4.2.x/src/collate.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/collate.cpp?rev=692472r1=692471r2=692472view=diff == --- stdcxx/branches/4.2.x/src/collate.cpp (original) +++ stdcxx/branches/4.2.x/src/collate.cpp Fri Sep 5 09:00:22 2008 @@ -522,10 +522,17 @@ src+= (last - src) + 1; } +#ifdef _RWSTD_OS_SUNOS +// Solaris 10u5 on AMD64 overwrites memory past the end of +// just_in_case_buf[8], to avoid this, pass a null pointer +char* const just_in_case_buf = 0; +#else // provide a destination buffer to strxfrm() in case // it's buggy (such as MSVC's) and tries to write to // the buffer even if it's 0 char just_in_case_buf [8]; +#endif + const _RWSTD_SIZE_T dst_size = strxfrm (just_in_case_buf, psrc, 0); // check for strxfrm() errors @@ -724,10 +731,16 @@ src+= (last - src) + 1; } +#ifdef _RWSTD_OS_SUNOS +// just in case Solaris wcsxfrm() has the same bug +// as its strxfrm() (see above) +wchar_t* const just_in_case_buf = 0; +#else // provide a destination buffer to strxfrm() in case // it's buggy (such as MSVC's) and tries to write to // the buffer even if it's 0 wchar_t just_in_case_buf [8]; +#endif const _RWSTD_SIZE_T dst_size = _RWSTD_WCSXFRM (just_in_case_buf, psrc, 0);
svn commit: r692491 - /stdcxx/branches/4.2.x/tests/regress/22.locale.collate.stdcxx-1010.cpp
Author: sebor Date: Fri Sep 5 10:02:56 2008 New Revision: 692491 URL: http://svn.apache.org/viewvc?rev=692491view=rev Log: 2008-09-05 Martin Sebor [EMAIL PROTECTED] * tests/regress/22.locale.collate.stdcxx-1010.cpp: Added a new regression test exercising STDCXX-1010. Added: stdcxx/branches/4.2.x/tests/regress/22.locale.collate.stdcxx-1010.cpp (with props) Added: stdcxx/branches/4.2.x/tests/regress/22.locale.collate.stdcxx-1010.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/regress/22.locale.collate.stdcxx-1010.cpp?rev=692491view=auto == --- stdcxx/branches/4.2.x/tests/regress/22.locale.collate.stdcxx-1010.cpp (added) +++ stdcxx/branches/4.2.x/tests/regress/22.locale.collate.stdcxx-1010.cpp Fri Sep 5 10:02:56 2008 @@ -0,0 +1,86 @@ +/ + * + * 22.locale.collate.stdcxx-1010.cpp - regression test for STDCXX-1010 + * + * http://issues.apache.org/jira/browse/STDCXX-1010 + * + * $Id:$ + * + *** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + **/ + +#include cassert +#include locale +#include string + +int main () +{ +std::locale french; + +// well-known locale names on popular systems +const char* const names[] = { +// generic: +fr_FR, +// AIX: +[EMAIL PROTECTED], fr_FR.IBM-1252, fr_FR.8859-15, +[EMAIL PROTECTED], [EMAIL PROTECTED], +fr_FR.ISO8859-1, [EMAIL PROTECTED], +// HP-UX: +fr_FR.iso88591, [EMAIL PROTECTED], fr_FR.roman8, +fr_FR.utf8, +// Solaris: +fr_FR.ISO8859-1, fr_FR.ISO8859-15, [EMAIL PROTECTED], +fr_FR.UTF-8, [EMAIL PROTECTED], +// Windows: +fr-FR, + +// sentinel +0 +}; + +// try to find the first matching locale on this system +for (unsigned i = 0; names [i]; ++i) { +try { +french = std::locale (names [i]); +if (std::has_facetstd::collatechar (french)) +break; +} +catch (...) { +} +} + +// fall back on the C locale... + +const char s0[] = Et la marine va venir àMalte; + +const std::string s1 (s0); +const std::string s2 (s0); + +const std::collatechar col = +std::use_facetstd::collatechar (french); + +const int cmp = +col.compare (s1.c_str (), s1.c_str () + s1.length (), + s2.c_str (), s2.c_str () + s2.length ()); + +// verify that strings collate the same +assert (0 == cmp); +return cmp; +} Propchange: stdcxx/branches/4.2.x/tests/regress/22.locale.collate.stdcxx-1010.cpp -- svn:eol-style = native Propchange: stdcxx/branches/4.2.x/tests/regress/22.locale.collate.stdcxx-1010.cpp -- svn:keywords = Id
svn commit: r686532 - /stdcxx/site/status/2008-08.text
Author: sebor Date: Sat Aug 16 11:22:50 2008 New Revision: 686532 URL: http://svn.apache.org/viewvc?rev=686532view=rev Log: 2008-08-16 Martin Sebor [EMAIL PROTECTED] * status/2008-08.text: Board report for August 2008. To be copied into https://svn.apache.org/repos/private/foundation/board/board_agenda_2008_08_20.txt Added: stdcxx/site/status/2008-08.text (with props) Added: stdcxx/site/status/2008-08.text URL: http://svn.apache.org/viewvc/stdcxx/site/status/2008-08.text?rev=686532view=auto == --- stdcxx/site/status/2008-08.text (added) +++ stdcxx/site/status/2008-08.text Sat Aug 16 11:22:50 2008 @@ -0,0 +1,53 @@ +Notable changes since the last report (May 2008): + + The reelase schedule for the next C++ standard, informally known as + C++ 0x, has changed. The new standard is now expected to be + reatified sometime in 2011 rather than by the end of this decade as + originally planned. The team's progress on the implementation of the + new C++ standard features has been slow in part due to ongoing + changes to the specification and in part due to the limited + availability of the new core C++ features in existing compilers, or + their instability. + +BIS Export Control Classification: + + Apache C++ Standard Library contains no encryption source code nor + does it make use of any third party encryption software. + +Future plans: + + Continue to work on implementing C++ 0x. + +Community: + + The stdcxx community is unchanged since the last report. + + 16 committers (unchanged), 6 active + 11 PMC members (unchanged), 6 active + +Mailing List Activity Changes Since February 2008: + + commits: 19 (+1) subscribers, 5.10 (+0.72) posts/day + dev: 57 (+2) subscribers, 7.27 (+0.79) posts/day + issues: 13 (+1) subscribers, 11.43 (-0.48) posts/day + user:48 (+2) subscribers, 0.11 (-0.08) posts/day + +Bug Tracking Changes Since January 2008: + + Total issues: 997 (+ 59) + Outstanding: 336 (+ 8) + Resolved: 160 (+ 26) + Closed: 501 (+ 25) + +Planned releases: + + 4.2.2 Fall 2008 (was July 2008) + 4.3.0 Winter 2008 - 2009 + 5.0.0 first half of 2009 + +Release history: + + 4.2.1 May 1, 2008 + 4.2.0 October 29, 2007 (incubating) + 4.1.3 January 30, 2006 (incubating) + 4.1.2 September 7, 2005 (snapshot, incubating) Propchange: stdcxx/site/status/2008-08.text -- svn:eol-style = native
svn commit: r686536 - /stdcxx/site/status/2008-08.text
Author: sebor Date: Sat Aug 16 11:48:31 2008 New Revision: 686536 URL: http://svn.apache.org/viewvc?rev=686536view=rev Log: 2008-08-16 Martin Sebor [EMAIL PROTECTED] * status/2008-08.text: Fixed typos. Modified: stdcxx/site/status/2008-08.text Modified: stdcxx/site/status/2008-08.text URL: http://svn.apache.org/viewvc/stdcxx/site/status/2008-08.text?rev=686536r1=686535r2=686536view=diff == --- stdcxx/site/status/2008-08.text (original) +++ stdcxx/site/status/2008-08.text Sat Aug 16 11:48:31 2008 @@ -1,13 +1,13 @@ Notable changes since the last report (May 2008): - The reelase schedule for the next C++ standard, informally known as - C++ 0x, has changed. The new standard is now expected to be - reatified sometime in 2011 rather than by the end of this decade as - originally planned. The team's progress on the implementation of the - new C++ standard features has been slow in part due to ongoing - changes to the specification and in part due to the limited - availability of the new core C++ features in existing compilers, or - their instability. + The release schedule for the next C++ standard, informally known + as C++ 0x, has changed. The new standard is now expected to be + ratified sometime in 2011 rather than by the end of this decade + as originally planned. The team's progress on the implementation + of the new C++ standard features has been slow in part due to + ongoing changes to the specification and in part due to the limited + availability of the new core C++ features in existing compilers, + or their instability. BIS Export Control Classification:
svn commit: r686537 - in /stdcxx/branches/4.2.x: include/rw/_allocator.h src/memory.cpp
Author: sebor Date: Sat Aug 16 12:03:53 2008 New Revision: 686537 URL: http://svn.apache.org/viewvc?rev=686537view=rev Log: 2008-08-16 Martin Sebor [EMAIL PROTECTED] 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. Modified: stdcxx/branches/4.2.x/include/rw/_allocator.h stdcxx/branches/4.2.x/src/memory.cpp Modified: stdcxx/branches/4.2.x/include/rw/_allocator.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_allocator.h?rev=686537r1=686536r2=686537view=diff == --- stdcxx/branches/4.2.x/include/rw/_allocator.h (original) +++ stdcxx/branches/4.2.x/include/rw/_allocator.h Sat Aug 16 12:03:53 2008 @@ -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 @@ -149,9 +152,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); @@ -168,7 +171,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 (); } @@ -239,11 +245,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 @@ -258,8 +264,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.2.x/src/memory.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/memory.cpp?rev=686537r1=686536r2=686537view=diff == --- stdcxx/branches/4.2.x/src/memory.cpp (original) +++ stdcxx/branches/4.2.x/src/memory.cpp Sat Aug 16 12:03:53 2008 @@ -76,7 +76,7 @@ _RWSTD_EXPORT void -__rw_deallocate (void *p, _RWSTD_SIZE_T, int /* = 0 */) +__rw_deallocate (void *p, _RWSTD_SIZE_T, int /* = 0 */) _THROWS (()) { ::operator delete (p); }
svn commit: r686543 - /stdcxx/branches/4.2.x/include/rw/_allocator.h
Author: sebor Date: Sat Aug 16 12:20:13 2008 New Revision: 686543 URL: http://svn.apache.org/viewvc?rev=686543view=rev Log: 2008-08-16 Martin Sebor [EMAIL PROTECTED] * include/rw/_allocator.h (allocator::destroy): Fixed a typo inadvertently introduced in rev 686537. Modified: stdcxx/branches/4.2.x/include/rw/_allocator.h Modified: stdcxx/branches/4.2.x/include/rw/_allocator.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_allocator.h?rev=686543r1=686542r2=686543view=diff == --- stdcxx/branches/4.2.x/include/rw/_allocator.h (original) +++ stdcxx/branches/4.2.x/include/rw/_allocator.h Sat Aug 16 12:20:13 2008 @@ -174,7 +174,7 @@ // 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 (()) { +void destroy (pointer __p) _RWSTD_ATTRIBUTE_NOTHROW { _RWSTD_ASSERT (0 != __p); __p-~_TypeT (); }
svn commit: r686554 - in /stdcxx/branches/4.2.x/include/rw: _config-acc.h _config-gcc.h _config-msvc.h _defs.h
Author: sebor Date: Sat Aug 16 12:48:12 2008 New Revision: 686554 URL: http://svn.apache.org/viewvc?rev=686554view=rev Log: 2008-08-16 Martin Sebor [EMAIL PROTECTED] STDCXX-1006 * include/rw/_config-acc.h (_RWSTD_NORETURN): New macro to decorate functions that do no return. Replaces _RWSTD_ATTRIBUTE_NORETURN to make it possible to use Visual C++ __declspec(noreturn). (_RWSTD_ATTRIBUTE_NORETURN): Renamed to _RWSTD_NORETURN. * include/rw/_config-gcc.h (_RWSTD_NORETURN, _RWSTD_ATTRIBUTE_NORETURN): Same as above. * include/rw/_config-msvc.h (_RWSTD_NORETURN): New. * include/rw/_defs.h (_RWSTD_ATTRIBUTE_NORETURN): Renamed to _RWSTD_NORETURN. (__rw_assert_fail): Used _RWSTD_NORETURN in a way to make the declaration well-formed for both acc/gcc and Visual C++. Modified: stdcxx/branches/4.2.x/include/rw/_config-acc.h stdcxx/branches/4.2.x/include/rw/_config-gcc.h stdcxx/branches/4.2.x/include/rw/_config-msvc.h stdcxx/branches/4.2.x/include/rw/_defs.h Modified: stdcxx/branches/4.2.x/include/rw/_config-acc.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_config-acc.h?rev=686554r1=686553r2=686554view=diff == --- stdcxx/branches/4.2.x/include/rw/_config-acc.h (original) +++ stdcxx/branches/4.2.x/include/rw/_config-acc.h Sat Aug 16 12:48:12 2008 @@ -99,8 +99,7 @@ #endif // __HPACC_NOEH #if 6 = _RWSTD_HP_aCC_MAJOR - // aCC 6 attribute((noreturn)) to indicate that a function + // aCC 6 attribute((noreturn)) indicates that a function // doesn't return (it may exit by throwing an exception) -# define _RWSTD_ATTRIBUTE_NORETURN __attribute__ ((noreturn)) +# define _RWSTD_NORETURN __attribute__ ((noreturn)) #endif // aCC = 6 - Modified: stdcxx/branches/4.2.x/include/rw/_config-gcc.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_config-gcc.h?rev=686554r1=686553r2=686554view=diff == --- stdcxx/branches/4.2.x/include/rw/_config-gcc.h (original) +++ stdcxx/branches/4.2.x/include/rw/_config-gcc.h Sat Aug 16 12:48:12 2008 @@ -84,9 +84,9 @@ #define _RWSTD_GNUC_ATTRIBUTE(attr) __attribute__ (attr) -// gcc attribute((noreturn)) to indicate that a function doesn't return +// gcc attribute((noreturn)) indicates that a function doesn't return // (it may still exit by throwing an exception or by calling longjmp) -#define _RWSTD_ATTRIBUTE_NORETURN _RWSTD_GNUC_ATTRIBUTE ((noreturn)) +#define _RWSTD_NORETURN __attribute__ ((noreturn)) #if __GNUG__ 3 || __GNUG__ == 3 __GNUC_MINOR__ = 3 // gcc attribute((nothrow)) to indicate that a function doesn't throw Modified: stdcxx/branches/4.2.x/include/rw/_config-msvc.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_config-msvc.h?rev=686554r1=686553r2=686554view=diff == --- stdcxx/branches/4.2.x/include/rw/_config-msvc.h (original) +++ stdcxx/branches/4.2.x/include/rw/_config-msvc.h Sat Aug 16 12:48:12 2008 @@ -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. * **/ @@ -86,3 +86,7 @@ // disable 'function': was declared deprecated #pragma warning (disable: 4996) + +// MSVC __declspec(noreturn) indicates that a function doesn't return +// see: http://msdn.microsoft.com/en-us/library/aa235362(VS.60).aspx +#define _RWSTD_NORETURN __declspec (noreturn) Modified: stdcxx/branches/4.2.x/include/rw/_defs.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_defs.h?rev=686554r1=686553r2=686554view=diff == --- stdcxx/branches/4.2.x/include/rw/_defs.h (original) +++ stdcxx/branches/4.2.x/include/rw/_defs.h Sat Aug 16 12:48:12 2008 @@ -1177,10 +1177,13 @@ #endif // _RWSTD_NO_EXCEPTION_SPECIFICATION_ON_NEW -#ifndef _RWSTD_ATTRIBUTE_NORETURN - // gcc (and others) __attribute__ ((noreturn)) -# define _RWSTD_ATTRIBUTE_NORETURN /* empty */ -#endif // _RWSTD_ATTR_NORETURN +#ifndef _RWSTD_NORETURN + // gcc (and some other) compilers provide __attribute__ ((noreturn)), + // MSVC has __declspec (noreturn); other compilers (e.g., Sun C++) + // may have a #pragma for the same thing, oothers still may not + // have an equivalent +# define _RWSTD_NORETURN /* empty */ +#endif // _RWSTD_NORETURN #ifdef _RWSTD_ATTRIBUTE_NOTHROW @@ -1195,7 +1198,7 @@ // be specified for both declarations and definitions # define _RWSTD_DECLARE_NOTHROW _THROWS(()) # define _RWSTD_DEFINE_NOTHROW _THROWS
svn commit: r686562 - /stdcxx/branches/4.2.x/etc/config/xlC_version.sh
Author: sebor Date: Sat Aug 16 14:03:35 2008 New Revision: 686562 URL: http://svn.apache.org/viewvc?rev=686562view=rev Log: 2008-08-16 Martin Sebor [EMAIL PROTECTED] * etc/config/xlC_version.sh: Added comments with info about recent versions and patches and rearranged in decreasing chronological order. Modified: stdcxx/branches/4.2.x/etc/config/xlC_version.sh Modified: stdcxx/branches/4.2.x/etc/config/xlC_version.sh URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/xlC_version.sh?rev=686562r1=686561r2=686562view=diff == --- stdcxx/branches/4.2.x/etc/config/xlC_version.sh (original) +++ stdcxx/branches/4.2.x/etc/config/xlC_version.sh Sat Aug 16 14:03:35 2008 @@ -30,25 +30,46 @@ # # versionrelease/patch # - -# 6.0.0.0VisualAge 6 -# 6.0.0.14 VisualAge 6, Septemmber 2005 PTF -# 6.0.0.17 VisualAge 6, November 2006 PTF -# 7.0VisualAge 7 -# 7.0.0.1VisualAge 7 November 2004 PTF -# 7.0.0.2VisualAge 7 May 2005 PTF -# 7.0.0.3VisualAge 7 Aug 2005 PTF -# 7.0.0.4??? -# 7.0.0.5VisualAge 7 January 2006 PTF -# 7.0.0.6VisualAge 7 April 2006 PTF -# 7.0.0.7VisualAge 7 August 2006 PTF -# 7.0.0.8VisualAge 7 October 2006 PTF -# 7.0.0.9VisualAge 7 Feb 2007 PTF -# 8.0.0.0XLC/C++ 8 -# 8.0.0.1XLC/C++ 8 March 2006 PTF -# 8.0.0.10 XLC/C++ 8 June 2006 PTF -# 8.0.0.11 XLC/C++ 8 August 2006 PTF -# 8.0.0.12 XLC/C++ 8 December 2006 PTF + +# 10.0.0.0 XLC/C++ 10 + +# 9.0.0.6XLC/C++ 9 August 2008 PTF +# 9.0.0.5XLC/C++ 9 July 2008 PTF +# 9.0.0.4XLC/C++ 9 April 2008 PTF +# 9.0.0.3XLC/C++ 9 January 2008 PTF +# 9.0.0.2XLC/C++ 9 October 2007 PTF +# 9.0.0.1N/A +# 9.0.0.0XLC/C++ 9 + +# 8.0.0.19 XLC/C++ 8 May 2008 PTF +# 8.0.0.18 XLC/C++ 8 February 2008 PTF +# 8.0.0.17 XLC/C++ 8 November 2007 PTF +# 8.0.0.16 XLC/C++ 8 August 2007 PTF +# 8.0.0.15 XLC/C++ 8 July 2007 PTF +# 8.0.0.14 XLC/C++ 8 May 2007 PTF # 8.0.0.13 XLC/C++ 8 February 2007 PTF +# 8.0.0.12 XLC/C++ 8 December 2006 PTF +# 8.0.0.11 XLC/C++ 8 August 2006 PTF +# 8.0.0.10 XLC/C++ 8 June 2006 PTF +# 8.0.0.xN/A for 3 = x = 9 +# 8.0.0.2XLC/C++ 8 May 2006 PTF +# 8.0.0.1XLC/C++ 8 March 2006 PTF +# 8.0.0.0XLC/C++ 8 + +# 7.0.0.9VisualAge 7 Feb 2007 PTF +# 7.0.0.8VisualAge 7 October 2006 PTF +# 7.0.0.7VisualAge 7 August 2006 PTF +# 7.0.0.6VisualAge 7 April 2006 PTF +# 7.0.0.5VisualAge 7 January 2006 PTF +# 7.0.0.4VisualAge 7 November 2005 PTF +# 7.0.0.3VisualAge 7 August05 PTF +# 7.0.0.2VisualAge 7 May 2005 PTF +# 7.0.0.1VisualAge 7 November 2004 PTF +# 7.0.0.0VisualAge 7 + +# 6.0.0.17 VisualAge 6, November 2006 PTF +# 6.0.0.14 VisualAge 6, September 2005 PTF +# 6.0.0.0VisualAge 6 if [ $# -gt 0 ]; then CXX=$1
svn commit: r684133 - in /stdcxx/branches/4.2.x: include/loc/ src/
Author: sebor Date: Fri Aug 8 15:41:56 2008 New Revision: 684133 URL: http://svn.apache.org/viewvc?rev=684133view=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=684133r1=684132r2=684133view=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=684133r1=684132r2=684133view=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=684133r1=684132r2=684133view=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
svn commit: r684134 - /stdcxx/branches/4.2.x/include/loc/_num_put.h
Author: sebor Date: Fri Aug 8 15:51:03 2008 New Revision: 684134 URL: http://svn.apache.org/viewvc?rev=684134view=rev Log: 2008-08-08 Martin Sebor [EMAIL PROTECTED] STDCXX-998 * include/loc/_num_put.h (~num_put): Added attribute nothrow to help optimizers generate better code. Modified: stdcxx/branches/4.2.x/include/loc/_num_put.h Modified: stdcxx/branches/4.2.x/include/loc/_num_put.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_num_put.h?rev=684134r1=684133r2=684134view=diff == --- stdcxx/branches/4.2.x/include/loc/_num_put.h (original) +++ stdcxx/branches/4.2.x/include/loc/_num_put.h Fri Aug 8 15:51:03 2008 @@ -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
svn commit: r684138 - in /stdcxx/branches/4.2.x: include/ostream include/rw/_file.h src/mman.cpp src/mman.h
Author: sebor Date: Fri Aug 8 16:14:30 2008 New Revision: 684138 URL: http://svn.apache.org/viewvc?rev=684138view=rev Log: 2008-08-08 Martin Sebor [EMAIL PROTECTED] 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. Modified: stdcxx/branches/4.2.x/include/ostream stdcxx/branches/4.2.x/include/rw/_file.h stdcxx/branches/4.2.x/src/mman.cpp stdcxx/branches/4.2.x/src/mman.h Modified: stdcxx/branches/4.2.x/include/ostream URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/ostream?rev=684138r1=684137r2=684138view=diff == --- stdcxx/branches/4.2.x/include/ostream (original) +++ stdcxx/branches/4.2.x/include/ostream Fri Aug 8 16:14:30 2008 @@ -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.2.x/include/rw/_file.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_file.h?rev=684138r1=684137r2=684138view=diff == --- stdcxx/branches/4.2.x/include/rw/_file.h (original) +++ stdcxx/branches/4.2.x/include/rw/_file.h Fri Aug 8 16:14:30 2008 @@ -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.2.x/src/mman.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/mman.cpp?rev=684138r1=684137r2=684138view=diff == --- stdcxx/branches/4.2.x/src/mman.cpp (original) +++ stdcxx/branches/4.2.x/src/mman.cpp Fri Aug 8 16:14:30 2008 @@ -45,6 +45,7 @@ #include sys/types.h #include fcntl.h +#include stdlib.h _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, _RWSTD_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, _RWSTD_SIZE_T size) // nothrow { _RWSTD_ASSERT (pcv size
svn commit: r681806 - /stdcxx/site/index.html
Author: sebor Date: Fri Aug 1 13:04:45 2008 New Revision: 681806 URL: http://svn.apache.org/viewvc?rev=681806view=rev Log: 2008-08-01 Martin Sebor [EMAIL PROTECTED] * index.html (Committers): Changed Brad's and Ravi's email addresses and removed outdated affiliation. Modified: stdcxx/site/index.html Modified: stdcxx/site/index.html URL: http://svn.apache.org/viewvc/stdcxx/site/index.html?rev=681806r1=681805r2=681806view=diff == --- stdcxx/site/index.html (original) +++ stdcxx/site/index.html Fri Aug 1 13:04:45 2008 @@ -936,15 +936,11 @@ tr td/td td - a href=mailto:lemings#64;roguewave.com; + a href=mailto:lemings#64;apache.org; Eric (Brad) Lemings /a /td -td -a class=external href=http://www.roguewave.com; -Rogue Wave Software, Inc. -/a -/td +td!-- affiliation --/td tdSep 5, 2007/td td/td /tr @@ -964,15 +960,11 @@ tr tdrpalepu/td td - a href=mailto:palepu#64;roguewave.com; + a href=mailto:palepu#64;apache.org; Ravi Palepu /a /td -td -a class=external href=http://www.roguewave.com; -Rogue Wave Software, Inc. -/a -/td +td!-- affiliation --/td tdMay 19, 2005/td tdEmeritus/td /tr
svn commit: r681808 - /stdcxx/site/index.html
Author: sebor Date: Fri Aug 1 13:06:27 2008 New Revision: 681808 URL: http://svn.apache.org/viewvc?rev=681808view=rev Log: 2008-08-01 Martin Sebor [EMAIL PROTECTED] * index.html (PMC): Updated Liviu's email address. Modified: stdcxx/site/index.html Modified: stdcxx/site/index.html URL: http://svn.apache.org/viewvc/stdcxx/site/index.html?rev=681808r1=681807r2=681808view=diff == --- stdcxx/site/index.html (original) +++ stdcxx/site/index.html Fri Aug 1 13:06:27 2008 @@ -1149,7 +1149,7 @@ tr tdlnicoara/td td -a href=mailto:nicoara#64;roguewave.com; +a href=mailto:nicoara#64;apache.org; Liviu Nicoara /a /td
svn commit: r681567 - /stdcxx/branches/4.3.x/tests/src/thread.cpp
Author: sebor Date: Thu Jul 31 17:42:00 2008 New Revision: 681567 URL: http://svn.apache.org/viewvc?rev=681567view=rev Log: 2008-07-31 Martin Sebor [EMAIL PROTECTED] * tests/src/thread.cpp [_RWSTD_POSIX_THREADS]: Simplified preprocessor conditional logic introduced in rev 680574. Modified: stdcxx/branches/4.3.x/tests/src/thread.cpp Modified: stdcxx/branches/4.3.x/tests/src/thread.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/src/thread.cpp?rev=681567r1=681566r2=681567view=diff == --- stdcxx/branches/4.3.x/tests/src/thread.cpp (original) +++ stdcxx/branches/4.3.x/tests/src/thread.cpp Thu Jul 31 17:42:00 2008 @@ -84,18 +84,12 @@ #if defined (_RWSTD_POSIX_THREADS) -# if defined (__linux__) -#ifdefined (__EDG__)\ - !defined (__DECCXX) \ - !defined (__HP_aCC) \ - !defined (__INTEL_COMPILER) \ - !defined (_SGI_COMPILER_VERSION) - // disable error #450-D: the type long long is nonstandard - // when using the vanilla EDG eccp in strict mode (i.e., w/o - // long long support) -# pragma diag_suppress 450 -#endif // vanilla EDG eccp on Linux -# endif +# ifdef _RWSTD_EDG_ECCP + // disable error #450-D: the type long long is nonstandard + // issued for uses of the type in Linux system headers (e.g., + // pthreadtypes.h) +#pragma diag_suppress 450 +# endif // vanilla EDG eccp demo # include pthread.h
svn commit: r681568 - /stdcxx/branches/4.2.x/tests/src/thread.cpp
Author: sebor Date: Thu Jul 31 17:45:11 2008 New Revision: 681568 URL: http://svn.apache.org/viewvc?rev=681568view=rev Log: 2008-07-31 Martin Sebor [EMAIL PROTECTED] Merged revs 680574 and 681567 from 4.3.x. 2008-07-28 Travis Vitek [EMAIL PROTECTED] * tests/src/thread.cpp [__EDG__]: Disable error for use of long long in pthreadtypes.h system header. 2008-07-31 Martin Sebor [EMAIL PROTECTED] * tests/src/thread.cpp [_RWSTD_POSIX_THREADS]: Simplified preprocessor conditional logic introduced in rev 680574. Modified: stdcxx/branches/4.2.x/tests/src/thread.cpp Modified: stdcxx/branches/4.2.x/tests/src/thread.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/thread.cpp?rev=681568r1=681567r2=681568view=diff == --- stdcxx/branches/4.2.x/tests/src/thread.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/thread.cpp Thu Jul 31 17:45:11 2008 @@ -83,6 +83,14 @@ #if defined (_RWSTD_POSIX_THREADS) + +# ifdef _RWSTD_EDG_ECCP + // disable error #450-D: the type long long is nonstandard + // issued for uses of the type in Linux system headers (e.g., + // pthreadtypes.h) +#pragma diag_suppress 450 +# endif // vanilla EDG eccp demo + # include pthread.h _TEST_EXPORT int
svn commit: r681581 - /stdcxx/branches/4.2.x/src/string.cpp
Author: sebor Date: Thu Jul 31 18:43:03 2008 New Revision: 681581 URL: http://svn.apache.org/viewvc?rev=681581view=rev Log: 2008-07-31 Martin Sebor [EMAIL PROTECTED] * src/string.cpp: Globally replaced all uses of the _RWSTD_SIZE_T macro (necessary in library headers for namespace cleanliness) with the equivalent typedef. Modified: stdcxx/branches/4.2.x/src/string.cpp Modified: stdcxx/branches/4.2.x/src/string.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/string.cpp?rev=681581r1=681580r2=681581view=diff == --- stdcxx/branches/4.2.x/src/string.cpp (original) +++ stdcxx/branches/4.2.x/src/string.cpp Thu Jul 31 18:43:03 2008 @@ -27,12 +27,14 @@ #define _RWSTD_LIB_SRC #include rw/_defs.h +#include stddef.h // for size_t + _RWSTD_NAMESPACE (__rw) { _RWSTD_EXPORT void* -__rw_memcpy (void *dst, const void *src, _RWSTD_SIZE_T nbytes) +__rw_memcpy (void *dst, const void *src, size_t nbytes) { _RWSTD_ASSERT (0 == nbytes || dst src); @@ -46,7 +48,7 @@ _RWSTD_EXPORT void* -__rw_memmove (void *dst, const void *src, _RWSTD_SIZE_T nbytes) +__rw_memmove (void *dst, const void *src, size_t nbytes) { _RWSTD_ASSERT (0 == nbytes || dst src); @@ -67,7 +69,7 @@ _RWSTD_EXPORT const void* -__rw_memchr (const void *src, int c, _RWSTD_SIZE_T nbytes) +__rw_memchr (const void *src, int c, size_t nbytes) { _RWSTD_ASSERT (0 == nbytes || src); @@ -85,7 +87,7 @@ _RWSTD_EXPORT void* -__rw_memset (void *dst, int c, _RWSTD_SIZE_T nbytes) +__rw_memset (void *dst, int c, size_t nbytes) { _RWSTD_ASSERT (0 == nbytes || dst); @@ -97,7 +99,7 @@ _RWSTD_EXPORT int -__rw_memcmp (const void *s1, const void *s2, _RWSTD_SIZE_T nbytes) +__rw_memcmp (const void *s1, const void *s2, size_t nbytes) { _RWSTD_ASSERT (0 == nbytes || s1 s2); @@ -114,21 +116,21 @@ } -_RWSTD_EXPORT _RWSTD_SIZE_T +_RWSTD_EXPORT size_t __rw_strlen (const char *str) { const char* const begin = str; for (; *str; ++str); -return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, str - begin); +return _RWSTD_STATIC_CAST (size_t, str - begin); } #ifndef _RWSTD_NO_WCHAR_T _RWSTD_EXPORT wchar_t* -__rw_wmemcpy (wchar_t *dst, const wchar_t *src, _RWSTD_SIZE_T nwchars) +__rw_wmemcpy (wchar_t *dst, const wchar_t *src, size_t nwchars) { _RWSTD_ASSERT (0 == nwchars || dst src); @@ -140,7 +142,7 @@ _RWSTD_EXPORT wchar_t* -__rw_wmemmove (wchar_t *dst, const wchar_t *src, _RWSTD_SIZE_T nwchars) +__rw_wmemmove (wchar_t *dst, const wchar_t *src, size_t nwchars) { _RWSTD_ASSERT (0 == nwchars || dst src); @@ -158,7 +160,7 @@ _RWSTD_EXPORT const wchar_t* -__rw_wmemchr (const wchar_t *src, wchar_t wc, _RWSTD_SIZE_T nwchars) +__rw_wmemchr (const wchar_t *src, wchar_t wc, size_t nwchars) { _RWSTD_ASSERT (0 == nwchars || src); @@ -172,7 +174,7 @@ _RWSTD_EXPORT wchar_t* -__rw_wmemset (wchar_t *dst, wchar_t wc, _RWSTD_SIZE_T nwchars) +__rw_wmemset (wchar_t *dst, wchar_t wc, size_t nwchars) { _RWSTD_ASSERT (0 == nwchars || dst); @@ -184,7 +186,7 @@ _RWSTD_EXPORT int -__rw_wmemcmp (const wchar_t *s1, const wchar_t *s2, _RWSTD_SIZE_T nwchars) +__rw_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t nwchars) { _RWSTD_ASSERT (0 == nwchars || s1 s2); @@ -196,7 +198,7 @@ } -_RWSTD_EXPORT _RWSTD_SIZE_T +_RWSTD_EXPORT size_t __rw_wcslen (const wchar_t *wstr) { _RWSTD_ASSERT (0 != wstr); @@ -205,7 +207,7 @@ for (; *wstr; ++wstr); -return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, wstr - begin); +return _RWSTD_STATIC_CAST (size_t, wstr - begin); } #endif // _RWSTD_NO_WCHAR_T
svn commit: r681102 - /stdcxx/branches/4.2.x/include/rw/_defs.h
Author: sebor Date: Wed Jul 30 09:14:03 2008 New Revision: 681102 URL: http://svn.apache.org/viewvc?rev=681102view=rev Log: 2008-07-30 Martin Sebor [EMAIL PROTECTED] * include/rw/_defs.h (_RWSTD_ATTRIBUTE_NOTHROW): Defined as a no-op when the attribute isn't supported by the compiler to make the macro portably usable. (__rw_assert_fail): Inverted the order of the function attribute and exception specification to prevent compiler errors. Modified: stdcxx/branches/4.2.x/include/rw/_defs.h Modified: stdcxx/branches/4.2.x/include/rw/_defs.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_defs.h?rev=681102r1=681101r2=681102view=diff == --- stdcxx/branches/4.2.x/include/rw/_defs.h (original) +++ stdcxx/branches/4.2.x/include/rw/_defs.h Wed Jul 30 09:14:03 2008 @@ -1189,6 +1189,8 @@ // attributes cannot appear on function definitions # define _RWSTD_DEFINE_NOTHROW /* empty */ #else + // make the macro usable even when it doesn't do anything +# define _RWSTD_ATTRIBUTE_NOTHROW /* empty */ // emulate using empty exception specifications which must // be specified for both declarations and definitions # define _RWSTD_DECLARE_NOTHROW _THROWS(()) @@ -1217,7 +1219,7 @@ // called for failed assertions void _RWSTD_EXPORT __rw_assert_fail (const char*, const char*, int, const char*) -_RWSTD_ATTRIBUTE_NORETURN _RWSTD_DECLARE_NOTHROW; +_RWSTD_DECLARE_NOTHROW _RWSTD_ATTRIBUTE_NORETURN;
svn commit: r680756 - in /stdcxx/branches/4.2.x: include/loc/_codecvt.cc include/loc/_codecvt.h include/loc/_collate.cc include/loc/_collate.h include/loc/_moneypunct.cc include/loc/_moneypunct.h src/
Author: sebor Date: Tue Jul 29 09:24:16 2008 New Revision: 680756 URL: http://svn.apache.org/viewvc?rev=680756view=rev Log: 2008-07-29 Martin Sebor [EMAIL PROTECTED] * include/loc/_moneypunct.h (~moneypunct): Explicitly declared to prevent the compiler from generating a definition (and vtable) in every translation unit that uses the class. * include/loc/_codecvt.h (~codecvt, ~codecvt_byname): Same. * include/loc/_collate.h (~collate, ~collate_byname): Same. * include/loc/_codecvt.cc (~codecvt, ~codecvt_byname): Defined. * include/loc/_moneypunct.cc (~moneypunct): Same. * include/loc/_collate.cc (~collate, ~collate_byname): Same. * src/collate.cpp (~collate, ~collate_byname): Same. * src/codecvt.cpp (~codecvt): Same. * src/wcodecvt.cpp (~codecvt, ~codecvt_byname): Defined. Modified: stdcxx/branches/4.2.x/include/loc/_codecvt.cc stdcxx/branches/4.2.x/include/loc/_codecvt.h stdcxx/branches/4.2.x/include/loc/_collate.cc stdcxx/branches/4.2.x/include/loc/_collate.h stdcxx/branches/4.2.x/include/loc/_moneypunct.cc stdcxx/branches/4.2.x/include/loc/_moneypunct.h stdcxx/branches/4.2.x/src/codecvt.cpp stdcxx/branches/4.2.x/src/collate.cpp stdcxx/branches/4.2.x/src/wcodecvt.cpp Modified: stdcxx/branches/4.2.x/include/loc/_codecvt.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_codecvt.cc?rev=680756r1=680755r2=680756view=diff == --- stdcxx/branches/4.2.x/include/loc/_codecvt.cc (original) +++ stdcxx/branches/4.2.x/include/loc/_codecvt.cc Tue Jul 29 09:24:16 2008 @@ -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. * **/ @@ -35,7 +35,26 @@ template class _InternT, class _ExternT, class _StateT _RW::__rw_facet_id codecvt_InternT, _ExternT, _StateT::id; + +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template class _InternT, class _ExternT, class _StateT +/* virtual */ codecvt_InternT, _ExternT, _StateT:: +~codecvt () /* nothrow */ +{ +// no-op +} + #endif // _RWSTD_NO_EXT_CODECVT_PRIMARY +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template class _InternT, class _ExternT, class _StateT +/* virtual */ codecvt_byname_InternT, _ExternT, _StateT:: +~codecvt_byname () /* nothrow */ +{ +// no-op +} + } // namespace std 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=680756r1=680755r2=680756view=diff == --- stdcxx/branches/4.2.x/include/loc/_codecvt.h (original) +++ stdcxx/branches/4.2.x/include/loc/_codecvt.h Tue Jul 29 09:24:16 2008 @@ -120,6 +120,8 @@ _EXPLICIT codecvt (_RWSTD_SIZE_T __ref = 0): _RW::__rw_facet (__ref) { } +virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; + // 22,2,1,5,1, p1 result out (state_type __state, const intern_type* __from, const intern_type* __from_end, @@ -188,7 +190,7 @@ _EXPLICIT codecvt (_RWSTD_SIZE_T = 0); -virtual ~codecvt (); +virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; result out (state_type __state, const intern_type *__from, const intern_type* __from_end, @@ -332,6 +334,8 @@ _EXPLICIT codecvt (_RWSTD_SIZE_T = 0); +virtual ~codecvt () _RWSTD_ATTRIBUTE_NOTHROW; + result out (state_type __state, const intern_type *__from, const intern_type *__from_end, const intern_type *__from_next, @@ -398,6 +402,8 @@ : codecvt _InternT, _ExternT, _StateT (__ref) { this-_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + +virtual ~codecvt_byname () _RWSTD_ATTRIBUTE_NOTHROW; }; @@ -415,6 +421,8 @@ _EXPLICIT codecvt_byname (const char*, _RWSTD_SIZE_T = 0); +virtual ~codecvt_byname () _RWSTD_ATTRIBUTE_NOTHROW; + protected: virtual codecvt_base::result Modified: stdcxx/branches/4.2.x/include/loc/_collate.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_collate.cc?rev=680756r1=680755r2=680756view=diff == --- stdcxx/branches/4.2.x/include/loc/_collate.cc (original) +++ stdcxx/branches/4.2.x/include/loc/_collate.cc Tue Jul 29 09:24:16 2008 @@ -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
svn commit: r680775 - in /stdcxx/branches/4.2.x/include/loc: _messages.cc _messages.h _money_put.cc _money_put.h _moneypunct.cc _moneypunct.h _numpunct.cc _numpunct.h _time_get.cc _time_get.h _time_pu
Author: sebor Date: Tue Jul 29 10:06:50 2008 New Revision: 680775 URL: http://svn.apache.org/viewvc?rev=680775view=rev Log: 2008-07-29 Martin Sebor [EMAIL PROTECTED] * include/loc/_messages.h (~messages, ~messages_byname): Explicitly declared dtors to prevent the compiler from emitting function and vtable definition in every translation unit that uses the class. * include/loc/_money_put.h (~money_put): Same. * include/loc/_moneypunct.h (~moneypunct_byname): Same. * include/loc/_numpunct.h (~numpunct_byname): Same. * include/loc/_time_get.h (~time_get, ~time_get_byname): Same. * include/loc/_time_put.h (~time_put, ~time_put_byname): Same. * include/loc/_money_put.cc (~money_put): Defined. * include/loc/_time_get.cc (~time_get, ~time_get_byname): Same. * include/loc/_moneypunct.cc (~moneypunct_byname): Same. * include/loc/_messages.cc (~messages, ~messages_byname): Same. * include/loc/_numpunct.cc (~numpunct_byname): Same. * include/loc/_time_put.cc (~time_put, ~time_put_byname): Same. Modified: stdcxx/branches/4.2.x/include/loc/_messages.cc stdcxx/branches/4.2.x/include/loc/_messages.h stdcxx/branches/4.2.x/include/loc/_money_put.cc stdcxx/branches/4.2.x/include/loc/_money_put.h stdcxx/branches/4.2.x/include/loc/_moneypunct.cc stdcxx/branches/4.2.x/include/loc/_moneypunct.h stdcxx/branches/4.2.x/include/loc/_numpunct.cc stdcxx/branches/4.2.x/include/loc/_numpunct.h stdcxx/branches/4.2.x/include/loc/_time_get.cc stdcxx/branches/4.2.x/include/loc/_time_get.h stdcxx/branches/4.2.x/include/loc/_time_put.cc stdcxx/branches/4.2.x/include/loc/_time_put.h Modified: stdcxx/branches/4.2.x/include/loc/_messages.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_messages.cc?rev=680775r1=680774r2=680775view=diff == --- stdcxx/branches/4.2.x/include/loc/_messages.cc (original) +++ stdcxx/branches/4.2.x/include/loc/_messages.cc Tue Jul 29 10:06:50 2008 @@ -36,6 +36,16 @@ _RW::__rw_facet_id messages_CharT::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template class _CharT +/* virtual */ messages_CharT:: +~messages () +{ +// no-op +} + + template class _CharT messages_base::catalog messages_CharT:: @@ -141,4 +151,14 @@ } +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template class _CharT +/* virtual */ messages_byname_CharT:: +~messages_byname () +{ +// no-op +} + + } // namespace std Modified: stdcxx/branches/4.2.x/include/loc/_messages.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_messages.h?rev=680775r1=680774r2=680775view=diff == --- stdcxx/branches/4.2.x/include/loc/_messages.h (original) +++ stdcxx/branches/4.2.x/include/loc/_messages.h Tue Jul 29 10:06:50 2008 @@ -84,6 +84,7 @@ _EXPLICIT messages (_RWSTD_SIZE_T __refs = 0) : _RW::__rw_facet (__refs) { } +virtual ~messages () _RWSTD_ATTRIBUTE_NOTHROW; catalog open (const string __fun, const locale __loc) const { return do_open (__fun, __loc); @@ -136,6 +137,8 @@ : messages_CharT(__refs) { this-_C_set_name (__name, _C_namebuf, sizeof _C_namebuf); } + +virtual ~messages_byname () _RWSTD_ATTRIBUTE_NOTHROW; }; } // namespace std Modified: stdcxx/branches/4.2.x/include/loc/_money_put.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_money_put.cc?rev=680775r1=680774r2=680775view=diff == --- stdcxx/branches/4.2.x/include/loc/_money_put.cc (original) +++ stdcxx/branches/4.2.x/include/loc/_money_put.cc Tue Jul 29 10:06:50 2008 @@ -51,6 +51,16 @@ _RW::__rw_facet_id money_put_CharT, _OutputIter::id; +// outlined to avoid generating a vtable in each translation unit +// that uses the class +template class _CharT, class _OutputIter +/* virtual */ money_put_CharT, _OutputIter:: +~money_put () /* nothrow */ +{ +// no-op +} + + template class _CharT, class _OutputIter /* private */ _TYPENAME money_put_CharT, _OutputIter::iter_type money_put_CharT, _OutputIter:: Modified: stdcxx/branches/4.2.x/include/loc/_money_put.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_money_put.h?rev=680775r1=680774r2=680775view=diff == --- stdcxx/branches/4.2.x/include/loc/_money_put.h (original) +++ stdcxx/branches/4.2.x/include/loc/_money_put.h Tue Jul 29 10:06:50 2008 @@ -63,6 +63,8 @@ _EXPLICIT money_put (_RWSTD_SIZE_T __ref = 0) : _RW::__rw_facet (__ref) { } +virtual ~money_put () _RWSTD_ATTRIBUTE_NOTHROW
svn propchange: r680756 - svn:log
Author: sebor Revision: 680756 Modified property: svn:log Modified: svn:log at Tue Jul 29 11:09:47 2008 -- --- svn:log (original) +++ svn:log Tue Jul 29 11:09:47 2008 @@ -2,7 +2,8 @@ * include/loc/_moneypunct.h (~moneypunct): Explicitly declared to prevent the compiler from generating a definition (and vtable) - in every translation unit that uses the class. + in every translation unit that uses the class. Pursuant to + STDCXX-998, made use of attribute((nothrow)) where available. * include/loc/_codecvt.h (~codecvt, ~codecvt_byname): Same. * include/loc/_collate.h (~collate, ~collate_byname): Same. * include/loc/_codecvt.cc (~codecvt, ~codecvt_byname): Defined.
svn commit: r680049 - in /stdcxx/branches/4.2.x/include/rw: _config-gcc.h _defs.h
Author: sebor Date: Sat Jul 26 15:09:58 2008 New Revision: 680049 URL: http://svn.apache.org/viewvc?rev=680049view=rev Log: 2008-07-26 Martin Sebor [EMAIL PROTECTED] STDCXX-998 * include/rw/_defs.h [_RWSTD_ATTRIBUTE_NOTHROW] (_RWSTD_DECLARE_NOTHROW, _RWSTD_DEFINE_NOTHROW): Defined new helper macros to make it possible to declare functions with the attribute((nothrow)) when it's available and to use the empty exception specification to emulate the same feature when it isn't. (__rw_assert_fail): Used _RWSTD_DECLARE_NOTHROW. * include/rw/_config-gcc.h [gcc = 3.3] (RWSTD_ATTRIBUTE_NOTHROW): Defined. Modified: stdcxx/branches/4.2.x/include/rw/_config-gcc.h stdcxx/branches/4.2.x/include/rw/_defs.h Modified: stdcxx/branches/4.2.x/include/rw/_config-gcc.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_config-gcc.h?rev=680049r1=680048r2=680049view=diff == --- stdcxx/branches/4.2.x/include/rw/_config-gcc.h (original) +++ stdcxx/branches/4.2.x/include/rw/_config-gcc.h Sat Jul 26 15:09:58 2008 @@ -88,6 +88,13 @@ // (it may still exit by throwing an exception or by calling longjmp) #define _RWSTD_ATTRIBUTE_NORETURN _RWSTD_GNUC_ATTRIBUTE ((noreturn)) +#if __GNUG__ 3 || __GNUG__ == 3 __GNUC_MINOR__ = 3 + // gcc attribute((nothrow)) to indicate that a function doesn't throw + // exceptions; unlike the emtpy exception specification the attribute + // avoids the cost of checking for exceptions and calling unexpected() +# define _RWSTD_ATTRIBUTE_NOTHROW _RWSTD_GNUC_ATTRIBUTE ((nothrow)) +#endif // gcc = 3.3 + #ifdef _RWSTD_OS_LINUX # ifdef _RWSTD_NO_NEW_HEADER Modified: stdcxx/branches/4.2.x/include/rw/_defs.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_defs.h?rev=680049r1=680048r2=680049view=diff == --- stdcxx/branches/4.2.x/include/rw/_defs.h (original) +++ stdcxx/branches/4.2.x/include/rw/_defs.h Sat Jul 26 15:09:58 2008 @@ -1133,6 +1133,19 @@ #endif // _RWSTD_ATTR_NORETURN +#ifdef _RWSTD_ATTRIBUTE_NOTHROW + // gcc (and others) __attribute__ ((nothrow)) +# define _RWSTD_DECLARE_NOTHROW _RWSTD_ATTRIBUTE_NOTHROW + // attributes cannot appear on function definitions +# define _RWSTD_DEFINE_NOTHROW /* empty */ +#else + // emulate using empty exception specifications which must + // be specified for both declarations and definitions +# define _RWSTD_DECLARE_NOTHROW _THROWS(()) +# define _RWSTD_DEFINE_NOTHROW _THROWS(()) +#endif // _RWSTD_ATTR_NORETURN + + // compile-time assertion - asserts constant expressions during // compilation with no runtime overhead; failed assertions are reported // as compilation errors @@ -1154,7 +1167,8 @@ // called for failed assertions void _RWSTD_EXPORT __rw_assert_fail (const char*, const char*, int, const char*) -_RWSTD_ATTRIBUTE_NORETURN; +_RWSTD_ATTRIBUTE_NORETURN _RWSTD_DECLARE_NOTHROW; + #ifdef __SUNPRO_CC
svn commit: r680050 - /stdcxx/branches/4.2.x/src/assert.cpp
Author: sebor Date: Sat Jul 26 15:11:39 2008 New Revision: 680050 URL: http://svn.apache.org/viewvc?rev=680050view=rev Log: 2008-07-26 Martin Sebor [EMAIL PROTECTED] STDCXX-998 * src/assert.cpp (U_STACK_TRACE, __rw_stack_trace, printstack, __rw_assert_fail): Declared nothrow. Modified: stdcxx/branches/4.2.x/src/assert.cpp Modified: stdcxx/branches/4.2.x/src/assert.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/assert.cpp?rev=680050r1=680049r2=680050view=diff == --- stdcxx/branches/4.2.x/src/assert.cpp (original) +++ stdcxx/branches/4.2.x/src/assert.cpp Sat Jul 26 15:11:39 2008 @@ -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. * **/ @@ -37,7 +37,7 @@ #ifdef __HP_aCC -extern C void U_STACK_TRACE (); +extern C void U_STACK_TRACE () _RWSTD_DECLARE_NOTHROW; # define STACK_TRACE U_STACK_TRACE @@ -47,8 +47,14 @@ _RWSTD_NAMESPACE (__rw) { +// declare with attribute((nothrow)) since the function calls +// others that may not be declared nothrow static void -__rw_stack_trace (int fd) +__rw_stack_trace (int fd) _RWSTD_DECLARE_NOTHROW; + + +static void +__rw_stack_trace (int fd) _RWSTD_DEFINE_NOTHROW { // limit stacktrace to the depth of 256 calls void* array [256]; @@ -70,7 +76,7 @@ // having to #define enabling macros (i.e., __EXTENSIONS__) and deal // with the breakage when using a strict compiler such as EDG eccp // with the long long extension (used in some system headers) disabled -extern C int printstack (int); +extern C int printstack (int) _RWSTD_DECLARE_NOTHROW; #define STACK_TRACE() printstack (2) #endif @@ -86,6 +92,7 @@ _RWSTD_EXPORT void __rw_assert_fail (const char *expr, const char *file, int line, const char *func) + _RWSTD_DEFINE_NOTHROW { // func may be 0 if the compiler doesn't support the ANSI C predefined // identifier `__func__' (see 6.4.2.2 of ISO/IEC 9899:1999) or an
svn commit: r680051 - in /stdcxx/branches/4.2.x/src: strtol.cpp strtol.h
Author: sebor Date: Sat Jul 26 15:14:48 2008 New Revision: 680051 URL: http://svn.apache.org/viewvc?rev=680051view=rev Log: 2008-07-26 Martin Sebor [EMAIL PROTECTED] STDCXX-998 * src/strtol.h (__rw_strtol, __rw_strtoll): Declared nothrow. (__rw_strtoul, __rw_strtoull): Same. * src/strtol.cpp: Same. Modified: stdcxx/branches/4.2.x/src/strtol.cpp stdcxx/branches/4.2.x/src/strtol.h Modified: stdcxx/branches/4.2.x/src/strtol.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/strtol.cpp?rev=680051r1=680050r2=680051view=diff == --- stdcxx/branches/4.2.x/src/strtol.cpp (original) +++ stdcxx/branches/4.2.x/src/strtol.cpp Sat Jul 26 15:14:48 2008 @@ -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. * **/ @@ -192,7 +192,7 @@ unsigned long -__rw_strtoul (const char *nptr, int *errptr, int base) +__rw_strtoul (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (0 != nptr); _RWSTD_ASSERT (0 != errptr); @@ -395,7 +395,7 @@ long -__rw_strtol (const char *nptr, int *errptr, int base) +__rw_strtol (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (0 != nptr); _RWSTD_ASSERT (0 != errptr); @@ -626,7 +626,7 @@ # if (_RWSTD_LONG_SIZE _RWSTD_LLONG_SIZE) ULLong -__rw_strtoull (const char *nptr, int *errptr, int base) +__rw_strtoull (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (0 != nptr); _RWSTD_ASSERT (0 != errptr); @@ -813,7 +813,7 @@ LLong -__rw_strtoll (const char *nptr, int *errptr, int base) +__rw_strtoll (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (0 != nptr); _RWSTD_ASSERT (0 != errptr); Modified: stdcxx/branches/4.2.x/src/strtol.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/strtol.h?rev=680051r1=680050r2=680051view=diff == --- stdcxx/branches/4.2.x/src/strtol.h (original) +++ stdcxx/branches/4.2.x/src/strtol.h Sat Jul 26 15:14:48 2008 @@ -39,10 +39,10 @@ // same as strtoul() except that the source sequence must start // with a sign (either '+' or '-') unsigned long -__rw_strtoul (const char*, int*, int); +__rw_strtoul (const char*, int*, int) _THROWS (()); long -__rw_strtol (const char*, int*, int); +__rw_strtol (const char*, int*, int) _THROWS (()); #ifdef _RWSTD_LONG_LONG @@ -52,7 +52,7 @@ # if (_RWSTD_LLONG_SIZE = _RWSTD_LONG_SIZE) inline unsigned _RWSTD_LONG_LONG -__rw_strtoull (const char *nptr, int *errptr, int base) +__rw_strtoull (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (sizeof (_RWSTD_LONG_LONG) == sizeof (long)); @@ -61,7 +61,7 @@ inline _RWSTD_LONG_LONG -__rw_strtoll (const char *nptr, int *errptr, int base) +__rw_strtoll (const char *nptr, int *errptr, int base) _THROWS (()) { _RWSTD_ASSERT (sizeof (_RWSTD_LONG_LONG) == sizeof (long)); @@ -71,10 +71,10 @@ # else // if (_RWSTD_LLONG_SIZE _RWSTD_LONG_SIZE) unsigned _RWSTD_LONG_LONG -__rw_strtoull (const char*, int*, int); +__rw_strtoull (const char*, int*, int) _THROWS (()); _RWSTD_LONG_LONG -__rw_strtoll (const char*, int*, int); +__rw_strtoll (const char*, int*, int) _THROWS (()); # endif // _RWSTD_LLONG_SIZE = _RWSTD_LONG_SIZE #endif // _RWSTD_LONG_LONG
svn commit: r679610 - /stdcxx/branches/4.2.x/include/rw/_defs.h
Author: sebor Date: Thu Jul 24 16:15:29 2008 New Revision: 679610 URL: http://svn.apache.org/viewvc?rev=679610view=rev Log: 2008-07-24 Martin Sebor [EMAIL PROTECTED] STDCXX-997 * include/rw/_defs.h [__SUNPRO_CC] (__rw_assert_fail): Declared with #pragma does_not_return for efficiency. Modified: stdcxx/branches/4.2.x/include/rw/_defs.h Modified: stdcxx/branches/4.2.x/include/rw/_defs.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_defs.h?rev=679610r1=679609r2=679610view=diff == --- stdcxx/branches/4.2.x/include/rw/_defs.h (original) +++ stdcxx/branches/4.2.x/include/rw/_defs.h Thu Jul 24 16:15:29 2008 @@ -1156,6 +1156,12 @@ __rw_assert_fail (const char*, const char*, int, const char*) _RWSTD_ATTRIBUTE_NORETURN; + +#ifdef __SUNPRO_CC + // help Sun C++ optimizer generate better code +# pragma does_not_return (__rw_assert_fail) +#endif // __SUNPRO_CC + } // extern C++ } // namespace __rw
svn commit: r679241 - /stdcxx/branches/4.2.x/include/bitset
Author: sebor Date: Wed Jul 23 17:12:20 2008 New Revision: 679241 URL: http://svn.apache.org/viewvc?rev=679241view=rev Log: 2008-07-23 Martin Sebor [EMAIL PROTECTED] STDCXX-997 * include/bitset [__SUNPRO_CC] (__rw_bitset, __rw_bit_count, __rw_shl, __rw_shr): Used #pragma no_side_effects to help the optimizer generate better code. Modified: stdcxx/branches/4.2.x/include/bitset Modified: stdcxx/branches/4.2.x/include/bitset URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/bitset?rev=679241r1=679240r2=679241view=diff == --- stdcxx/branches/4.2.x/include/bitset (original) +++ stdcxx/branches/4.2.x/include/bitset Wed Jul 23 17:12:20 2008 @@ -58,6 +58,10 @@ _RWSTD_SIZE_T, _RWSTD_SIZE_T, const char*, const char*); +#ifdef __SUNPRO_CC +# pragma no_side_effects (__rw_bitset) +#endif // Sun C++ + #ifndef _RWSTD_NO_WCHAR_T _RWSTD_SPECIALIZED_FUNCTION @@ -68,6 +72,9 @@ _RWSTD_SIZE_T, _RWSTD_SIZE_T, const char*, const char*); +# ifdef __SUNPRO_CC +#pragma no_side_effects (__rw_bitset) +# endif // Sun C++ #endif // _RWSTD_NO_WCHAR_T // helper, implements bitset::count() @@ -81,6 +88,10 @@ _RWSTD_EXPORT void __rw_shr (unsigned long*, _RWSTD_SIZE_T, _RWSTD_SIZE_T) _THROWS (()); +#ifdef __SUNPRO_CC +# pragma no_side_effects (__rw_bit_count, __rw_shl, __rw_shr) +#endif // Sun C++ + } // namespace __rw
svn commit: r678619 - /stdcxx/branches/4.2.x/NOTICE.txt
Author: sebor Date: Mon Jul 21 19:09:56 2008 New Revision: 678619 URL: http://svn.apache.org/viewvc?rev=678619view=rev Log: 2008-07-21 Martin Sebor [EMAIL PROTECTED] STDCXX-999 * NOTICE.txt: Updated year of copyright. Modified: stdcxx/branches/4.2.x/NOTICE.txt Modified: stdcxx/branches/4.2.x/NOTICE.txt URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/NOTICE.txt?rev=678619r1=678618r2=678619view=diff == --- stdcxx/branches/4.2.x/NOTICE.txt (original) +++ stdcxx/branches/4.2.x/NOTICE.txt Mon Jul 21 19:09:56 2008 @@ -1,12 +1,12 @@ Apache C++ Standard Library - stdcxx -Copyright 2005-2007 The Apache Software Foundation. +Copyright 2005-2008 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Portions of this software were developed at Rogue Wave Software, Inc., -Copyright (c) 1994-2007. +Copyright (c) 1994-2008. This software contains code derived from the HP Standard Template Library, Copyright (c) 1994 Hewlett-Packard Company.
svn commit: r678239 - /stdcxx/branches/4.2.x/src/strtol.h
Author: sebor Date: Sat Jul 19 16:25:45 2008 New Revision: 678239 URL: http://svn.apache.org/viewvc?rev=678239view=rev Log: 2008-07-19 Martin Sebor [EMAIL PROTECTED] STDCXX-997 * src/strtol.cpp [__SUNPRO_CC] (__rw_strtol, __rw_strtoul): Used #pragma no_side_effects to help Sun C++ optimizer generate better code (about 5% improvement was measured). [__SUNPRO_CC _RWSTD_LONG_LONG] (__rw_strtoll, __rw_strtoull): Same. Modified: stdcxx/branches/4.2.x/src/strtol.h Modified: stdcxx/branches/4.2.x/src/strtol.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/strtol.h?rev=678239r1=678238r2=678239view=diff == --- stdcxx/branches/4.2.x/src/strtol.h (original) +++ stdcxx/branches/4.2.x/src/strtol.h Sat Jul 19 16:25:45 2008 @@ -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-2008 Rogue Wave Software, Inc. * **/ @@ -35,11 +35,14 @@ _RWSTD_EXPORT extern const unsigned char __rw_digit_map[]; + +// same as strtoul() except that the source sequence must start +// with a sign (either '+' or '-') unsigned long - __rw_strtoul (const char*, int*, int); +__rw_strtoul (const char*, int*, int); long - __rw_strtol (const char*, int*, int); +__rw_strtol (const char*, int*, int); #ifdef _RWSTD_LONG_LONG @@ -77,4 +80,20 @@ #endif // _RWSTD_LONG_LONG +#ifdef __SUNPRO_CC + + // tell the Sun C++ optimizer that the functions do not access + // for reading or writing any part of the program state (either + // visible at in the caller at the point of the call, or not) +# pragma no_side_effect (__rw_strtoul) +# pragma no_side_effect (__rw_strtol) + +# ifdef _RWSTD_LONG_LONG +#pragma no_side_effect (__rw_strtoull) +#pragma no_side_effect (__rw_strtoll) +# endif // _RWSTD_LONG_LONG + +#endif // Sun C++ + + } // namespace __rw
svn commit: r678247 - /stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp
Author: sebor Date: Sat Jul 19 20:49:09 2008 New Revision: 678247 URL: http://svn.apache.org/viewvc?rev=678247view=rev Log: 2008-07-19 Martin Sebor [EMAIL PROTECTED] * tests/utilities/20.meta.unary.nothrow.cpp: New test exercising just the has_nothrow_xxx traits (so far has_nothrow_copy_constructor only). Added: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp (with props) Added: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp?rev=678247view=auto == --- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp (added) +++ stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp Sat Jul 19 20:49:09 2008 @@ -0,0 +1,727 @@ +/*** + * + * 20.meta.unary.prop.cpp - test exercising meta.unary.prop, + * has_nothrow_xxx traits + * + * $Id$ + * + *** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + **/ + +#include rw_driver.h + +#ifndef _RWSTD_NO_EXT_CXX_0X + +// only compele when C++ 0x extensions are enabled + +#include type_traits + +#define THROW public: enum { value = 0 } +#define NOTHROW public: enum { value = 1 } + +struct A { +struct A1 { NOTHROW; /* trivial copy ctor */ }; +struct A2 { NOTHROW; A2 (A2) throw (); }; +struct A3 { NOTHROW; A3 (const A3) throw (); }; +struct A4 { NOTHROW; A4 (volatile A4) throw (); }; +struct A5 { NOTHROW; A5 (const volatile A5) throw (); }; + +#ifndef _RWSTD_NO_RVALUE_REFERENCES + +// move ctor overloads (move ctor is not a copy ctor) +struct A6 { NOTHROW; A6 (A6) throw (); }; +struct A7 { NOTHROW; A7 (const A6) throw (); }; +struct A8 { NOTHROW; A8 (volatile A6) throw (); }; +struct A9 { NOTHROW; A9 (const volatile A6) throw (); }; + +#endif // _RWSTD_NO_RVALUE_REFERENCES + +}; + + +struct B { +struct B1 { THROW; B1 (B1); }; +struct B2 { THROW; B2 (const B2); }; +struct B3 { THROW; B3 (volatile B3); }; +struct B4 { THROW; B4 (const volatile B4); }; + +#ifndef _RWSTD_NO_RVALUE_REFERENCES + +// move ctor overloads (move ctor is not a copy ctor) +struct B5 { NOTHROW; B5 (B5); }; +struct B6 { NOTHROW; B6 (const B6); }; +struct B7 { NOTHROW; B7 (volatile B7); }; +struct B8 { NOTHROW; B8 (const volatile B8); }; + +#endif // _RWSTD_NO_RVALUE_REFERENCES + +}; + + +struct C { +// same as A::A* but with inaccessible copy ctor + +class C1 { NOTHROW; private: /* trivial copy ctor */ }; +class C2 { NOTHROW; private: C2 (C2) throw (); }; +class C3 { NOTHROW; private: C3 (const C3) throw (); }; +class C4 { NOTHROW; private: C4 (volatile C4) throw (); }; +class C5 { NOTHROW; private: C5 (const volatile C5) throw (); }; + +#ifndef _RWSTD_NO_RVALUE_REFERENCES + +// move ctor overloads (move ctor is not a copy ctor) +class C6 { NOTHROW; private: C6 (C6) throw (); }; +class C7 { NOTHROW; private: C7 (const C7) throw (); }; +class C8 { NOTHROW; private: C8 (volatile C8) throw (); }; +class C9 { NOTHROW; private: C9 (const volatile C9) throw (); }; + +#endif // _RWSTD_NO_RVALUE_REFERENCES + +}; + + +struct D { +// same as B::B* but with inaccessible copy ctor + +class D1 { NOTHROW; /* trivial copy ctor */ }; +class D2 { NOTHROW; D2 (D2) throw (); }; +class D3 { NOTHROW; D3 (const D3) throw (); }; +class D4 { NOTHROW; D4 (volatile D4) throw (); }; +class D5 { NOTHROW; D5 (const volatile D5) throw (); }; + +#ifndef _RWSTD_NO_RVALUE_REFERENCES + +// move ctor overloads (move ctor is not a copy ctor) +class D6 { NOTHROW; D6 (D6) throw (); }; +class D7 { NOTHROW; D7 (const D7) throw (); }; +class D8 { NOTHROW; D8 (volatile D8) throw (); }; +class D9 { NOTHROW; D9 (const volatile D9) throw (); }; + +#endif // _RWSTD_NO_RVALUE_REFERENCES + +}; + + +struct E
svn commit: r678003 - /stdcxx/branches/4.2.x/examples/manual/wctype.cpp
Author: sebor Date: Fri Jul 18 12:14:27 2008 New Revision: 678003 URL: http://svn.apache.org/viewvc?rev=678003view=rev Log: 2008-07-18 Martin Sebor [EMAIL PROTECTED] * examples/manual/wctype.cpp: New example showcasing the wchar_t specialization of the std::ctype_byname facet along with the wide character classification functions, inspired by the following post to the Sun C++ discussion forum: http://forums.sun.com/thread.jspa?threadID=5315069. Added: stdcxx/branches/4.2.x/examples/manual/wctype.cpp (with props) Added: stdcxx/branches/4.2.x/examples/manual/wctype.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/examples/manual/wctype.cpp?rev=678003view=auto == --- stdcxx/branches/4.2.x/examples/manual/wctype.cpp (added) +++ stdcxx/branches/4.2.x/examples/manual/wctype.cpp Fri Jul 18 12:14:27 2008 @@ -0,0 +1,193 @@ +/** + * + * wctype.cpp - Example program showcasing the wchar_t specialization + * of the std::ctype_byname facet, inspired by a Sun C++ + * forum post: + * http://forums.sun.com/thread.jspa?threadID=5315069 + * + * $Id$ + * + *** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + * Copyright 2008 Rogue Wave Software, Inc. + * + **/ + +#include cwctype // for iswxxx(), wint_t +#include stdexcept // for runtime_error +#include iomanip // for setfill, setw +#include ios // for oct +#include iostream// for cerr, cout +#include locale // for isxxx(), locale + + +static std::locale +make_named_locale () +{ +static const char* const +locale_names [] = { +es_ES.ISO8859-1, // AIX, Solaris, Tru64 +es_ES.iso88591,// HP-UX, Linux +es_ES.88591, +De_DE.88591, // Reliant +es_ES, +es,// Linux, Solaris +Spanish, +spanish, // Linux +espanol, // Linux +spanish_spain.1252,// Windows +POSIX, // POSIX systems +C, // all C/C++ systems +0// (sentinel) +}; + +std::locale german; + +// iterate over the know locale names above until a valid one +// is found (i.e., one that doesn't cause locale to throw) +for (const char* const *names = locale_names; ; ) { +try { +german = std::locale (names [0]); +break; +} +catch (std::runtime_error) { +// continue trying until the next name is null +if (0 == *++names) +throw; +} +catch (...) { +throw; +} +} + +return german; +} + + +int main () +{ +std::locale locale; + +try { +// try to contruct a named locale +locale = make_named_locale (); +} +catch (std::runtime_error e) { +// a runtime_error will be thrown if the locale cannot be constructed +std::cerr Caught runtime_error:\n; +std::cerr e.what () '\n'; + +return 1; +} +catch (...) { +std::cerr Caught an unknown exception\n; + +return 2; +} + +// set the global C/C++ locale to be used by the C classification +// functions (such as iswalpha()) +std::locale::global (locale); + +// imbue the named locale in wcout +std::wcout.imbue (locale); + +std::wcout Wide character classification in +locale.name ().c_str () locale.\n; + + +// number of mismatched classifications between C and C++ +// (expect zero for 100% conforming implementation) +int mismatch_count = 0; + +// iterate over all characters in the extended ASCII range +// printing out the value of each along with its character +// class using the letters A, a, C, D, G, L, P, p, S, U, +// and X to denote each of the C/C
svn commit: r677756 - in /stdcxx/branches/4.2.x: include/vector include/vector.cc tests/regress/23.vector.stdcxx-494.cpp
Author: sebor Date: Thu Jul 17 14:58:05 2008 New Revision: 677756 URL: http://svn.apache.org/viewvc?rev=677756view=rev Log: 2008-07-17 Martin Sebor [EMAIL PROTECTED] STDCXX-494 * include/vector (vector): Removed Allocator base class, replacing it (in a binary compatible way) with a new member, _C_alloc, instead. (_C_value_alloc_type): Removed member typedef. (vector): Initialized the _C_alloc member instead of allocator_type in all class ctors. (~vector, begin, end, size, max_size, empty, swap): Referenced _C_begin, _C_end, and _C_bufend indirectly, via the new _C_alloc member. (pop_back, push_back): Used the new _C_alloc member to destroy and construct elements. * include/vector.cc (_C_realloc, _C_destroy, _C_insert_1, _C_insert_n, _C_insert_range): Same as above. * tests/regress/23.vector.stdcxx-494: Added regression test for the vector part of the issue. Added: stdcxx/branches/4.2.x/tests/regress/23.vector.stdcxx-494.cpp (with props) Modified: stdcxx/branches/4.2.x/include/vector stdcxx/branches/4.2.x/include/vector.cc Modified: stdcxx/branches/4.2.x/include/vector URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/vector?rev=677756r1=677755r2=677756view=diff == --- stdcxx/branches/4.2.x/include/vector (original) +++ stdcxx/branches/4.2.x/include/vector Thu Jul 17 14:58:05 2008 @@ -88,7 +88,7 @@ _EXPORT template class _TypeT, class _Allocator -class vector: private _Allocator +class vector { public: @@ -100,7 +100,6 @@ typedef _TYPENAME allocator_type::const_reference const_reference; typedef _TYPENAME allocator_type::pointer pointer; typedef _TYPENAME allocator_type::const_pointerconst_pointer; -typedef _RWSTD_ALLOC_TYPE (allocator_type, value_type) _C_value_alloc_type; public: @@ -157,33 +156,32 @@ _EXPLICIT vector (const allocator_type __alloc = allocator_type ()) -: allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () { } +: _C_alloc (__alloc) { } _EXPLICIT vector (size_type __n, const_reference __x = value_type (), const allocator_type __alloc = allocator_type ()) -: allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () { +: _C_alloc (__alloc) { assign (__n, __x); } template class _InputIter vector (_InputIter __first, _InputIter __last, const allocator_type __alloc = allocator_type ()) -: allocator_type (__alloc), _C_begin (), _C_end (), _C_bufend () { +: _C_alloc (__alloc) { assign (__first, __last); } vector (const vector __rhs) -: allocator_type (__rhs.get_allocator ()), - _C_begin (), _C_end (), _C_bufend () { +: _C_alloc (__rhs.get_allocator ()) { assign (__rhs.begin (), __rhs.end ()); } ~vector () { -_C_destroy (begin ()); -_RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, -deallocate (_C_begin, _C_bufend - _C_begin)); +_C_destroy (begin ()); +_C_alloc.deallocate (_C_alloc._C_begin, + _C_alloc._C_bufend - _C_alloc._C_begin); } vector operator= (const vector); @@ -199,23 +197,23 @@ } allocator_type get_allocator () const { -return *this; +return _C_alloc; } iterator begin () { -return _C_make_iter (_C_begin); +return _C_make_iter (_C_alloc._C_begin); } const_iterator begin () const { -return _C_make_iter (_C_begin); +return _C_make_iter (_C_alloc._C_begin); } iterator end () { -return _C_make_iter (_C_end); +return _C_make_iter (_C_alloc._C_end); } const_iterator end () const { -return _C_make_iter (_C_end); +return _C_make_iter (_C_alloc._C_end); } reverse_iterator rbegin () { @@ -235,21 +233,21 @@ } size_type size () const { -return size_type (_C_end - _C_begin); +return size_type (_C_alloc._C_end - _C_alloc._C_begin); } size_type max_size () const { -return _RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, max_size ()); +return _C_alloc.max_size (); } void resize (size_type, value_type = value_type ()); size_type capacity () const { -return _C_bufend - _C_begin; +return _C_alloc._C_bufend - _C_alloc._C_begin; } bool empty () const { -return _C_begin == _C_end; +return _C_alloc._C_begin == _C_alloc._C_end; } void reserve (size_type); @@ -286,8 +284,8 @@ void pop_back () { _RWSTD_ASSERT (!empty ()); -_RWSTD_VALUE_ALLOC (_C_value_alloc_type, *this, destroy (_C_end - 1
svn commit: r677764 - /stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp
Author: sebor Date: Thu Jul 17 15:31:29 2008 New Revision: 677764 URL: http://svn.apache.org/viewvc?rev=677764view=rev Log: 2008-07-17 Martin Sebor [EMAIL PROTECTED] * tests/regress/18.c.limits.stdcxx-988.cpp (main): Avoided testing macros for specific values to prevent failures on non-conforming systems. Modified: stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp Modified: stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp?rev=677764r1=677763r2=677764view=diff == --- stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp (original) +++ stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp Thu Jul 17 15:31:29 2008 @@ -29,6 +29,7 @@ #include cassert #include limits.h + int main () { #if(defined __unix__ || defined __unix || defined unix) \ @@ -73,37 +74,41 @@ // shall provide values at least this large. A strictly conforming // application must not require a larger value for correct operation. -assert (_POSIX_ARG_MAX== 4096); -assert (_POSIX_CHILD_MAX ==25); -assert (_POSIX_HOST_NAME_MAX == 255); -assert (_POSIX_LINK_MAX == 8); -assert (_POSIX_LOGIN_NAME_MAX == 9); -assert (_POSIX_MAX_CANON == 255); -assert (_POSIX_MAX_INPUT == 255); -assert (_POSIX_NAME_MAX ==14); -assert (_POSIX_NGROUPS_MAX== 8); -assert (_POSIX_OPEN_MAX ==20); -assert (_POSIX_PATH_MAX == 256); -assert (_POSIX_PIPE_BUF == 512); -assert (_POSIX_RE_DUP_MAX == 255); -assert (_POSIX_SSIZE_MAX == 32767); -assert (_POSIX_STREAM_MAX == 8); -assert (_POSIX_SYMLINK_MAX== 255); -assert (_POSIX_SYMLOOP_MAX== 8); -assert (_POSIX_TTY_NAME_MAX == 9); -assert (_POSIX_TZNAME_MAX == 6); +// avoid testing specific values since they're not important here +// all we care is that the macros be defined (i.e., that thet are +// not somehow hidden or #undef'd by our implementation) + +assert (_POSIX_ARG_MAX!= 0 /* == 4096 */); +assert (_POSIX_CHILD_MAX != 0 /* ==25 */); +assert (_POSIX_HOST_NAME_MAX != 0 /* == 255 */); +assert (_POSIX_LINK_MAX != 0 /* == 8 */); +assert (_POSIX_LOGIN_NAME_MAX != 0 /* == 9 */); +assert (_POSIX_MAX_CANON != 0 /* == 255 */); +assert (_POSIX_MAX_INPUT != 0 /* == 255 */); +assert (_POSIX_NAME_MAX != 0 /* ==14 */); +assert (_POSIX_NGROUPS_MAX!= 0 /* == 8 */); +assert (_POSIX_OPEN_MAX != 0 /* ==20 */); +assert (_POSIX_PATH_MAX != 0 /* == 256 */); +assert (_POSIX_PIPE_BUF != 0 /* == 512 */); +assert (_POSIX_RE_DUP_MAX != 0 /* == 255 */); +assert (_POSIX_SSIZE_MAX != 0 /* == 32767 */); +assert (_POSIX_STREAM_MAX != 0 /* == 8 */); +assert (_POSIX_SYMLINK_MAX!= 0 /* == 255 */); +assert (_POSIX_SYMLOOP_MAX!= 0 /* == 8 */); +assert (_POSIX_TTY_NAME_MAX != 0 /* == 9 */); +assert (_POSIX_TZNAME_MAX != 0 /* == 6 */); # ifdef _POSIX2_VERSION -assert (_POSIX2_BC_BASE_MAX== 99); -assert (_POSIX2_BC_DIM_MAX == 2048); -assert (_POSIX2_BC_SCALE_MAX == 99); -assert (_POSIX2_BC_STRING_MAX == 1000); -assert (_POSIX2_CHARCLASS_NAME_MAX == 14); -assert (_POSIX2_COLL_WEIGHTS_MAX ==2); -assert (_POSIX2_EXPR_NEST_MAX == 32); -assert (_POSIX2_LINE_MAX == 2048); -assert (_POSIX2_RE_DUP_MAX == 255); +assert (_POSIX2_BC_BASE_MAX!= 0 /* == 99 */); +assert (_POSIX2_BC_DIM_MAX != 0 /* == 2048 */); +assert (_POSIX2_BC_SCALE_MAX != 0 /* == 99 */); +assert (_POSIX2_BC_STRING_MAX != 0 /* == 1000 */); +assert (_POSIX2_CHARCLASS_NAME_MAX != 0 /* == 14 */); +assert (_POSIX2_COLL_WEIGHTS_MAX != 0 /* ==2 */); +assert (_POSIX2_EXPR_NEST_MAX != 0 /* == 32 */); +assert (_POSIX2_LINE_MAX != 0 /* == 2048 */); +assert (_POSIX2_RE_DUP_MAX != 0 /* == 255 */); # endif // _POSIX2_VERSION
svn commit: r677770 - /stdcxx/branches/4.2.x/etc/config/xfail.txt
Author: sebor Date: Thu Jul 17 16:03:32 2008 New Revision: 60 URL: http://svn.apache.org/viewvc?rev=60view=rev Log: 2008-07-17 Martin Sebor [EMAIL PROTECTED] * etc/config/xfail.txt: Copied from trunk. Added: stdcxx/branches/4.2.x/etc/config/xfail.txt - copied unchanged from r662100, stdcxx/trunk/etc/config/xfail.txt
svn commit: r677780 - /stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp
Author: sebor Date: Thu Jul 17 17:05:23 2008 New Revision: 677780 URL: http://svn.apache.org/viewvc?rev=677780view=rev Log: 2008-07-17 Martin Sebor [EMAIL PROTECTED] STDCXX-773 * test/strings/21.string.erase.cpp (test_erase): Asserted precondition to silence another bogus HP aCC 6/cadvise warning. Modified: stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp Modified: stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp?rev=677780r1=69r2=677780view=diff == --- stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp (original) +++ stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp Thu Jul 17 17:05:23 2008 @@ -410,6 +410,10 @@ const std::size_t match = rw_match (nres + tcase.off, (*res_iter), 1); +// asssert precondition to silence a bogus HP cadvise +// warning #20200-D: Potential null pointer dereference +RW_ASSERT (0 != nres); + rw_assert (1 == match, 0, tcase.line, line %d. %{$FUNCALL} == %{#c}, got %{#c}, __LINE__, nres[tcase.off], *res_iter);
svn commit: r677783 - /stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp
Author: sebor Date: Thu Jul 17 17:11:32 2008 New Revision: 677783 URL: http://svn.apache.org/viewvc?rev=677783view=rev Log: 2008-07-17 Martin Sebor [EMAIL PROTECTED] * test/strings/21.string.erase.cpp (test_erase): Cast actual function arguments to the target type to silence HP aCC 6.16 remarks #4271-D: type conversion may lose sign. Modified: stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp Modified: stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp?rev=677783r1=677782r2=677783view=diff == --- stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp (original) +++ stdcxx/branches/4.2.x/tests/strings/21.string.erase.cpp Thu Jul 17 17:11:32 2008 @@ -363,6 +363,8 @@ // pointer to the returned reference const String* ret_ptr = 0; +typedef typename String::size_type size_type; + try { switch (func.which_) { @@ -371,11 +373,12 @@ break; case Erase (size): -ret_ptr = str.erase (tcase.off); +ret_ptr = str.erase (size_type (tcase.off)); break; case Erase (size_size): -ret_ptr = str.erase (tcase.off, tcase.size); +ret_ptr = str.erase (size_type (tcase.off), + size_type (tcase.size)); break; case Erase (iter):
svn commit: r677791 - /stdcxx/branches/4.2.x/tests/include/rw_streambuf.h
Author: sebor Date: Thu Jul 17 17:28:17 2008 New Revision: 677791 URL: http://svn.apache.org/viewvc?rev=677791view=rev Log: 2008-07-17 Martin Sebor [EMAIL PROTECTED] STDCXX-780 * tests/include/rw_streambuf.h (test): Aasserted a precondition to silence HP aCC 6/cadvise warning #20206-D: Out of bound access. Modified: stdcxx/branches/4.2.x/tests/include/rw_streambuf.h Modified: stdcxx/branches/4.2.x/tests/include/rw_streambuf.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/include/rw_streambuf.h?rev=677791r1=677790r2=677791view=diff == --- stdcxx/branches/4.2.x/tests/include/rw_streambuf.h (original) +++ stdcxx/branches/4.2.x/tests/include/rw_streambuf.h Thu Jul 17 17:28:17 2008 @@ -461,10 +461,14 @@ { MyStreambuf* const self = _RWSTD_CONST_CAST (MyStreambuf*, this); -int inx = memfun_inx (which); -if (-1 == inx) +const int inx = memfun_inx (which); +if (inx 0) return true; +// assert precondition to silence HP aCC 6/cadvise warning +// #20206-D: Out of bound access +RW_ASSERT ((_RWSTD_SIZE_T)inx sizeof ncalls_ / sizeof *ncalls_); + // increment the counter tracking the number of calls made // to each member function; do so regardless of whether // an exception will be thrown below
svn commit: r677800 - /stdcxx/branches/4.2.x/tests/containers/23.deque.modifiers.cpp
Author: sebor Date: Thu Jul 17 18:23:39 2008 New Revision: 677800 URL: http://svn.apache.org/viewvc?rev=677800view=rev Log: 2008-07-17 Martin Sebor [EMAIL PROTECTED] * tests/containers/23.deque.modifiers.cpp (exception_loop): Converted a signed int to size_type to silence HP aCC 6 remark #4271-D: type conversion may lose sign. Modified: stdcxx/branches/4.2.x/tests/containers/23.deque.modifiers.cpp Modified: stdcxx/branches/4.2.x/tests/containers/23.deque.modifiers.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/containers/23.deque.modifiers.cpp?rev=677800r1=677799r2=677800view=diff == --- stdcxx/branches/4.2.x/tests/containers/23.deque.modifiers.cpp (original) +++ stdcxx/branches/4.2.x/tests/containers/23.deque.modifiers.cpp Thu Jul 17 18:23:39 2008 @@ -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-2008 Rogue Wave Software, Inc. * **/ @@ -190,10 +190,15 @@ _TRY { +// convert an int to size_type to avoid conversion +// warnings when passing it to member functions +// that expect an unsigned argument +const Deque::size_type nelems (n); + switch (mfun) { case Assign_n: _RWSTD_ASSERT (x); -deq.assign (n, *x); +deq.assign (nelems, *x); break; case AssignRange: deq.assign (first, last); @@ -214,7 +219,7 @@ break; case Insert_n: _RWSTD_ASSERT (x); -deq.insert (it, n, *x); +deq.insert (it, nelems, *x); break; case InsertRange: deq.insert (it, first, last);
svn commit: r676063 - /stdcxx/branches/4.2.x/include/rw/_config-eccp.h
Author: sebor Date: Fri Jul 11 12:58:26 2008 New Revision: 676063 URL: http://svn.apache.org/viewvc?rev=676063view=rev Log: 2008-07-11 Martin Sebor [EMAIL PROTECTED] STDCXX-991 * include/rw/_config-eccp.h (_RWSTD_NO_MBSTATE_T): Removed macro #definition. Modified: stdcxx/branches/4.2.x/include/rw/_config-eccp.h Modified: stdcxx/branches/4.2.x/include/rw/_config-eccp.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_config-eccp.h?rev=676063r1=676062r2=676063view=diff == --- stdcxx/branches/4.2.x/include/rw/_config-eccp.h (original) +++ stdcxx/branches/4.2.x/include/rw/_config-eccp.h Fri Jul 11 12:58:26 2008 @@ -25,7 +25,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 2001-2007 Rogue Wave Software, Inc. + * Copyright 2001-2008 Rogue Wave Software, Inc. * **/ @@ -55,10 +55,6 @@ # define _RWSTD_NO_UNCAUGHT_EXCEPTION #endif // _RWSTD_REENTRANT -#ifndef _RWSTD_NO_MBSTATE_T -# define _RWSTD_NO_MBSTATE_T -#endif // _RWSTD_NO_MBSTATE_T - #undef _RWSTD_NO_DEPRECATED_C_HEADERS #undef _RWSTD_NO_PURE_C_HEADERS
svn commit: r676064 - /stdcxx/branches/4.3.x/include/rw/_config-eccp.h
Author: sebor Date: Fri Jul 11 13:01:41 2008 New Revision: 676064 URL: http://svn.apache.org/viewvc?rev=676064view=rev Log: 2008-07-11 Martin Sebor [EMAIL PROTECTED] Merged rev 676063 from 4.2.x. STDCXX-991 * include/rw/_config-eccp.h (_RWSTD_NO_MBSTATE_T): Removed macro #definition. Modified: stdcxx/branches/4.3.x/include/rw/_config-eccp.h Modified: stdcxx/branches/4.3.x/include/rw/_config-eccp.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_config-eccp.h?rev=676064r1=676063r2=676064view=diff == --- stdcxx/branches/4.3.x/include/rw/_config-eccp.h (original) +++ stdcxx/branches/4.3.x/include/rw/_config-eccp.h Fri Jul 11 13:01:41 2008 @@ -25,7 +25,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 2001-2007 Rogue Wave Software, Inc. + * Copyright 2001-2008 Rogue Wave Software, Inc. * **/ @@ -55,10 +55,6 @@ # define _RWSTD_NO_UNCAUGHT_EXCEPTION #endif // _RWSTD_REENTRANT -#ifndef _RWSTD_NO_MBSTATE_T -# define _RWSTD_NO_MBSTATE_T -#endif // _RWSTD_NO_MBSTATE_T - #undef _RWSTD_NO_DEPRECATED_C_HEADERS #undef _RWSTD_NO_PURE_C_HEADERS
svn commit: r676075 - /stdcxx/branches/4.2.x/src/wcodecvt.cpp
Author: sebor Date: Fri Jul 11 13:37:17 2008 New Revision: 676075 URL: http://svn.apache.org/viewvc?rev=676075view=rev Log: 2008-07-11 Martin Sebor [EMAIL PROTECTED] STDCXX-992 * src/wcodecvt.cpp (mblen): Declared with the correct return type. Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/wcodecvt.cpp?rev=676075r1=676074r2=676075view=diff == --- stdcxx/branches/4.2.x/src/wcodecvt.cpp (original) +++ stdcxx/branches/4.2.x/src/wcodecvt.cpp Fri Jul 11 13:37:17 2008 @@ -86,7 +86,7 @@ # undef _RWSTD_NO_MBLEN -extern C _RWSTD_SIZE_T +extern C int mblen (const char*, _RWSTD_SIZE_T) _LIBC_THROWS(); #endif // _RWSTD_NO_MBLEN !_RWSTD_NO_MBLEN_IN_LIBC
svn commit: r676076 - /stdcxx/branches/4.3.x/src/wcodecvt.cpp
Author: sebor Date: Fri Jul 11 13:38:37 2008 New Revision: 676076 URL: http://svn.apache.org/viewvc?rev=676076view=rev Log: 2008-07-11 Martin Sebor [EMAIL PROTECTED] Merged rev 676075 from 4.2.x. STDCXX-992 * src/wcodecvt.cpp (mblen): Declared with the correct return type. Modified: stdcxx/branches/4.3.x/src/wcodecvt.cpp Modified: stdcxx/branches/4.3.x/src/wcodecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/wcodecvt.cpp?rev=676076r1=676075r2=676076view=diff == --- stdcxx/branches/4.3.x/src/wcodecvt.cpp (original) +++ stdcxx/branches/4.3.x/src/wcodecvt.cpp Fri Jul 11 13:38:37 2008 @@ -86,7 +86,7 @@ # undef _RWSTD_NO_MBLEN -extern C _RWSTD_SIZE_T +extern C int mblen (const char*, _RWSTD_SIZE_T) _LIBC_THROWS(); #endif // _RWSTD_NO_MBLEN !_RWSTD_NO_MBLEN_IN_LIBC
svn commit: r676077 - /stdcxx/branches/4.2.x/src/wcodecvt.cpp
Author: sebor Date: Fri Jul 11 13:53:15 2008 New Revision: 676077 URL: http://svn.apache.org/viewvc?rev=676077view=rev Log: 2008-07-11 Martin Sebor [EMAIL PROTECTED] * src/wcodecvt.cpp (size_t): Used type throughout in place of the _RWSTD_SIZE_T macro which is necessary in library headers. Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/wcodecvt.cpp?rev=676077r1=676076r2=676077view=diff == --- stdcxx/branches/4.2.x/src/wcodecvt.cpp (original) +++ stdcxx/branches/4.2.x/src/wcodecvt.cpp Fri Jul 11 13:53:15 2008 @@ -74,8 +74,8 @@ # undef _RWSTD_NO_MBRLEN -extern C _RWSTD_SIZE_T -mbrlen (const char*, _RWSTD_SIZE_T, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); +extern C size_t +mbrlen (const char*, size_t, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); #endif // _RWSTD_NO_MBRLEN !_RWSTD_NO_MBRLEN_IN_LIBC @@ -87,7 +87,7 @@ # undef _RWSTD_NO_MBLEN extern C int -mblen (const char*, _RWSTD_SIZE_T) _LIBC_THROWS(); +mblen (const char*, size_t) _LIBC_THROWS(); #endif // _RWSTD_NO_MBLEN !_RWSTD_NO_MBLEN_IN_LIBC @@ -99,7 +99,7 @@ # undef _RWSTD_NO_MBTOWC extern C int -mbtowc (wchar_t*, const char*, _RWSTD_SIZE_T) _LIBC_THROWS(); +mbtowc (wchar_t*, const char*, size_t) _LIBC_THROWS(); #endif // _RWSTD_NO_MBTOWC !_RWSTD_NO_MBTOWC_IN_LIBC @@ -110,9 +110,8 @@ # undef _RWSTD_NO_WCSRTOMBS -extern C _RWSTD_SIZE_T -wcsrtombs (char*, const wchar_t**, - _RWSTD_SIZE_T, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); +extern C size_t +wcsrtombs (char*, const wchar_t**, size_t, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); #endif // _RWSTD_NO_WCSRTOMBS !_RWSTD_NO_WCSRTOMBS_IN_LIBC @@ -123,7 +122,7 @@ # undef _RWSTD_NO_WCRTOMB -extern C _RWSTD_SIZE_T +extern C size_t wcrtomb (char*, wchar_t, _RWSTD_MBSTATE_T*) _LIBC_THROWS(); #endif // _RWSTD_NO_WCRTOMB !_RWSTD_NO_WCRTOMB_IN_LIBC @@ -237,7 +236,7 @@ { UCS-LE, __rw_ucs_le } }; -static const _RWSTD_SIZE_T +static const size_t __rw_n_ucsmods = sizeof __rw_ucsmods / sizeof *__rw_ucsmods; @@ -270,10 +269,10 @@ // behaves just like mbrlen(), except that if the character pointed to // by `str' is the NUL character and `emax' is non-zero, the function // returns 1 -static inline _RWSTD_SIZE_T +static inline size_t __rw_libc_mbrlen (_RWSTD_MBSTATE_T state, const char *str, - _RWSTD_SIZE_T emax) + size_temax) { _RWSTD_ASSERT (0 != str); @@ -313,7 +312,7 @@ // does a simple transliteration of the UTF-8 encoded character string static unsigned int __rw_xlit (const _RW::__rw_codecvt_t* impl, - const char *utf8s, _RWSTD_SIZE_T sz) + const char *utf8s, size_t sz) { const unsigned int* const ptbls = impl-get_xliteration_tab (); @@ -358,8 +357,8 @@ // compute the length of the source sequence in bytes and // the size of the destination buffer in wide characters -_RWSTD_SIZE_T src_len = from_end - from; -_RWSTD_SIZE_T dst_size = to_limit - to; +size_t src_len = from_end - from; +size_t dst_size = to_limit - to; // set the initial values to the source and destination pointers const char* psrc = from; @@ -368,7 +367,7 @@ while (dst_size src_len) { // the number of bytes that form the next multibyte character -_RWSTD_SIZE_T nbytes; +size_t nbytes; #ifndef _RWSTD_NO_MBRTOWC nbytes = mbrtowc (pdst, psrc, src_len, state); @@ -379,14 +378,14 @@ #endif // -1 indicates an invalid sequence (i.e., error) -if (nbytes == (_RWSTD_SIZE_T)(-1)) { +if (nbytes == size_t (-1)) { res = _STD::codecvt_base::error; break; } // -2 indicates an ambiguous but valid subsequence // (i.e., ok) -if (nbytes == (_RWSTD_SIZE_T)(-2)) +if (nbytes == size_t (-2)) break; // 0 indicates the NUL character (skip over it) @@ -410,8 +409,8 @@ // range then we have a partial conversion if (res == _STD::codecvt_base::ok src_len !dst_size) { _RWSTD_MBSTATE_T tmp_state = state; -_RWSTD_SIZE_T tmp = __rw_libc_mbrlen (tmp_state, psrc, src_len); -if (tmp (_RWSTD_SIZE_T)(-2)) +size_t tmp = __rw_libc_mbrlen (tmp_state, psrc, src_len); +if (tmp size_t (-2)) res = _STD::codecvt_base::partial; } @@ -442,15 +441,13 @@ // save the value of MB_CUR_MAX and avoid repeatedly using // the macro for efficiency (it may expand to a function call) -const _RWSTD_SIZE_T mb_cur_max = -_RWSTD_STATIC_CAST (_RWSTD_SIZE_T, MB_CUR_MAX); +const size_t mb_cur_max = size_t (MB_CUR_MAX); // the result of conversion _STD::codecvt_base::result res = _STD::codecvt_base::ok
svn commit: r676093 - /stdcxx/branches/4.2.x/src/wcodecvt.cpp
Author: sebor Date: Fri Jul 11 15:20:16 2008 New Revision: 676093 URL: http://svn.apache.org/viewvc?rev=676093view=rev Log: 2008-07-11 Martin Sebor [EMAIL PROTECTED] Merged rev 649665 from 4.3.x. * src/wcodecvt.cpp (__rw_libstd_do_out): Replaced the local equivalent of _RWSTD_UWCHAR_INT_T newly introduced in r649646 with the said type. Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/wcodecvt.cpp?rev=676093r1=676092r2=676093view=diff == --- stdcxx/branches/4.2.x/src/wcodecvt.cpp (original) +++ stdcxx/branches/4.2.x/src/wcodecvt.cpp Fri Jul 11 15:20:16 2008 @@ -762,20 +762,12 @@ // in strict mode check wide character for validity // (i.e., diagnose surrogate pairs as illegal) -# if _RWSTD_WCHAR_SIZE == _RWSTD_CHAR_SIZE -typedef unsigned char WIntT; -# elif _RWSTD_WCHAR_SIZE == _RWSTD_SHRT_SIZE -typedef unsigned short WIntT; -# elif _RWSTD_WCHAR_SIZE ==_RWSTD_INT_SIZE -typedef unsigned int WIntT; -# elif _RWSTD_WCHAR_SIZE ==_RWSTD_LLONG_SIZE -typedef unsigned _RWSTD_LONG_LONG WIntT; -# else -typedef unsigned long WIntT; -# endif +typedef _RWSTD_UWCHAR_INT_T WIntT; -// convert wchar_t to an unsigned integer safe for comaprison -const unsigned long wi = _RWSTD_STATIC_CAST (WIntT, *from_next); +// convert wchar_t to the unsigned form of its underlying +// integer type that's safe in arithmetic comaprisons and +// doesn't generate signed/unsigned compiler warnings +const WIntT wi = _RWSTD_STATIC_CAST (WIntT, *from_next); if ( WIntT (0xd800U) = wi wi = WIntT (0xdfffU) || WIntT (0xfffeU) = wi wi = WIntT (0xU)) {
svn commit: r675803 - /stdcxx/branches/4.3.x/include/rw/_defs.h
Author: sebor Date: Thu Jul 10 16:10:15 2008 New Revision: 675803 URL: http://svn.apache.org/viewvc?rev=675803view=rev Log: 2008-07-10 Martin Sebor [EMAIL PROTECTED] STDCXX-990 * include/rw/_defs.h [2 __GNUG__](_RWSTD_VA_COPY): Unconditionally defined to gcc's __builtin_va_copy() to avoid errors due to potential configuration differences (e.g., after configuring in C++ 1998 mode and compiling with the -std=c++0x option). Modified: stdcxx/branches/4.3.x/include/rw/_defs.h Modified: stdcxx/branches/4.3.x/include/rw/_defs.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_defs.h?rev=675803r1=675802r2=675803view=diff == --- stdcxx/branches/4.3.x/include/rw/_defs.h (original) +++ stdcxx/branches/4.3.x/include/rw/_defs.h Thu Jul 10 16:10:15 2008 @@ -1580,15 +1580,15 @@ #endif // _RWSTD_NO_MEMBER_TEMPLATES -#if defined (va_copy) || !defined _RWSTD_NO_VA_COPY +#if 2 __GNUG__ + // use gcc builtin by default +# define _RWSTD_VA_COPY(va_dst, va_src) \ + __builtin_va_copy (va_dst, va_src) +#elif defined (va_copy) || !defined _RWSTD_NO_VA_COPY // either va_copy() is already #defined (because stdarg.h // is already #included), or it was detected at configuration # define _RWSTD_VA_COPY(va_dst, va_src) \ va_copy (va_dst, va_src) -#elif 2 __GNUG__ - // no va_copy() macro detected, use gcc builtin -# define _RWSTD_VA_COPY(va_dst, va_src) \ - __builtin_va_copy (va_dst, va_src) #elif defined (_RWSTD_NO_VA_LIST_ARRAY) // va_list is not an array, use ordinary assignment to copy # define _RWSTD_VA_COPY(va_dst, va_src) \
svn commit: r675827 - /stdcxx/branches/4.3.x/include/ansi/_csetjmp.h
Author: sebor Date: Thu Jul 10 20:47:20 2008 New Revision: 675827 URL: http://svn.apache.org/viewvc?rev=675827view=rev Log: 2008-07-10 Martin Sebor [EMAIL PROTECTED] Merged rev 675826 from 4.2.x. STDCXX-989 * include/ansi/_csetjmp.h (jmp_buf): Hardcoded known size on Linux and Solaris. Modified: stdcxx/branches/4.3.x/include/ansi/_csetjmp.h Modified: stdcxx/branches/4.3.x/include/ansi/_csetjmp.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/ansi/_csetjmp.h?rev=675827r1=675826r2=675827view=diff == --- stdcxx/branches/4.3.x/include/ansi/_csetjmp.h (original) +++ stdcxx/branches/4.3.x/include/ansi/_csetjmp.h Thu Jul 10 20:47:20 2008 @@ -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-2008 Rogue Wave Software, Inc. * **/ @@ -38,7 +38,29 @@ extern C { -typedef char jmp_buf [8]; +#ifdef _RWSTD_OS_LINUX + +# if 4 == _RWSTD_LONG_SIZE +// ILP32: sizeof (jmp_buf) == 156 +typedef long jmp_buf [39]; +# elif 8 == _RWSTD_LONG_SIZE +// ILP64: sizeof (jmp_buf) == 200 +typedef long jmp_buf [25]; +# endif + +#elif defined _RWSTD_OS_SUNOS + +// ILP32: sizeof (jmp_buf) == 48 +// ILP64: sizeof (jmp_buf) == 96 +typedef long jmp_buf [12]; + +#elif defined _WIN64 + // FIXME: add size +# error jmp_buf size unknown on WIN64 +#elif defined _WIN32 + // FIXME: add size +# error jmp_buf size unknown on WIN32 +#endif int setjmp (jmp_buf); void longjmp (jmp_buf, int);
svn commit: r675829 - /stdcxx/branches/4.2.x/tests/regress/18.support.runtime.stdcxx-989.cpp
Author: sebor Date: Thu Jul 10 20:58:41 2008 New Revision: 675829 URL: http://svn.apache.org/viewvc?rev=675829view=rev Log: 2008-07-10 Martin Sebor [EMAIL PROTECTED] * tests/regress/18.support.runtime.stdcxx-989.cpp: Regression test for STDCXX-989, verifying the expected value of sizeof(jmp_buf) on Linux/x86 and Solaris/SPARC. Added: stdcxx/branches/4.2.x/tests/regress/18.support.runtime.stdcxx-989.cpp (with props) Added: stdcxx/branches/4.2.x/tests/regress/18.support.runtime.stdcxx-989.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/regress/18.support.runtime.stdcxx-989.cpp?rev=675829view=auto == --- stdcxx/branches/4.2.x/tests/regress/18.support.runtime.stdcxx-989.cpp (added) +++ stdcxx/branches/4.2.x/tests/regress/18.support.runtime.stdcxx-989.cpp Thu Jul 10 20:58:41 2008 @@ -0,0 +1,57 @@ +/ + * + * 18.support.runtime.stdcxx-989.cpp - regression test for STDCXX-989 + * + * http://issues.apache.org/jira/browse/STDCXX-989 + * + * $Id$ + * + *** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + **/ + +#include cassert +#include csetjmp + +int main () +{ + +#ifdef __linux__ +# ifdef __i386 + // Linux on x86 (including x64 and derivatives) +#define expected_jmp_buf_size (4 == sizeof (long) ? 156 : 200) +# endif +#elif defined __sun +# ifdef __sparc + // Sun Solaris on SPARC +#define expected_jmp_buf_size (sizeof (long) * 12) +# endif +#endif + +#ifdef expected_jmp_buf_size + +using namespace std; + +assert (expected_jmp_buf_size == sizeof (jmp_buf)); + +#endif // expected_jmp_buf_size + +return 0; + +} Propchange: stdcxx/branches/4.2.x/tests/regress/18.support.runtime.stdcxx-989.cpp -- svn:eol-style = native Propchange: stdcxx/branches/4.2.x/tests/regress/18.support.runtime.stdcxx-989.cpp -- svn:keywords = Id