stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r778855 [2/2] - in /stdcxx/branches/4.3.x: ./ doc/stdlibug/ examples/tutorial/ include/ include/loc/ include/rw/ src/ src/x86/ src/x86_64/ tests/include/
Date Tue, 26 May 2009 19:33:41 GMT
Modified: stdcxx/branches/4.3.x/src/num_put.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/num_put.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/num_put.cpp (original)
+++ stdcxx/branches/4.3.x/src/num_put.cpp Tue May 26 19:33:39 2009
@@ -57,7 +57,7 @@
 extern "C" {
 
 _RWSTD_DLLIMPORT int
-snprintf (char*, _RWSTD_SIZE_T, const char*, ...) _LIBC_THROWS ();
+snprintf (char*, size_t, const char*, ...) _LIBC_THROWS ();
 
 }   // extern "C"
 
@@ -131,12 +131,12 @@
 typedef unsigned _RWSTD_LONG_LONG _ULLong;
 
 
-static _RWSTD_SIZE_T
+static size_t
 __rw_btoa (char *buf, _ULLong i, unsigned base)
 {
     _RWSTD_ASSERT (base && base <= 36);
 
-    const _RWSTD_SIZE_T dig = _STD::numeric_limits<_ULLong>::digits + 0U;
+    const size_t dig = _STD::numeric_limits<_ULLong>::digits + 0U;
 
     char*             end   = buf + dig;
     const char* const begin = end;
@@ -151,7 +151,7 @@
         *--end = __rw_digits [i - tmp * base];
     } while ((i = tmp));
 
-    const _RWSTD_SIZE_T len = begin - end;
+    const size_t len = begin - end;
 
     memmove (buf, end, len);
 
@@ -159,12 +159,12 @@
 }
 
 
-static _RWSTD_SIZE_T
+static size_t
 __rw_dtoa (char *buf, _ULLong i, unsigned flags)
 {
     // get the maximum number of decimal digits for an unsigned long
     // with the largest magnitude, plus 1 for the (optional) sign
-    const _RWSTD_SIZE_T dig10 = _STD::numeric_limits<_ULLong>::digits10 + 2U;
+    const size_t dig10 = _STD::numeric_limits<_ULLong>::digits10 + 2U;
 
     char*             end   = buf + dig10;
     const char* const begin = end;
@@ -183,7 +183,7 @@
     if (flags & _RWSTD_IOS_SHOWPOS)
         *--end = '+';
 
-    const _RWSTD_SIZE_T len = begin - end;
+    const size_t len = begin - end;
 
     memmove (buf, end, len);
 
@@ -191,7 +191,7 @@
 }
 
 
-static inline _RWSTD_SIZE_T
+static inline size_t
 __rw_dtoa (char *buf, _LLong i, unsigned flags)
 {
     size_t n;
@@ -214,7 +214,7 @@
 }
 
 
-static _RWSTD_SIZE_T
+static size_t
 __rw_itoa (char *buf, _ULLong i, unsigned flags)
 {
     const char* const pdigs = flags & _RWSTD_IOS_UPPERCASE ?
@@ -263,7 +263,9 @@
 
     // skip leading zeros
     if (i) {
-        for (j = digits - 1; j && !(i & (base << j * bits)); --j);
+        j = digits - 1;
+        while (j && !(i & (base << j * bits)))
+            --j;
     }
     else
         j = 0;
@@ -281,7 +283,7 @@
 }
 
 
-static inline _RWSTD_SIZE_T
+static inline size_t
 __rw_itoa (char *buf, _LLong i, unsigned flags)
 {
     if (10 == flags >> _RWSTD_IOS_BASEOFF)
@@ -294,12 +296,12 @@
 #endif   // _RWSTD_LONG_LONG
 
 
-static _RWSTD_SIZE_T
+static size_t
 __rw_btoa (char *buf, unsigned long i, unsigned base)
 {
     _RWSTD_ASSERT (base && base <= 36);
 
-    const _RWSTD_SIZE_T dig = _STD::numeric_limits<unsigned long>::digits + 0U;
+    const size_t dig = _STD::numeric_limits<unsigned long>::digits + 0U;
 
     char*             end   = buf + dig;
     const char* const begin = end;
@@ -314,7 +316,7 @@
         *--end = __rw_digits [i - tmp * base];
     } while ((i = tmp));
 
-    const _RWSTD_SIZE_T len = begin - end;
+    const size_t len = begin - end;
 
    memmove (buf, end, len);
 
@@ -327,7 +329,7 @@
 {
     // get the maximum number of decimal digits for an unsigned long
     // with the largest magnitude, plus 1 for the (optional) sign
-    const _RWSTD_SIZE_T dig10 =
+    const size_t dig10 =
         _STD::numeric_limits<unsigned long>::digits10 + 2U;
 
     char*             end   = buf + dig10;
@@ -349,7 +351,7 @@
         *--end = '+';
 
     // move the contents of the buffer to the beginning
-    const _RWSTD_SIZE_T len = begin - end;
+    const size_t len = begin - end;
 
     memmove (buf, end, len);
 
@@ -357,7 +359,7 @@
 }
 
 
-static inline _RWSTD_SIZE_T
+static inline size_t
 __rw_dtoa (char *buf, long i, unsigned flags)
 {
     size_t n;
@@ -381,7 +383,7 @@
 
 
 // convert unsigned long to a roman number
-static _RWSTD_SIZE_T
+static size_t
 __rw_utor (char *buf, unsigned long i, unsigned flags)
 {
     //                          01234560123456
@@ -426,7 +428,7 @@
 }
 
 
-static _RWSTD_SIZE_T
+static size_t
 __rw_itoa (char *buf, unsigned long i, unsigned flags)
 {
     const char* const pdigs = flags & _RWSTD_IOS_UPPERCASE ?
@@ -476,7 +478,9 @@
         const int digits =
             (_STD::numeric_limits<unsigned long>::digits + bits - 1) / bits;
 
-        for (j = digits - 1; !(i & (long (basemask) << j * bits)); --j);
+        j = digits - 1;
+        while (!(i & (long (basemask) << j * bits)))
+            --j;
     }
     else
         j = 0;
@@ -493,7 +497,7 @@
 }
 
 
-static inline _RWSTD_SIZE_T
+static inline size_t
 __rw_itoa (char *buf, long i, unsigned flags)
 {
     if (10 == flags >> _RWSTD_IOS_BASEOFF)
@@ -503,8 +507,8 @@
 }
 
 
-_RWSTD_EXPORT _RWSTD_SIZE_T
-__rw_put_groups (char **pbuf, _RWSTD_SIZE_T len, _RWSTD_SIZE_T bufsize,
+_RWSTD_EXPORT size_t
+__rw_put_groups (char **pbuf, size_t len, size_t bufsize,
                  const char *end, const char *grouping)
 {
     _RWSTD_ASSERT (0 != *pbuf);
@@ -542,8 +546,8 @@
             ++pd;
     }
 
-    _RWSTD_SIZE_T ngrps  = 0;   // number of complete groups
-    _RWSTD_SIZE_T grplen = 0;   // length of complete groups
+    size_t ngrps  = 0;   // number of complete groups
+    size_t grplen = 0;   // length of complete groups
 
     // compute the amount of buffer space needed for group separators
     const char *pg = grouping;
@@ -562,7 +566,7 @@
         else
             ++pg;
 
-        if (grplen + grp >= _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, end - pd))
+        if (grplen + grp >= _RWSTD_STATIC_CAST (size_t, end - pd))
             break;
 
         grplen += grp;
@@ -587,7 +591,7 @@
             *pd = pd [-_RWSTD_STATIC_CAST (_RWSTD_PTRDIFF_T, ngrps)];
         }
         else {
-            if ((_RWSTD_SIZE_T)(end - pd) == grplen + 1) {
+            if (size_t (end - pd) == grplen + 1) {
                 // insert throusands separator and compute
                 // the offset of the next separator
                 *pd = ';';
@@ -634,7 +638,7 @@
 
 
 static inline void
-__rw_fix_flt (char *&end, _RWSTD_SIZE_T &len,
+__rw_fix_flt (char *&end, size_t &len,
               unsigned flags, _RWSTD_STREAMSIZE prec)
 {
 #ifdef _WIN32
@@ -654,7 +658,7 @@
         for (ptr = beg + 2; ptr != end && '0' == *ptr; ++ptr) ;
 
         if (ptr == end) {
-            const _RWSTD_SIZE_T exp_len =
+            const size_t exp_len =
                 0 > prec ? 7 : (1 < prec ? prec + 1 : 2);
             if (exp_len < len) {
                 end = beg + exp_len;
@@ -793,8 +797,8 @@
 
 
 
-_RWSTD_EXPORT _RWSTD_SIZE_T
-__rw_put_num (char **pbuf, _RWSTD_SIZE_T bufsize,
+_RWSTD_EXPORT size_t
+__rw_put_num (char **pbuf, size_t bufsize,
               unsigned flags, int type, _RWSTD_STREAMSIZE prec,
               const void *pval, const char *grouping)
 {
@@ -802,11 +806,9 @@
     const char       *fmt = 0;       // stdio format specifier
     char* const       buf = *pbuf;   // saved value of *pbuf
     char             *end = 0;       // decimal point
-    _RWSTD_SIZE_T     len;           // length of formatted number
+    size_t            len;           // length of formatted number
     _RWSTD_STREAMSIZE fpr;           // special case floating point precision
 
-    typedef _RWSTD_SIZE_T SizeT;
-
     switch (type) {
 
     case __rw_facet::_C_bool:
@@ -872,7 +874,7 @@
                 fmt = __rw_get_stdio_fmat (fmtbuf, type & ~__rw_facet::_C_ptr,
                                            flags, fpr);
                 for (; ;) {
-                    len = SizeT (_SNPRINTF (*pbuf, bufsize, fmt, fval));
+                    len = size_t (_SNPRINTF (*pbuf, bufsize, fmt, fval));
 
                     if (len >= bufsize) {
                         if (*pbuf != buf)
@@ -908,7 +910,7 @@
                                            flags, fpr);
 
                 for ( ; ; ) {
-                    len = SizeT (_SNPRINTF (*pbuf, bufsize, fmt, dval));
+                    len = size_t (_SNPRINTF (*pbuf, bufsize, fmt, dval));
 
                     if (len >= bufsize) {
                         if (*pbuf != buf)
@@ -946,7 +948,7 @@
                                            flags, fpr);
 
                 for ( ; ; ) {
-                    len = SizeT (_SNPRINTF (*pbuf, bufsize, fmt, ldval));
+                    len = size_t (_SNPRINTF (*pbuf, bufsize, fmt, ldval));
                     if (len >= bufsize) {
                         if (*pbuf != buf)
                             delete[] *pbuf;
@@ -974,7 +976,7 @@
     case __rw_facet::_C_pvoid:
         if (pval) {
             fmt = __rw_get_stdio_fmat (fmtbuf, type, flags, prec);
-            len = SizeT (_SNPRINTF (buf, bufsize, fmt, pval));
+            len = size_t (_SNPRINTF (buf, bufsize, fmt, pval));
         }
         else {
             // prevent GNU libc from formatting null pointers as "(nil)"
@@ -1007,8 +1009,8 @@
 
         const _RWSTD_PTRDIFF_T ndigs = len - sign;
 
-        _RWSTD_SIZE_T nfill;   // the number of 0's to insert
-        _RWSTD_SIZE_T nmove;   // the number of digits to move
+        size_t nfill;   // the number of 0's to insert
+        size_t nmove;   // the number of digits to move
 
         if (-prec >= ndigs) {
 
@@ -1031,7 +1033,7 @@
             // e.g., "1234" with prec == -3 yields "1.234"
 
             nfill = 0;
-            nmove = SizeT (-prec);
+            nmove = size_t (-prec);
 
             src = beg + (ndigs + prec);
             dst = src + 1;

Modified: stdcxx/branches/4.3.x/src/random.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/random.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/random.cpp (original)
+++ stdcxx/branches/4.3.x/src/random.cpp Tue May 26 19:33:39 2009
@@ -35,7 +35,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.
  * 
  **************************************************************************/
 
@@ -63,7 +63,7 @@
 
 // generator may produces a different sequence of random numbers
 // on different architectures (depending on the width of size_t)
-typedef _RWSTD_SIZE_T __rw_random_t;
+typedef size_t __rw_random_t;
 
 #endif   // _RWSTD_NO_EXT_PORTABLE_RANDOM_SEQUENCE
 
@@ -83,19 +83,19 @@
 {
     __rw_table [__rw_table_size - 1] = seed;
 
-    _RWSTD_SIZE_T i;
+    size_t i;
 
     __rw_random_t k = 1;
 
     for (i = 0; i != __rw_table_size - 1; ++i) {
-        const _RWSTD_SIZE_T ii = 21U * i % __rw_table_size;
+        const size_t ii = 21U * i % __rw_table_size;
         __rw_table [ii] = k;
         k               = seed - k;
         seed            = __rw_table [ii];
     }
 
     for (i = 0; i != 4U; ++i) {
-        for (_RWSTD_SIZE_T ii = 0; ii != __rw_table_size; ++ii)
+        for (size_t ii = 0; ii != __rw_table_size; ++ii)
             __rw_table [i] =
                 __rw_table [i] - __rw_table [(i + 31U) % __rw_table_size];
     }
@@ -107,8 +107,8 @@
 
 struct _RandGuardT;
 
-_RWSTD_EXPORT _RWSTD_SIZE_T
-__rw_rand (_RWSTD_SIZE_T limit)
+_RWSTD_EXPORT size_t
+__rw_rand (size_t limit)
 {
     _RWSTD_ASSERT (0 != limit);
 

Modified: stdcxx/branches/4.3.x/src/string.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/string.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/string.cpp (original)
+++ stdcxx/branches/4.3.x/src/string.cpp Tue May 26 19:33:39 2009
@@ -34,7 +34,7 @@
 _RWSTD_EXPORT void*
 __rw_memcpy (void *dst, const void *src, _RWSTD_SIZE_T nbytes)
 {
-    _RWSTD_ASSERT (0 == nbytes || dst && src);
+    _RWSTD_ASSERT (0 == nbytes || (dst && src));
 
     const char* csrc = _RWSTD_STATIC_CAST (const char*, src);
 
@@ -48,7 +48,7 @@
 _RWSTD_EXPORT void*
 __rw_memmove (void *dst, const void *src, _RWSTD_SIZE_T nbytes)
 {
-    _RWSTD_ASSERT (0 == nbytes || dst && src);
+    _RWSTD_ASSERT (0 == nbytes || (dst && src));
 
     char* cdst = _RWSTD_STATIC_CAST (char*, dst);
     const char* csrc = _RWSTD_STATIC_CAST (const char*, src);
@@ -99,7 +99,7 @@
 _RWSTD_EXPORT int
 __rw_memcmp (const void *s1, const void *s2, _RWSTD_SIZE_T nbytes)
 {
-    _RWSTD_ASSERT (0 == nbytes || s1 && s2);
+    _RWSTD_ASSERT (0 == nbytes || (s1 && s2));
 
     typedef unsigned char UChar;
 
@@ -108,7 +108,8 @@
 
     int result = 0;
 
-    for ( ; nbytes && !(result = *cs1 - *cs2); ++cs1, ++cs2, --nbytes);
+    for ( ; nbytes && !(result = *cs1 - *cs2); ++cs1, ++cs2, --nbytes)
+        /* no-op */;
 
     return result;
 }
@@ -119,7 +120,8 @@
 {
     const char* const begin = str;
 
-    for (; *str; ++str);
+    while (*str)
+        ++str;
 
     return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, str - begin);
 }
@@ -130,7 +132,7 @@
 _RWSTD_EXPORT wchar_t*
 __rw_wmemcpy (wchar_t *dst, const wchar_t *src, _RWSTD_SIZE_T nwchars)
 {
-    _RWSTD_ASSERT (0 == nwchars || dst && src);
+    _RWSTD_ASSERT (0 == nwchars || (dst && src));
 
     for (wchar_t *tmp = dst; nwchars; --nwchars)
         *tmp++ = *src++;
@@ -142,7 +144,7 @@
 _RWSTD_EXPORT wchar_t*
 __rw_wmemmove (wchar_t *dst, const wchar_t *src, _RWSTD_SIZE_T nwchars)
 {
-    _RWSTD_ASSERT (0 == nwchars || dst && src);
+    _RWSTD_ASSERT (0 == nwchars || (dst && src));
 
     if (dst < src) {
         while (nwchars--)
@@ -186,11 +188,12 @@
 _RWSTD_EXPORT int
 __rw_wmemcmp (const wchar_t *s1, const wchar_t *s2, _RWSTD_SIZE_T nwchars)
 {
-    _RWSTD_ASSERT (0 == nwchars || s1 && s2);
+    _RWSTD_ASSERT (0 == nwchars || (s1 && s2));
 
     int result = 0;
 
-    for ( ; nwchars && !(result = *s1 - *s2); ++s1, ++s2, --nwchars);
+    for ( ; nwchars && !(result = *s1 - *s2); ++s1, ++s2, --nwchars)
+        /* no-op */;
 
     return result;
 }
@@ -203,7 +206,8 @@
 
     const wchar_t* const begin = wstr;
 
-    for (; *wstr; ++wstr);
+    while (*wstr)
+        ++wstr;
 
     return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, wstr - begin);
 }

Modified: stdcxx/branches/4.3.x/src/strstream.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/strstream.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/strstream.cpp (original)
+++ stdcxx/branches/4.3.x/src/strstream.cpp Tue May 26 19:33:39 2009
@@ -22,7 +22,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -40,7 +40,7 @@
 
 #include <rw/_defs.h>
 
-#include <limits.h>
+#include <stddef.h>   // for size_t
 
 #include <ios>
 #include <strstream>
@@ -50,7 +50,7 @@
 
 
 /* virtual */
-strstreambuf::~strstreambuf ()
+strstreambuf::~strstreambuf () /* nothrow */
 {
     _RWSTD_ASSERT (_C_is_valid ());
 
@@ -91,7 +91,7 @@
 
 
 /* virtual */ strstreambuf::int_type
-strstreambuf::pbackfail (int_type c)
+strstreambuf::pbackfail (int_type c) /* nothrow */
 {
     _RWSTD_ASSERT (_C_is_valid ());
 
@@ -133,7 +133,7 @@
 
 
 /* virtual */ strstreambuf::int_type
-strstreambuf::underflow ()
+strstreambuf::underflow () /* nothrow */
 {
     _RWSTD_ASSERT (_C_is_valid ());
 
@@ -162,6 +162,7 @@
 
 /* virtual */ strstreambuf::pos_type
 strstreambuf::seekoff (off_type off, ios::seekdir way, ios::openmode which)
+    /* nothrow */
 {
     _RWSTD_ASSERT (_C_is_valid ());
 
@@ -229,7 +230,7 @@
 
 
 /* virtual */ strstreambuf::pos_type
-strstreambuf::seekpos (pos_type sp, ios::openmode which)
+strstreambuf::seekpos (pos_type sp, ios::openmode which) /* nothrow */
 {
     _RWSTD_ASSERT (_C_is_valid ());
 
@@ -245,7 +246,7 @@
     _RWSTD_ASSERT (_C_is_valid ());
 
     if (   !(_C_state & _C_dynamic) || (_C_state & _C_frozen)
-        || !buf && !bufsize) {
+        || (!buf && !bufsize)) {
         // lwg issue 66
         return 0;
     }
@@ -344,9 +345,9 @@
          const void *gnext_v,
          streamsize  n,
          const void *pbeg_v,
-         void*     (*palloc)(_RWSTD_SIZE_T),
+         void*     (*palloc)(size_t),
          void      (*pdealloc)(void*),
-         int         state)
+         int         state) _THROWS (())
 {
     _C_alsize = alsize;
     _C_palloc = palloc;

Modified: stdcxx/branches/4.3.x/src/time_put.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/time_put.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/time_put.cpp (original)
+++ stdcxx/branches/4.3.x/src/time_put.cpp Tue May 26 19:33:39 2009
@@ -133,13 +133,13 @@
     (_RW::__rw_classic_tab [(unsigned char)c] & _RW::__rw_digit)
 
 
-_RWSTD_SIZE_T
+size_t
 __rw_get_timepunct (const _RW::__rw_facet*, int,
-                    const void*[], const _RWSTD_SIZE_T []);
+                    const void*[], const size_t []);
 
 // also declared in _time_put.cc
 _RWSTD_EXPORT char*
-__rw_put_time (const __rw_facet*, char*, _RWSTD_SIZE_T,
+__rw_put_time (const __rw_facet*, char*, size_t,
                _STD::ios_base&, char, const tm*,
                char, char, int, int);
 
@@ -148,7 +148,7 @@
 
 // also declared in _time_put.cc
 _RWSTD_EXPORT wchar_t*
-__rw_put_time (const __rw_facet*, wchar_t*, _RWSTD_SIZE_T,
+__rw_put_time (const __rw_facet*, wchar_t*, size_t,
                _STD::ios_base&, wchar_t, const tm*,
                char, char, int, int);
 
@@ -164,7 +164,7 @@
 
 // compute the format string corresponding to the "%x" format specifier
 // in the current locale (set by setlocale (LC_ALL, ...))
-static _RWSTD_SIZE_T
+static size_t
 __rw_get_date_fmat (char *fmt)
 {
     tm t;
@@ -190,10 +190,10 @@
     char abmon [256];   // buffer for abbreviated month name
     char mon [256];     // buffer for full month name
 
-    _RWSTD_SIZE_T abday_len = 0;
-    _RWSTD_SIZE_T day_len;
-    _RWSTD_SIZE_T abmon_len;
-    _RWSTD_SIZE_T mon_len;
+    size_t abday_len = 0;
+    size_t day_len;
+    size_t abmon_len;
+    size_t mon_len;
 
     for (char *ptmp = tmp; *ptmp; ) {
 
@@ -215,7 +215,7 @@
                 *pfmt++ = *ptmp;
         }
 
-        const _RWSTD_SIZE_T len = ptmp - begin;
+        const size_t len = ptmp - begin;
 
         if (len > 1) {
 
@@ -231,7 +231,7 @@
             }
 
             char fmtchar = '\0';
-            _RWSTD_SIZE_T start = 0;
+            size_t start = 0;
 
             if (day_len <= len && !memcmp (day, begin, day_len)) {
                 fmtchar = 'A';
@@ -301,7 +301,7 @@
 
 // compute the format string corresponding to the "%X" format specifier
 // in the current locale (set by setlocale (LC_ALL, ...))
-static _RWSTD_SIZE_T
+static size_t
 __rw_get_time_fmat (char *fmt)
 {
     tm t;
@@ -319,7 +319,7 @@
 
     char pm [256];   // buffer for pm designator
 
-    _RWSTD_SIZE_T pm_len = 0;
+    size_t pm_len = 0;
 
     for (char *ptmp = tmp; *ptmp; ) {
 
@@ -340,7 +340,7 @@
                 *pfmt++ = *ptmp;
         }
 
-        const _RWSTD_SIZE_T len = ptmp - begin;
+        const size_t len = ptmp - begin;
 
         if (len > 1) {
             if (0 == pm_len) {
@@ -355,7 +355,7 @@
                 *pfmt++ = 'p';
 
                 // copy whatever follows the pm designator
-                for (_RWSTD_SIZE_T i = pm_len; i != len; ++i)
+                for (size_t i = pm_len; i != len; ++i)
                     *pfmt++ = begin [i];
             }
         }
@@ -411,7 +411,7 @@
 
 
 const void*
-__rw_get_timepunct (const __rw_facet *pfacet, int flags, _RWSTD_SIZE_T inx)
+__rw_get_timepunct (const __rw_facet *pfacet, int flags, size_t inx)
 {
     const int  member = flags & ~__rw_wide;
     const bool wide   = !!(flags & __rw_wide);
@@ -449,7 +449,7 @@
     // set all categories (need LC_TIME and LC_CTYPE) and lock
     const __rw_setlocale clocale (locname, _RWSTD_LC_ALL);
 
-    _RWSTD_SIZE_T bufsize = 2048;
+    size_t bufsize = 2048;
 
     const size_t newsize = bufsize + sizeof (__rw_time_t);
  
@@ -470,22 +470,22 @@
     // reserve offset 0 for the empty string (both narrow and wide)
     *_RWSTD_REINTERPRET_CAST (wchar_t*, pbuf) = L'\0';
 
-    _RWSTD_SIZE_T off = sizeof (wchar_t);
+    size_t off = sizeof (wchar_t);
 
 #else   // if defined (_RWSTD_NO_WCHAR_T)
 
     // reserve offset 0 for the empty string
     *pbuf = '\0';
 
-    _RWSTD_SIZE_T off = sizeof (char);
+    size_t off = sizeof (char);
 
 #endif   // _RWSTD_NO_WCHAR_T
 
 #ifndef _RWSTD_NO_NL_LANGINFO
 
     static const struct {
-        int           nl_item;    // argument to nl_langinfo()
-        _RWSTD_SIZE_T moff [2];   // member offset
+        int    nl_item;    // argument to nl_langinfo()
+        size_t moff [2];   // member offset
     } nl_items [] = {
 
 
@@ -588,7 +588,7 @@
 
     const bool c_locale = 'C' == locname [0] && '\0' == locname [1];
 
-    for (_RWSTD_SIZE_T i = 0; i != sizeof nl_items / sizeof *nl_items; ++i) {
+    for (size_t i = 0; i != sizeof nl_items / sizeof *nl_items; ++i) {
 
         if (D_T_FMT == nl_items [i].nl_item && i)
             continue;
@@ -599,11 +599,11 @@
 
         _RWSTD_ASSERT (0 != str);
 
-        _RWSTD_SIZE_T size = 1 + strlen (str);
+        size_t size = 1 + strlen (str);
 
         // estimate the size required to accommodate both
         // the narrow and the wide char representations
-        const _RWSTD_SIZE_T estsize = size * (1 + sizeof (wchar_t));
+        const size_t estsize = size * (1 + sizeof (wchar_t));
 
         if (off + estsize >= bufsize) {
             // reallocate
@@ -632,7 +632,7 @@
 #ifndef _RWSTD_NO_WCHAR_T
 
         // make sure wide string is properly aligned
-        const _RWSTD_SIZE_T align = off % sizeof (wchar_t);
+        const size_t align = off % sizeof (wchar_t);
         if (align)
             off += sizeof (wchar_t) - align;
 
@@ -665,14 +665,14 @@
 
     memset (&t, 0, sizeof t);
 
-    _RWSTD_SIZE_T len;
+    size_t len;
 
 
 #if 0   // FIXME: implement same way as above
 
     static const struct {
         int tm::      *pmem;
-        _RWSTD_SIZE_T  moff;
+        size_t         moff;
         const char     fmt [3];
         int            begin;
         int            end;
@@ -685,7 +685,7 @@
         { &tm::tm_hour, "%p", 1, 13, 12 }
     };
 
-    for (_RWSTD_SIZE_T i = 0; i != sizeof fmats / sizef *fmats; ++i) {
+    for (size_t i = 0; i != sizeof fmats / sizef *fmats; ++i) {
 
         for (int j = fmats [i].begin; j != fmats [i].end; j != fmats [i].step) {
 
@@ -719,7 +719,7 @@
 #  ifndef _RWSTD_NO_WCHAR_T
 
         // make sure wide strings are properly aligned
-        const _RWSTD_SIZE_T align = off % sizeof (wchar_t);
+        const size_t align = off % sizeof (wchar_t);
         if (align)
             off += sizeof (wchar_t) - align;
 
@@ -746,7 +746,7 @@
             _RWSTD_STATIC_CAST (const char*, pun->abday (t.tm_wday, 0));
 
         wchar_t *pwbuf = _RWSTD_REINTERPRET_CAST (wchar_t*, pbuf + off);
-        _RWSTD_SIZE_T size =
+        size_t size =
             mbstowcs (pwbuf, str, (bufsize - off) / sizeof (*pwbuf));
 
         if (_RWSTD_SIZE_MAX == size) {
@@ -801,7 +801,7 @@
 #  ifndef _RWSTD_NO_WCHAR_T
 
         // make sure wide strings are properly aligned
-        const _RWSTD_SIZE_T align = off % sizeof (wchar_t);
+        const size_t align = off % sizeof (wchar_t);
         if (align)
             off += sizeof (wchar_t) - align;
 
@@ -827,7 +827,7 @@
         const char *str =
             _RWSTD_STATIC_CAST (const char*, pun->abmon (t.tm_mon, 0));
         wchar_t *pwbuf = _RWSTD_REINTERPRET_CAST (wchar_t*, pbuf + off);
-        _RWSTD_SIZE_T size =
+        size_t size =
             mbstowcs (pwbuf, str, (bufsize - off) / sizeof (*pwbuf));
 
         if (_RWSTD_SIZE_MAX == size) {
@@ -916,13 +916,13 @@
 
 #  ifndef _RWSTD_NO_WCHAR_T
 
-    const _RWSTD_SIZE_T align = off % sizeof (wchar_t);
+    const size_t align = off % sizeof (wchar_t);
     if (align)
         off += sizeof (wchar_t) - align;
 
-    const char    *str;
-    wchar_t       *pwbuf;
-    _RWSTD_SIZE_T  size;
+    const char *str;
+    wchar_t    *pwbuf;
+    size_t      size;
 
 #    ifndef _RWSTD_NO_WCSFTIME
 
@@ -1063,15 +1063,15 @@
 }
 
 
-_RWSTD_SIZE_T
+size_t
 __rw_get_timepunct (const __rw_facet *pfacet, int flags,
-                    const void *names[], _RWSTD_SIZE_T sizes[])
+                    const void *names[], size_t sizes[])
 {
     const bool wide = !!(flags & __rw_wide);
 
     const int member = flags & ~__rw_wide;
 
-    _RWSTD_SIZE_T count = 0;
+    size_t count = 0;
 
     int flags_2 = 0;
 
@@ -1107,7 +1107,7 @@
             _RWSTD_STATIC_CAST (const __rw_time_t*,
                                 __rw_get_timepunct (pfacet, 0, 0));
 
-        count = (_RWSTD_SIZE_T)ptime->era_count ();
+        count = size_t (ptime->era_count ());
         break;
     }
 
@@ -1129,7 +1129,7 @@
             _RWSTD_STATIC_CAST (const __rw_time_t*,
                                 __rw_get_timepunct (pfacet, 0, 0));
 
-        count = (_RWSTD_SIZE_T)ptime->alt_digits_count ();
+        count = size_t (ptime->alt_digits_count ());
         break;
     }
 
@@ -1149,7 +1149,7 @@
     if (wide)
         flags |= __rw_wide;
 
-    for (_RWSTD_SIZE_T i = 0; i != count; ++i) {
+    for (size_t i = 0; i != count; ++i) {
         names [i] = __rw_get_timepunct (pfacet, flags, i);
 
 #ifndef _RWSTD_NO_WCHAR_T
@@ -1168,7 +1168,7 @@
         if (wide)
             flags_2 |= __rw_wide;
 
-        for (_RWSTD_SIZE_T j = count; j != 2 * count; ++j) {
+        for (size_t j = count; j != 2 * count; ++j) {
             names [j] = __rw_get_timepunct (pfacet, flags_2, j - count);
 
 #ifndef _RWSTD_NO_WCHAR_T
@@ -1189,10 +1189,10 @@
 }
 
 
-_RWSTD_EXPORT _RWSTD_SIZE_T
+_RWSTD_EXPORT size_t
 __rw_get_timepunct (const __rw_facet *pfacet,
                     int data [4], tm *tmb, int **pmem,
-                    const void *names[], _RWSTD_SIZE_T sizes[])
+                    const void *names[], size_t sizes[])
 {
     enum _Fmt {   // for convenience
         _AmPm        = __rw_ampm,
@@ -1229,7 +1229,7 @@
     const void** pv =
         _RWSTD_REINTERPRET_CAST (const void**, names);
 
-    _RWSTD_SIZE_T cnt = 0;
+    size_t cnt = 0;
 
     int flags = 0;
 
@@ -1494,7 +1494,7 @@
 
 
 static char*
-__rw_fmt_time (const __rw_facet *pfacet, char *buf, _RWSTD_SIZE_T bufsize,
+__rw_fmt_time (const __rw_facet *pfacet, char *buf, size_t bufsize,
                _STD::ios_base &flags, char fill, const tm *tmb,
                const char *pat)
 {
@@ -1632,7 +1632,7 @@
 #ifndef _RWSTD_NO_WCHAR_T
 
 static wchar_t*
-__rw_fmt_time (const __rw_facet *pfacet, wchar_t *wbuf, _RWSTD_SIZE_T bufsize,
+__rw_fmt_time (const __rw_facet *pfacet, wchar_t *wbuf, size_t bufsize,
                _STD::ios_base &flags, wchar_t fill, const tm *tmb,
                const wchar_t *wpat)
 {
@@ -1832,9 +1832,9 @@
     const int year = 1900 + tmb->tm_year;
 
     // get the number of eras in this locale
-    const _RWSTD_SIZE_T neras = (_RWSTD_SIZE_T)ptime->era_count ();
+    const size_t neras = size_t (ptime->era_count ());
 
-    for (_RWSTD_SIZE_T i = 0; i != neras; ++i) {
+    for (size_t i = 0; i != neras; ++i) {
         const __rw_time_t::era_t* const pera = ptime->era (i);
 
         _RWSTD_ASSERT (0 != pera);
@@ -1845,10 +1845,10 @@
         const int e = !b;                 // end index
 
         // check to see if the specified date belongs to the era
-        if (   year > pera->year [b] && year < pera->year [e]
+        if (   (year > pera->year [b] && year < pera->year [e])
             || (   (year == pera->year [b] || year == pera->year [e])
-                && (   tmb->tm_mon > pera->month [b]
-                    && tmb->tm_mon < pera->month [e]
+                && (   (   tmb->tm_mon > pera->month [b]
+                        && tmb->tm_mon < pera->month [e])
                     || (    (   tmb->tm_mon == pera->month [b]
                              || tmb->tm_mon == pera->month [e])
                         && tmb->tm_mday >= pera->day [b]
@@ -1889,7 +1889,7 @@
         offset = *var++ - '0';
 
         if (ISDIGIT (*var)) {
-            if (offset < 2 || *var >= '0' && *var <= '4') {
+            if (offset < 2 || (*var >= '0' && *var <= '4')) {
                 // add offset in hours
                 offset = offset * 10 + *var++ - '0';
             }
@@ -1971,7 +1971,8 @@
 
     if ('<' == *var) {
         // skip past the alphanumeric std designator enclosed in <>
-        while (*var && '>' != *var++);
+        while (*var && '>' != *var++)
+            /* no-op */;
     }
     else {
         const char* const stdbeg = var;
@@ -1982,10 +1983,11 @@
         // be handled in an implementation-defined way (i.e., using
         // tzset())
 
-        for (; ISALPHA (*var); ++var);
+        while (ISALPHA (*var))
+            ++var;
 
         if (   var == stdbeg
-            || *var && '+' != *var && '-' != *var && !ISDIGIT (*var))
+            || (*var && '+' != *var && '-' != *var && !ISDIGIT (*var)))
             goto use_tzset;
     }
 
@@ -1998,14 +2000,16 @@
 
         if ('<' == *var)
             // skip past the quoted alphanumeric dst designator
-            while (*var && '>' != *var++);
+            while (*var && '>' != *var++)
+                /* no-op */;
         else {
             // skip past the alphabetic dst designator
-            for (; ISALPHA (*var); ++var);
+            while (ISALPHA (*var))
+                ++var;
         }
 
         if (   var == dstbeg
-            || *var && '+' != *var && '-' != *var && !ISDIGIT (*var))
+            || (*var && '+' != *var && '-' != *var && !ISDIGIT (*var)))
             goto use_tzset;
 
         tpd.val = __rw_get_zone_off (var, &var);
@@ -2167,9 +2171,9 @@
 
         if (   !tpd.fmt
 #ifndef _RWSTD_NO_WCHAR_T
-            ||  wide && !*_RWSTD_STATIC_CAST (const wchar_t*, tpd.fmt)
+            ||  (wide && !*_RWSTD_STATIC_CAST (const wchar_t*, tpd.fmt))
 #endif   // _RWSTD_NO_WCHAR_T
-            || !wide && !*_RWSTD_STATIC_CAST (const char*, tpd.fmt))
+            || (!wide && !*_RWSTD_STATIC_CAST (const char*, tpd.fmt)))
             tpd.fmt = ptime->d_t_fmt (wide);
 
         _RWSTD_ASSERT (0 != tpd.fmt);
@@ -2502,9 +2506,9 @@
 
         if (   !tpd.fmt
 #ifndef _RWSTD_NO_WCHAR_T
-            ||  wide && !*_RWSTD_STATIC_CAST (const wchar_t*, tpd.fmt)
+            ||  (wide && !*_RWSTD_STATIC_CAST (const wchar_t*, tpd.fmt))
 #endif   // _RWSTD_NO_WCHAR_T
-            || !wide && !*_RWSTD_STATIC_CAST (const char*, tpd.fmt))
+            || (!wide && !*_RWSTD_STATIC_CAST (const char*, tpd.fmt)))
             tpd.fmt = ptime->d_fmt (wide);
 
         break;
@@ -2518,9 +2522,9 @@
 
         if (   !tpd.fmt
 #ifndef _RWSTD_NO_WCHAR_T
-            ||  wide && !*_RWSTD_STATIC_CAST (const wchar_t*, tpd.fmt)
+            ||  (wide && !*_RWSTD_STATIC_CAST (const wchar_t*, tpd.fmt))
 #endif   // _RWSTD_NO_WCHAR_T
-            || !wide && !*_RWSTD_STATIC_CAST (const char*, tpd.fmt))
+            || (!wide && !*_RWSTD_STATIC_CAST (const char*, tpd.fmt)))
             tpd.fmt = ptime->t_fmt (wide);
 
         break;
@@ -2667,13 +2671,13 @@
 
 
 _RWSTD_EXPORT char*
-__rw_put_time (const __rw_facet *facet, char *buf, _RWSTD_SIZE_T bufsize,
+__rw_put_time (const __rw_facet *facet, char *buf, size_t bufsize,
                _STD::ios_base &flags, char fill, const tm *tmb,
                char fmt, char mod, int width, int prec)
 {
     _RWSTD_ASSERT (0 != facet);
 
-    _RWSTD_SIZE_T res = 0;   // size of formatted output, -1 on error
+    size_t res = 0;   // size of formatted output, -1 on error
 
     // compute the values and get the format
     __rw_time_put_data tpd;
@@ -2718,9 +2722,9 @@
 
         const char* const fmtstr = 'z' == fmt ? "%+*.*d" : "%*.*d";
 
-        res = (_RWSTD_SIZE_T)sprintf (buf, fmtstr,
-                                      width < 0 ? tpd.width : width,
-                                      prec < 0 ? tpd.prec : prec, tpd.val);
+        res = size_t (sprintf (buf, fmtstr,
+                               width < 0 ? tpd.width : width,
+                               prec < 0 ? tpd.prec : prec, tpd.val));
     }
     else {
         if (!tmb && tpd.fmt) {
@@ -2769,13 +2773,13 @@
 #ifndef _RWSTD_NO_WCHAR_T
 
 _RWSTD_EXPORT wchar_t*
-__rw_put_time (const __rw_facet *facet, wchar_t *wbuf, _RWSTD_SIZE_T bufsize,
+__rw_put_time (const __rw_facet *facet, wchar_t *wbuf, size_t bufsize,
                _STD::ios_base &flags, wchar_t fill, const tm *tmb,
                char fmt, char mod, int width, int prec)
 {
     _RWSTD_ASSERT (0 != facet);
 
-    _RWSTD_SIZE_T res = 0;   // size of formatted output, -1 on error
+    size_t res = 0;   // size of formatted output, -1 on error
 
     __rw_time_put_data tpd;
 
@@ -2792,8 +2796,8 @@
 
         if (tpd.altval >= 0 && tpd.altval < int (n)) {
 
-            const _RWSTD_SIZE_T altval =
-                _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, tpd.altval);
+            const size_t altval =
+                _RWSTD_STATIC_CAST (size_t, tpd.altval);
 
             // format using alternative numeric symbols
             const wchar_t* digit =
@@ -2835,9 +2839,9 @@
 
         char buf [64];
 
-        res = (_RWSTD_SIZE_T)::sprintf (buf, fmtstr,
-                                        width < 0 ? tpd.width : width,
-                                        prec < 0 ? tpd.prec : prec, tpd.val);
+        res = size_t (sprintf (buf, fmtstr,
+                               width < 0 ? tpd.width : width,
+                               prec < 0 ? tpd.prec : prec, tpd.val));
 
         _RWSTD_ASSERT (res < sizeof buf);
 
@@ -2910,7 +2914,7 @@
 
             if (res <= sizeof buf) {
                 // widen narrow (not multibyte) result into wide buffer
-                for (_RWSTD_SIZE_T i = 0; i != res; ++i)
+                for (size_t i = 0; i != res; ++i)
                     wbuf [i] = _RWSTD_STATIC_CAST (unsigned char, buf [i]);
             }
 

Modified: stdcxx/branches/4.3.x/src/tmpbuf.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/tmpbuf.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/tmpbuf.cpp (original)
+++ stdcxx/branches/4.3.x/src/tmpbuf.cpp Tue May 26 19:33:39 2009
@@ -31,6 +31,9 @@
 #include "podarray.h"        // for __rw_aligned_buffer
 #include <rw/_allocator.h>   // for __rw_allocate(), ...
 #include <rw/_mutex.h>       // for _RWSTD_THREAD_XXX()
+
+#include <stddef.h>          // for size_t
+
 #include <rw/_defs.h>
 
 
@@ -53,18 +56,18 @@
 
 
 // used by std::get_temporary_buffer<>()
-_RWSTD_EXPORT _RWSTD_SIZE_T
-__rw_tmpbuf (void **pptr, _RWSTD_PTRDIFF_T nelems, _RWSTD_SIZE_T size)
+_RWSTD_EXPORT size_t
+__rw_tmpbuf (void **pptr, _RWSTD_PTRDIFF_T nelems, size_t size)
 {
     _RWSTD_ASSERT (0 != pptr);
     _RWSTD_ASSERT (0 != size);
 
     // detect overflow and fail
-    _RWSTD_SIZE_T nbytes = nelems * size;
+    size_t nbytes = nelems * size;
 
     if (   nelems < 0
-        || nbytes / size != _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, nelems)
-        || nelems && nbytes / nelems != size) {
+        || nbytes / size != _RWSTD_STATIC_CAST (size_t, nelems)
+        || (nelems && nbytes / nelems != size)) {
         *pptr = 0;
         return 0;
     }

Modified: stdcxx/branches/4.3.x/src/valarray.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/valarray.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/valarray.cpp (original)
+++ stdcxx/branches/4.3.x/src/valarray.cpp Tue May 26 19:33:39 2009
@@ -22,14 +22,14 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
 #define _RWSTD_LIB_SRC
 
 #include <valarray>
-#include <string.h>   // for memset()
+#include <string.h>   // for memset(), size_t
 
 #include <rw/_defs.h>
 
@@ -37,9 +37,9 @@
 _RWSTD_NAMESPACE (std) { 
 
 
-_RWSTD_SIZE_T gslice::next_ind ()
+size_t gslice::next_ind ()
 {
-    _RWSTD_SIZE_T __n = _C_length.size ();
+    size_t __n = _C_length.size ();
 
     for (/**/; __n; --__n)
     {
@@ -69,8 +69,8 @@
     else
         __n = _C_r_length.size ();
 
-    _RWSTD_SIZE_T __inx = _C_start;
-    for (_RWSTD_SIZE_T __i = 0; __i != __n; ++__i)
+    size_t __inx = _C_start;
+    for (size_t __i = 0; __i != __n; ++__i)
         __inx += _C_r_length [__i] * _C_stride [__i];
 
     return __inx;

Modified: stdcxx/branches/4.3.x/src/wcodecvt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/wcodecvt.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/wcodecvt.cpp (original)
+++ stdcxx/branches/4.3.x/src/wcodecvt.cpp Tue May 26 19:33:39 2009
@@ -431,8 +431,8 @@
     _RWSTD_ASSERT (to <= to_limit);
 
     // verify that both ranges are valid
-    _RWSTD_ASSERT (from && from_end || !from && !from_end);
-    _RWSTD_ASSERT (to && to_limit || !to && !to_limit);
+    _RWSTD_ASSERT (!from == !from_end);
+    _RWSTD_ASSERT (!to == !to_limit);
 
     // set the (possibly uninitialized) next pointers
     // to point to the beginning of each sequence
@@ -769,8 +769,8 @@
             // 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 (0xffffU)) {
+            if (   (WIntT (0xd800U) <= wi && wi <= WIntT (0xdfffU))
+                || (WIntT (0xfffeU) <= wi && wi <= WIntT (0xffffU))) {
                 res = _STD::codecvt_base::error;
                 break;
             }
@@ -1025,7 +1025,7 @@
 
 
 /* explicit */ codecvt<wchar_t, char, _RWSTD_MBSTATE_T>::
-codecvt (size_t __ref /* = 0 */)
+codecvt (size_t __ref /* = 0 */) _THROWS (())
     : _RW::__rw_facet (__ref)
 {
     // no-op
@@ -1035,7 +1035,7 @@
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ codecvt<wchar_t, char, _RWSTD_MBSTATE_T>::
-~codecvt ()
+~codecvt ()   // nothrow
 {
     // no-op
 }
@@ -1081,8 +1081,8 @@
     _RWSTD_ASSERT (to   <= to_end);
 
     // verify that both ranges are valid
-    _RWSTD_ASSERT (from && from_end || !from && !from_end);
-    _RWSTD_ASSERT (to && to_end || !to && !to_end);
+    _RWSTD_ASSERT (!from == !from_end);
+    _RWSTD_ASSERT (!to == !to_end);
 
     // next pointers must always be set before returning, even on error
     from_next = from;
@@ -1128,8 +1128,8 @@
     _RWSTD_ASSERT (to   <= to_end);
 
     // verify that both ranges are valid
-    _RWSTD_ASSERT (from && from_end || !from && !from_end);
-    _RWSTD_ASSERT (to && to_end || !to && !to_end);
+    _RWSTD_ASSERT (!from == !from_end);
+    _RWSTD_ASSERT (!to == !to_end);
 
     // next pointers must always be set before returning, even on error
     from_next = from;
@@ -1161,7 +1161,7 @@
 {
     // verify that the range is valid
     _RWSTD_ASSERT (to <= to_end);
-    _RWSTD_ASSERT (to && to_end || !to && !to_end);
+    _RWSTD_ASSERT (!to == !to_end);
 
     _RWSTD_UNUSED (to_end);
 
@@ -1189,7 +1189,7 @@
     _RWSTD_ASSERT (from <= from_end);
 
     // verify that the range is valid
-    _RWSTD_ASSERT (from && from_end || !from && !from_end);
+    _RWSTD_ASSERT (!from == !from_end);
 
     const int mbstate_valid = _RW::__rw_mbsinit (&state);
 
@@ -1316,8 +1316,8 @@
 
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
-/* virtual */ codecvt_byname<wchar_t, char, _RWSTD_MBSTATE_T>::~
-codecvt_byname ()
+/* virtual */ codecvt_byname<wchar_t, char, _RWSTD_MBSTATE_T>::
+~codecvt_byname ()   // nothrow
 {
     // no-op
 }
@@ -1338,8 +1338,8 @@
     _RWSTD_ASSERT (to <= to_limit);
 
     // verify that both ranges are valid
-    _RWSTD_ASSERT (from && from_end || !from && !from_end);
-    _RWSTD_ASSERT (to && to_limit || !to && !to_limit);
+    _RWSTD_ASSERT (!from == !from_end);
+    _RWSTD_ASSERT (!to == !to_limit);
 
     // the standard does not specify the value of
     // *next pointers at entry;
@@ -1428,8 +1428,8 @@
     _RWSTD_ASSERT (to <= to_limit);
 
     // verify that both ranges are valid
-    _RWSTD_ASSERT (from && from_end || !from && !from_end);
-    _RWSTD_ASSERT (to && to_limit || !to && !to_limit);
+    _RWSTD_ASSERT (!from == !from_end);
+    _RWSTD_ASSERT (!to == !to_limit);
 
     // the standard does not specify the value of the next pointers on entry
     from_next = from;
@@ -1507,7 +1507,7 @@
 {
     // verify that the range is valid
     _RWSTD_ASSERT (to <= to_limit);
-    _RWSTD_ASSERT (to && to_limit || !to && !to_limit);
+    _RWSTD_ASSERT (!to == !to_limit);
 
     // the standard does not specify the value of
     // to_next pointer at entry;
@@ -1573,7 +1573,7 @@
     _RWSTD_ASSERT (from <= from_end);
 
     // verify that the range is valid
-    _RWSTD_ASSERT (from && from_end || !from && !from_end);
+    _RWSTD_ASSERT (!from == !from_end);
 
     size_t len = 0;
 

Modified: stdcxx/branches/4.3.x/src/wctype.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/wctype.cpp?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/wctype.cpp (original)
+++ stdcxx/branches/4.3.x/src/wctype.cpp Tue May 26 19:33:39 2009
@@ -22,7 +22,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 2001-2005 Rogue Wave Software.
+ * Copyright 2001-2005 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -86,15 +86,15 @@
         for (; beg != end; ++beg) {
 
             // using binary search look up the character and its mask
-            _RWSTD_SIZE_T low  = 0;
-            _RWSTD_SIZE_T high = (_RWSTD_SIZE_T)impl->wmask_s;
+            size_t low  = 0;
+            size_t high = size_t (impl->wmask_s);
 
             if (vec)
                 *vec = MaskT ();
 
             while (low <= high) {
 
-                const _RWSTD_SIZE_T cur = (low + high) / 2;
+                const size_t cur = (low + high) / 2;
                 const __rw_mask_elm next_elm = impl->wmask_tab (cur);
 
                 if (next_elm.ch == *beg) {
@@ -107,8 +107,8 @@
                     // to the current character; otherwise continue
                     if (vec)
                         *vec = MaskT (next_elm.mask & mask);
-                    else if (    scan_is && next_elm.mask & mask
-                             || !scan_is && !(next_elm.mask & mask))
+                    else if (    (scan_is && next_elm.mask & mask)
+                             || (!scan_is && !(next_elm.mask & mask)))
                         return beg;
 
                     break;
@@ -138,7 +138,7 @@
 
         // does the value of *beg fit into the range of an unsigned char?
         const bool fits_char =
-            _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, *beg) <= _RWSTD_UCHAR_MAX;
+            _RWSTD_STATIC_CAST (size_t, *beg) <= _RWSTD_UCHAR_MAX;
 
         // `fits_char' is not used if all wide character
         // classification functions use below are present
@@ -236,7 +236,7 @@
 
         if (vec)
             *vec++ = MaskT (m);
-        else if (scan_is && m & mask || !scan_is && !(m & mask))
+        else if ((scan_is && m & mask) || (!scan_is && !(m & mask)))
             break;
     }
 
@@ -251,9 +251,9 @@
 {
     if (use_libstd && impl != 0) {
 
-        _RWSTD_SIZE_T low  = 0;
-        _RWSTD_SIZE_T high = (_RWSTD_SIZE_T)impl->wtoupper_s();
-        _RWSTD_SIZE_T cur;
+        size_t low  = 0;
+        size_t high = size_t (impl->wtoupper_s ());
+        size_t cur;
 
         __rw_upper_elm next_elm;
 
@@ -284,7 +284,7 @@
 
 #else   // if defined (_RWSTD_NO_TOWUPPER)
 
-        if (_RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) <= _RWSTD_UCHAR_MAX) {
+        if (_RWSTD_STATIC_CAST (size_t, c) <= _RWSTD_UCHAR_MAX) {
 
             const __rw_setlocale clocale (locname, LC_CTYPE);
 
@@ -306,9 +306,9 @@
 {
     if (use_libstd && impl != 0) {
 
-        _RWSTD_SIZE_T low  = 0;
-        _RWSTD_SIZE_T high = (_RWSTD_SIZE_T)impl->wtolower_s ();
-        _RWSTD_SIZE_T cur;
+        size_t low  = 0;
+        size_t high = size_t (impl->wtolower_s ());
+        size_t cur;
 
         __rw_lower_elm next_elm;
 
@@ -339,7 +339,7 @@
 
 #else   // if defined (_RWSTD_NO_TOWLOWER)
 
-        if (_RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) <= _RWSTD_UCHAR_MAX) {
+        if (_RWSTD_STATIC_CAST (size_t, c) <= _RWSTD_UCHAR_MAX) {
 
             const __rw_setlocale clocale (locname, LC_CTYPE);
 
@@ -421,7 +421,7 @@
 _RW::__rw_facet_id ctype<wchar_t>::id;
 
 
-ctype<wchar_t>::ctype (_RWSTD_SIZE_T ref)
+ctype<wchar_t>::ctype (size_t ref) _THROWS (())
     : _RW::__rw_facet (ref)
 {
 #ifndef _RWSTD_NO_EQUAL_CTYPE_MASK
@@ -459,7 +459,7 @@
 bool ctype<wchar_t>::
 do_is (mask m, char_type c) const
 {
-    return    _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) <= _C_tab_size
+    return    _RWSTD_STATIC_CAST (size_t, c) <= _C_tab_size
            && (_C_mask_tab [_UChar (c)] & m);
 }
 
@@ -471,7 +471,7 @@
     _RWSTD_ASSERT (lo <= hi);
 
     for ( ; lo != hi; ++lo, ++mvec) {
-        *mvec = _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, *lo) < _C_tab_size ?
+        *mvec = _RWSTD_STATIC_CAST (size_t, *lo) < _C_tab_size ?
             _C_mask_tab [_UChar (*lo)] : mask (0);
     }
 
@@ -509,7 +509,7 @@
 ctype<wchar_t>::
 do_toupper (char_type c) const
 {
-    return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) < _C_tab_size ?
+    return _RWSTD_STATIC_CAST (size_t, c) < _C_tab_size ?
         _C_upper_tab [_UChar (c)] : c;
 }
 
@@ -518,7 +518,7 @@
 ctype<wchar_t>::
 do_tolower (char_type c) const
 {
-    return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) < _C_tab_size ?
+    return _RWSTD_STATIC_CAST (size_t, c) < _C_tab_size ?
         _C_lower_tab [_UChar (c)] : c;
 }
 
@@ -530,7 +530,7 @@
     _RWSTD_ASSERT (lo <= hi);
 
     for ( ; lo < hi; ++lo)
-        *lo = _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, *lo) < _C_tab_size ?
+        *lo = _RWSTD_STATIC_CAST (size_t, *lo) < _C_tab_size ?
             _C_upper_tab [_UChar (*lo)] : 0;
 
     return lo;
@@ -544,7 +544,7 @@
     _RWSTD_ASSERT (lo <= hi);
 
     for ( ; lo < hi; ++lo)
-        *lo = _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, *lo) < _C_tab_size ?
+        *lo = _RWSTD_STATIC_CAST (size_t, *lo) < _C_tab_size ?
             _C_lower_tab [_UChar (*lo)] : 0;
 
     return lo;
@@ -558,7 +558,7 @@
     _RWSTD_ASSERT (lo <= hi);
 
     for ( ; lo != hi; ++lo) {
-        if (   _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, *lo) <= _C_tab_size
+        if (   _RWSTD_STATIC_CAST (size_t, *lo) <= _C_tab_size
             && (_C_mask_tab [_UChar (*lo)] & m))
             break;
     }
@@ -573,7 +573,7 @@
 {
     _RWSTD_ASSERT (lo <= hi);
     for ( ; lo != hi; ++lo) {
-        if (   _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, *lo) >= _C_tab_size
+        if (   _RWSTD_STATIC_CAST (size_t, *lo) >= _C_tab_size
             || !(_C_mask_tab [_UChar (*lo)] & m))
             break;
     }
@@ -586,7 +586,7 @@
 ctype<wchar_t>::
 do_narrow (char_type c, char dfault) const
 {
-    return _RWSTD_STATIC_CAST (_RWSTD_SIZE_T, c) <= _RWSTD_SCHAR_MAX ?
+    return _RWSTD_STATIC_CAST (size_t, c) <= _RWSTD_SCHAR_MAX ?
         _RWSTD_STATIC_CAST (char, c) : dfault;
 }
 
@@ -605,7 +605,7 @@
 
 
 ctype_byname<wchar_t>::
-ctype_byname (const char *name, _RWSTD_SIZE_T refs)
+ctype_byname (const char *name, size_t refs)
     : ctype<wchar_t> (refs), _C_cvtimpl (0), _C_cvtsize (0)
 {
     this->_C_set_name (name, _C_namebuf, sizeof _C_namebuf);
@@ -637,12 +637,12 @@
 
         // casts prevent bogus gcc 2.95.2 warning:
         //     size in array new must have integral type
-        _C_mask_tab = new mask [(_RWSTD_SIZE_T)_C_tab_size];
+        _C_mask_tab = new mask [size_t (_C_tab_size)];
 
         _TRY {
             // avoid doing one extra allocation by allocating
             // both the upper and lower tables in the same space
-            _C_upper_tab = new _UChar [(_RWSTD_SIZE_T)_C_tab_size * 2];
+            _C_upper_tab = new _UChar [size_t (_C_tab_size) * 2];
             _C_lower_tab = _C_upper_tab + _C_tab_size;
         }
         _CATCH (...) {
@@ -726,25 +726,23 @@
 
             _RWSTD_CONST_CAST (mask*, _C_mask_tab) [i]  = mask (m);
 
-            typedef _RWSTD_SIZE_T SizeT;
-
 #ifndef _RWSTD_NO_TOWUPPER
-            const SizeT upr = SizeT ((::towupper)(i));
+            const size_t upr = size_t ((::towupper)(i));
 #else   // if defined (_RWSTD_NO_TOWUPPER)
-            const SizeT upr = SizeT ((::toupper)(i));
+            const size_t upr = size_t ((::toupper)(i));
 #endif   // _RWSTD_NO_TOWUPPER
 
 #ifndef _RWSTD_NO_TOWLOWER
-            const SizeT lwr = SizeT ((::towlower)(i));
+            const size_t lwr = size_t ((::towlower)(i));
 #else   // if defined (_RWSTD_NO_TOWLOWER)
-            const SizeT lwr = SizeT ((::tolower)(i));
+            const size_t lwr = size_t ((::tolower)(i));
 #endif   // _RWSTD_NO_TOWLOWER
 
             // optimize (and avoid warnings) when wint_t is unsigned
-            _C_upper_tab [i] = upr <= SizeT (_RWSTD_UCHAR_MAX) ?
+            _C_upper_tab [i] = upr <= size_t (_RWSTD_UCHAR_MAX) ?
                 _UChar (upr) : _UChar (0);
 
-            _C_lower_tab [i] = lwr <= SizeT (_RWSTD_UCHAR_MAX) ?
+            _C_lower_tab [i] = lwr <= size_t (_RWSTD_UCHAR_MAX) ?
                 _UChar (lwr) : _UChar (0);
         }
     }
@@ -968,7 +966,7 @@
 
         char  tmp [_UTF8_MB_CUR_MAX + 1];
         char* ptmp = tmp;
-        _RWSTD_SIZE_T utf8_sz = _RW::__rw_itoutf8 (c, tmp);
+        size_t utf8_sz = _RW::__rw_itoutf8 (c, tmp);
 
 #if _RWSTD_WCHAR_MIN < 0
         // compute the invalid bit mask (the MSB set)
@@ -979,7 +977,7 @@
 
         typedef unsigned char UChar;
         
-        _RWSTD_SIZE_T i = 0;
+        size_t i = 0;
         wc = ptbl [UChar (*ptmp)];
         while (wc & imask) {
             // check validity of the value
@@ -1002,7 +1000,7 @@
         // to have length of one
         const char* impl_raw = 
             _RWSTD_REINTERPRET_CAST(const char*, cvt);
-        _RWSTD_SIZE_T offset = wc + sizeof (_RW::__rw_codecvt_t);
+        size_t offset = wc + sizeof (_RW::__rw_codecvt_t);
 
         if (impl_raw [offset + 1])
             return dfault;

Propchange: stdcxx/branches/4.3.x/src/x86/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 26 19:33:39 2009
@@ -1 +1 @@
-/stdcxx/branches/4.2.x/src/x86:697875,697883,700495,700810,700888,701135,702179,702195,702931,703124,703216
+/stdcxx/branches/4.2.x/src/x86:684133-684134,684138,686537,693942,697875,697883,700495,700810,700888,701135,702179,702195,702931,703124,703216,714208,723464,731135,731378,778780,778800,778803

Propchange: stdcxx/branches/4.3.x/src/x86_64/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 26 19:33:39 2009
@@ -1 +1 @@
-/stdcxx/branches/4.2.x/src/x86_64:697875,697883,700495,700810,700888,701135,702179,702195,702931,703124,703216
+/stdcxx/branches/4.2.x/src/x86_64:684133-684134,684138,686537,693942,697875,697883,700495,700810,700888,701135,702179,702195,702931,703124,703216,714208,723464,731135,731378,778780,778800,778803

Modified: stdcxx/branches/4.3.x/tests/include/rw_char.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/include/rw_char.h?rev=778855&r1=778854&r2=778855&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/include/rw_char.h (original)
+++ stdcxx/branches/4.3.x/tests/include/rw_char.h Tue May 26 19:33:39 2009
@@ -162,8 +162,8 @@
     }
 
     ~UserInt () {
-        RW_ASSERT (ptr_ == &i_);            // verify *this is valid
-        RW_ASSERT (-1 <= i_ == i_ < 257);   // i may be invalid
+        RW_ASSERT (ptr_ == &i_);                // verify *this is valid
+        RW_ASSERT ((-1 <= i_) == (i_ < 257));   // i may be invalid
 
         i_   = _RWSTD_INT_MIN;   // invalidate
         ptr_ = &ptr_;            // invalidate



Mime
View raw message