402N/A--- stdcxx-4.2.1/tests/include/rw_char.h 2008-04-24 20:22:55.000000000 -0400
402N/A+++ stdcxx-4.2.1/tests/include/rw_char.h 2011-03-04 00:40:34.422115861 -0500
402N/A@@ -38,22 +38,15 @@
402N/A
402N/A struct UserChar // user-defined character type (must be POD)
402N/A {
402N/A-#if !defined (_RWSTD_NO_LONG_DOUBLE) \
402N/A- && !defined (__SUNPRO_CC) || __SUNPRO_CC > 0x540
402N/A- long double f; // exercise correct alignment
402N/A-#else
402N/A- // cannot use long double with SunPro due to a compiler
402N/A- // bug that prevents assignments of UserChar() (PR #28328)
402N/A- double f;
402N/A-#endif // _RWSTD_NO_LONG_DOUBLE
402N/A+ unsigned int f;
402N/A
402N/A- unsigned char c; // underlying character representation
402N/A+ char c; // underlying character representation
402N/A
402N/A static UserChar eos () {
402N/A // use UserChar::eos() instead of UserChar() to work around broken
402N/A // compilers (e.g., MSVC 6) that do not zero out POD structs
402N/A // on default construction
402N/A- const UserChar tmp = { 0, 0 };
402N/A+ const UserChar tmp = { 0, '\0' };
402N/A return tmp;
402N/A }
402N/A
402N/A@@ -73,7 +66,7 @@
402N/A
402N/A inline UserChar make_char (char c, UserChar*)
402N/A {
402N/A- const UserChar ch = { 0.0, c };
402N/A+ const UserChar ch = { 0, c };
402N/A return ch;
402N/A }
402N/A
402N/A@@ -82,6 +75,18 @@
402N/A return c;
402N/A }
402N/A
402N/A+inline char make_char (const char c, const char*)
402N/A+{
402N/A+ return c;
402N/A+}
402N/A+
402N/A+inline char make_char (struct UserChar& ucr, struct UserChar* uc)
402N/A+{
402N/A+ char c = uc ? uc->c : char('\0');
402N/A+ return c;
402N/A+}
402N/A+
402N/A+
402N/A #ifndef _RWSTD_NO_WCHAR_T
402N/A
402N/A inline wchar_t make_char (char c, wchar_t*)
402N/A--- stdcxx-4.2.1/tests/src/char.cpp 2008-04-24 20:23:00.000000000 -0400
402N/A+++ stdcxx-4.2.1/tests/src/char.cpp 2011-03-04 00:41:58.607053360 -0500
402N/A@@ -446,7 +446,7 @@
402N/A ++n_calls_ [MemFun::not_eof];
402N/A
402N/A if (i.equal (int_type::eof ())) {
402N/A- const char_type c = { 0, 0 };
402N/A+ const char_type c = { 0, '\0' };
402N/A
402N/A return int_type::from_char (c);
402N/A }
402N/A@@ -805,7 +805,10 @@
402N/A size_t n1 = 0;
402N/A size_t n2 = 0;
402N/A
402N/A- for (unsigned long ch1, ch2; count < len; ) {
402N/A+ unsigned long ch1 = 0UL;
402N/A+ unsigned long ch2 = 0UL;
402N/A+
402N/A+ while (count < len) {
402N/A
402N/A while (0 == n1) {
402N/A n1 = _RWSTD_SIZE_MAX == len ? len : len - count;
402N/A@@ -843,7 +846,6 @@
402N/A return len < count ? len : count;
402N/A }
402N/A
402N/A-
402N/A #ifndef _RWSTD_NO_WCHAR_T
402N/A
402N/A _TEST_EXPORT
402N/A@@ -1105,14 +1107,18 @@
402N/A size_t n2 = 0;
402N/A
402N/A unsigned long ch1;
402N/A+ UserChar ch2;
402N/A
402N/A- for (UserChar ch2; count < len; ) {
402N/A+ while (count < len) {
402N/A
402N/A while (0 == n1) {
402N/A n1 = _RWSTD_SIZE_MAX == len ? len : len - count;
402N/A ch1 = _rw_get_char (p1, &p1, &n1);
402N/A }
402N/A
402N/A+ if (!p2)
402N/A+ break;
402N/A+
402N/A ch2 = *p2++;
402N/A n2 = 1;
402N/A
402N/A--- stdcxx-4.2.1/tests/src/printf.cpp 2008-04-24 20:23:00.000000000 -0400
402N/A+++ stdcxx-4.2.1/tests/src/printf.cpp 2011-03-04 01:59:51.512363244 -0500
402N/A@@ -475,6 +475,7 @@
402N/A if (0 == newbuf)
402N/A return 0;
402N/A
402N/A+ memset (newbuf, '\0', size_t (newbufsize + guardsize));
402N/A memcpy (newbuf, *buf.pbuf, buflen);
402N/A
402N/A // append a guard block to the end of the buffer
402N/A@@ -708,6 +709,9 @@
402N/A size_t spec_bufsize = sizeof specbuf / sizeof *specbuf;
402N/A size_t paramno = 0;
402N/A
402N/A+ for (size_t i = 0; i < 32; ++i)
402N/A+ specbuf[i].strarg = 0;
402N/A+
402N/A if (0 == fmt || 0 > _RW::__rw_memattr (fmt, _RWSTD_SIZE_MAX, -1))
402N/A return _rw_fmtbadaddr (pspec [0], buf, fmt);
402N/A
402N/A@@ -743,6 +747,10 @@
402N/A
402N/A FmtSpec* const tmp = (FmtSpec*)malloc (bytesize * 2);
402N/A if (tmp) {
402N/A+ size_t j = ((bytesize * 2) / sizeof (FmtSpec));
402N/A+ for (size_t i = 0; i < j; ++i)
402N/A+ tmp[i].strarg = 0;
402N/A+
402N/A memcpy (tmp, pspec, bytesize);
402N/A if (pspec != specbuf)
402N/A free (pspec);
402N/A
402N/A--- stdcxx-4.2.1/tests/src/thread.cpp 2008-04-24 20:23:00.000000000 -0400
402N/A+++ stdcxx-4.2.1/tests/src/thread.cpp 2011-04-04 23:27:04.416978567 -0400
402N/A@@ -30,6 +30,8 @@
402N/A #define _RWSTD_TEST_SRC
402N/A
402N/A #include <rw_thread.h>
402N/A+#include <driver.h>
402N/A+
402N/A #include <stddef.h> // for size_t
402N/A #include <string.h> // for memset()
402N/A
402N/A@@ -50,7 +52,8 @@
402N/A
402N/A /**************************************************************************/
402N/A
402N/A-static long maxthreads;
402N/A+static long maxthreads = 0L;
402N/A+static int nthreads = 0;
402N/A
402N/A
402N/A #if defined (_RWSTD_POSIX_THREADS)
402N/A@@ -64,16 +67,19 @@
402N/A void* (*thr_proc)(void*),
402N/A void *thr_arg)
402N/A {
402N/A-#ifdef _RWSTD_OS_SUNOS
402N/A+#if defined(_RWSTD_OS_SUNOS) || defined(_RWSTD_OS_LINUX)
402N/A
402N/A- static int concurrency_set;
402N/A+ static int concurrency_set = 0;
402N/A+ static pthread_attr_t attr;
402N/A
402N/A if (0 == concurrency_set) {
402N/A- pthread_setconcurrency (4);
402N/A concurrency_set = 1;
402N/A+ pthread_attr_init (&attr);
402N/A+ pthread_attr_setstacksize (&attr, (4 * 1024 * 1024));
402N/A+ pthread_setconcurrency (nthreads ? nthreads : 4);
402N/A }
402N/A
402N/A-#endif // _RWSTD_OS_SUNOS
402N/A+#endif // _RWSTD_OS_SUNOS || _RWSTD_OS_LINUX
402N/A
402N/A
402N/A rw_thread_t tmpid;
402N/A@@ -89,8 +95,16 @@
402N/A // run even before pthread_create returns
402N/A thr_id->threadno = maxthreads;
402N/A
402N/A+#if defined(_RWSTD_OS_SUNOS) || defined(_RWSTD_OS_LINUX)
402N/A+
402N/A+ const int result = pthread_create (&tid, &attr, thr_proc, thr_arg);
402N/A+
402N/A+#else
402N/A+
402N/A const int result = pthread_create (&tid, 0, thr_proc, thr_arg);
402N/A
402N/A+#endif
402N/A+
402N/A if (0 == result) {
402N/A thr_id->id = (long)tid;
402N/A thr_id->handle = 0;
402N/A@@ -440,7 +454,7 @@
402N/A
402N/A # endif // _SC_NPROCESSORS_CONF
402N/A
402N/A- if (ncpus < 1 && cmd) {
402N/A+ if ((ncpus < 1) && cmd) {
402N/A // if the number of processors couldn't be determined using
402N/A // sysconf() above, open and read the output of the command
402N/A // from a pipe
402N/A@@ -486,6 +500,10 @@
402N/A
402N/A const bool join = 0 == thr_id;
402N/A
402N/A+ rw_info (0, 0, __LINE__,
402N/A+ "requesting a thread pool with %u threads", nthrs);
402N/A+
402N/A+
402N/A #ifdef _RWSTD_REENTRANT
402N/A
402N/A if (_RWSTD_SIZE_MAX == nthrs) {
402N/A@@ -496,7 +514,7 @@
402N/A const int ncpus = rw_get_cpus ();
402N/A
402N/A if (0 < ncpus)
402N/A- nthrs = size_t (ncpus) + 1;
402N/A+ nthrs = size_t (ncpus) * 2;
402N/A else
402N/A nthrs = 2;
402N/A }
402N/A@@ -507,7 +525,7 @@
402N/A // of a single thread and then waiting for it to finish
402N/A // by simply calling the thread procedure
402N/A
402N/A- if (1 == nthrs && join) {
402N/A+ if ((1 == nthrs) && join) {
402N/A
402N/A if (0 == thr_id) {
402N/A thr_id = id_buf;
402N/A@@ -527,12 +545,17 @@
402N/A }
402N/A #endif // !_RWSTD_REENTRANT
402N/A
402N/A+ rw_info (0, 0, __LINE__,
402N/A+ "creating a thread pool with %u threads", nthrs);
402N/A+
402N/A+ nthreads = static_cast<int> (nthrs);
402N/A+
402N/A bool delete_ids = false;
402N/A
402N/A if (0 == thr_id) {
402N/A // save thread idsso that they (and no other threads)
402N/A // can be joined later
402N/A- if (sizeof id_buf / sizeof *id_buf < nthrs) {
402N/A+ if ((sizeof id_buf / sizeof *id_buf) < nthrs) {
402N/A delete_ids = true;
402N/A thr_id = new rw_thread_t [nthrs];
402N/A }