You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2008/11/15 02:26:05 UTC
svn commit: r714208 - in /stdcxx/branches/4.2.x: include/loc/ include/rw/
src/
Author: sebor
Date: Fri Nov 14 17:26:04 2008
New Revision: 714208
URL: http://svn.apache.org/viewvc?rev=714208&view=rev
Log:
2008-11-14 Martin Sebor <se...@apache.org>
STDCXX-791
* include/loc/_localedef.h (__rw_utf8toucs4): Parenthesized
subexpression to silence gcc 4.3 -Wparentheses warning: suggest
parentheses around arithmetic in operand of |.
* include/rw/_iosbase.h (ios_base::setf): Same.
* src/num_get.cpp (__rw_check_grouping): Added an empty/dummy
body to a while loop to silence the braindead gcc 4.3 -Wempty-body
warning: uggest a space before ';' or explicit braces around empty
body in 'while' statement.
Parenthesized subexpressions to silence gcc 4.3.0 -Wparentheses
warnings.
* src/iostore.cpp (ios_base::_C_copyfmt): Silenced gcc 4.3
-Wparentheses warning.
* src/tmpbuf.cpp:
* src/string.cpp (__rw_memcpy, __rw_memmove, __rw_memcmp, __rw_strlen):
Silenced gcc 4.3 -Wparentheses warning.
(__rw_wmemcpy, __rw_wmemmove, __rw_wmemcmp, __rw_wcslen): Same.
* src/codecvt.cpp (codecvt::do_out, codecvt::do_in, codecvt::do_unshift,
codecvt::do_length): Same.
* src/ios.cpp (ios_base::flags): Same.
* src/wcodecvt.cpp (__rw_libc_do_out, codecvt::do_out, codecvt::do_in,
codecvt::do_unshift, codecvt::do_length, codecvt_byname::do_out,
codecvt_byname::do_in, codecvt_byname::do_unshift,
codecvt_byname::do_length): Same.
* src/time_put.cpp (__rw_get_era, __rw_get_zone_off, __rw_get_zone,
__rw_get_time_put_data): Same.
* src/wctype.cpp (__rw_get_mask): Same.
* src/facet.cpp (__rw_facet::~__rw_facet, __rw_facet::_C_get_data):
Same.
* src/locale_body.cpp (__rw_locale::_C_is_managed): Same.
* src/locale_eq.cpp (locale::operator==): Same.
* src/strstream.cpp (strstreambuf::setbuf): Same.
* src/locale_combine.cpp (__rw_locale::_C_construct): Same.
* src/num_put.cpp (__rw_itoa): Silenced gcc 4.3 -Wempty-body warning.
Modified:
stdcxx/branches/4.2.x/include/loc/_localedef.h
stdcxx/branches/4.2.x/include/rw/_iosbase.h
stdcxx/branches/4.2.x/src/codecvt.cpp
stdcxx/branches/4.2.x/src/facet.cpp
stdcxx/branches/4.2.x/src/ios.cpp
stdcxx/branches/4.2.x/src/iostore.cpp
stdcxx/branches/4.2.x/src/locale_body.cpp
stdcxx/branches/4.2.x/src/locale_combine.cpp
stdcxx/branches/4.2.x/src/locale_eq.cpp
stdcxx/branches/4.2.x/src/num_get.cpp
stdcxx/branches/4.2.x/src/num_put.cpp
stdcxx/branches/4.2.x/src/string.cpp
stdcxx/branches/4.2.x/src/strstream.cpp
stdcxx/branches/4.2.x/src/time_put.cpp
stdcxx/branches/4.2.x/src/tmpbuf.cpp
stdcxx/branches/4.2.x/src/wcodecvt.cpp
stdcxx/branches/4.2.x/src/wctype.cpp
Modified: stdcxx/branches/4.2.x/include/loc/_localedef.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/loc/_localedef.h?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/loc/_localedef.h (original)
+++ stdcxx/branches/4.2.x/include/loc/_localedef.h Fri Nov 14 17:26:04 2008
@@ -774,7 +774,7 @@
if (len < 2)
return from;
- *ret = _Int32 ((byte [0] & 0x1fU) << 6 | byte [1] & 0x3fU);
+ *ret = _Int32 ((byte [0] & 0x1fU) << 6 | (byte [1] & 0x3fU));
return from + 2;
}
Modified: stdcxx/branches/4.2.x/include/rw/_iosbase.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_iosbase.h?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/rw/_iosbase.h (original)
+++ stdcxx/branches/4.2.x/include/rw/_iosbase.h Fri Nov 14 17:26:04 2008
@@ -239,7 +239,7 @@
// 27.4.2.2, p6
fmtflags setf (fmtflags __f, fmtflags __mask) {
- return flags (flags () & ~__mask | __f & __mask);
+ return flags ((flags () & ~__mask) | (__f & __mask));
}
// 27.4.2.2, p8
Modified: stdcxx/branches/4.2.x/src/codecvt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/codecvt.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/codecvt.cpp (original)
+++ stdcxx/branches/4.2.x/src/codecvt.cpp Fri Nov 14 17:26:04 2008
@@ -127,8 +127,8 @@
// verify that both ranges are valid
_RWSTD_ASSERT (from <= from_end);
_RWSTD_ASSERT (to <= to_end);
- _RWSTD_ASSERT (from && from_end || !from && !from_end);
- _RWSTD_ASSERT (to && to_end || !to && !to_end);
+ _RWSTD_ASSERT ((from && from_end) || (!from && !from_end));
+ _RWSTD_ASSERT ((to && to_end) || (!to && !to_end));
// next pointers must always be set before returning, even on error
from_next = from;
@@ -183,8 +183,8 @@
// verify that both ranges are valid
_RWSTD_ASSERT (from <= from_end);
_RWSTD_ASSERT (to <= to_end);
- _RWSTD_ASSERT (from && from_end || !from && !from_end);
- _RWSTD_ASSERT (to && to_end || !to && !to_end);
+ _RWSTD_ASSERT ((from && from_end) || (!from && !from_end));
+ _RWSTD_ASSERT ((to && to_end) || (!to && !to_end));
typedef codecvt<char, char, _RWSTD_MBSTATE_T> This;
@@ -204,7 +204,7 @@
{
// verify that the range is valid
_RWSTD_ASSERT (to <= to_end);
- _RWSTD_ASSERT (to && to_end || !to && !to_end);
+ _RWSTD_ASSERT ((to && to_end) || (!to && !to_end));
_RWSTD_UNUSED (to_end);
@@ -246,7 +246,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) || (!from && !from_end));
const int mbstate_valid = _RW::__rw_mbsinit (&state);
_RWSTD_ASSERT (mbstate_valid);
Modified: stdcxx/branches/4.2.x/src/facet.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/facet.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/facet.cpp (original)
+++ stdcxx/branches/4.2.x/src/facet.cpp Fri Nov 14 17:26:04 2008
@@ -113,7 +113,7 @@
__rw_facet::~__rw_facet () // nothrow
{
- _RWSTD_ASSERT (!_C_name && !_C_buf || _C_name && _C_buf);
+ _RWSTD_ASSERT ((!_C_name && !_C_buf) || (_C_name && _C_buf));
static const char destroyed[] = "*** destroyed facet ***";
@@ -218,8 +218,8 @@
pdata = __rw_get_facet_data (cat, sz, strip_name.data ());
}
else if ( pstr && pstr [4] == '-' && !pstr [6]
- && ( '4' == pstr [5] && sizeof (wchar_t) == 4
- || '2' == pstr [5] && sizeof (wchar_t) == 2)) {
+ && ( ('4' == pstr [5] && sizeof (wchar_t) == 4)
+ || ('2' == pstr [5] && sizeof (wchar_t) == 2))) {
// @UCS-4 is only recognized where sizeof (wchar_t) == 4
// @UCS-2 is only recognized where sizeof (wchar_t) == 2
@@ -249,7 +249,7 @@
return 0;
}
- if (!is_wcodecvt_byname || pstr && pdata) {
+ if (!is_wcodecvt_byname || (pstr && pdata)) {
_C_impdata = pdata;
_C_impsize = sz;
return _C_impdata;
Modified: stdcxx/branches/4.2.x/src/ios.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/ios.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/ios.cpp (original)
+++ stdcxx/branches/4.2.x/src/ios.cpp Fri Nov 14 17:26:04 2008
@@ -104,19 +104,19 @@
// if basefield is set, clear the base mask and set
// the numeric base bits according to the basefield
case oct:
- ifl = ifl & mask | 8U << _RWSTD_IOS_BASEOFF;
+ ifl = (ifl & mask) | 8U << _RWSTD_IOS_BASEOFF;
break;
case dec:
- ifl = ifl & mask | 10U << _RWSTD_IOS_BASEOFF;
+ ifl = (ifl & mask) | 10U << _RWSTD_IOS_BASEOFF;
break;
case hex:
- ifl = ifl & mask | 16U << _RWSTD_IOS_BASEOFF;
+ ifl = (ifl & mask) | 16U << _RWSTD_IOS_BASEOFF;
break;
case _RWSTD_IOS_BIN:
- ifl = ifl & mask | 2U << _RWSTD_IOS_BASEOFF;
+ ifl = (ifl & mask) | 2U << _RWSTD_IOS_BASEOFF;
break;
case 0:
Modified: stdcxx/branches/4.2.x/src/iostore.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/iostore.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/iostore.cpp (original)
+++ stdcxx/branches/4.2.x/src/iostore.cpp Fri Nov 14 17:26:04 2008
@@ -331,7 +331,7 @@
}
// copy all but masked flags(), leave masked flags alone
- _C_fmtfl = fmtfl & flagmask | _C_fmtfl & ~flagmask;
+ _C_fmtfl = (fmtfl & flagmask) | (_C_fmtfl & ~flagmask);
_C_prec = prec;
_C_wide = wide;
_C_loc = loc;
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=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/locale_body.cpp (original)
+++ stdcxx/branches/4.2.x/src/locale_body.cpp Fri Nov 14 17:26:04 2008
@@ -1096,18 +1096,18 @@
// detect categores of all byname facets not all of which
// belong to the same named locale)
if ( (_C_std_facet_bits & _C_all) != _C_all
- || (_C_byname_facet_bits & _C_collate)
- && (_C_byname_facet_bits & _C_collate) != _C_collate
- || (_C_byname_facet_bits & _C_ctype)
- && (_C_byname_facet_bits & _C_ctype) != _C_ctype
- || (_C_byname_facet_bits & _C_monetary)
- && (_C_byname_facet_bits & _C_monetary) != _C_monetary
- || (_C_byname_facet_bits & _C_numeric)
- && (_C_byname_facet_bits & _C_numeric) != _C_numeric
- || (_C_byname_facet_bits & _C_time)
- && (_C_byname_facet_bits & _C_time) != _C_time
- || (_C_byname_facet_bits & _C_messages)
- && (_C_byname_facet_bits & _C_messages) != _C_messages)
+ || ( (_C_byname_facet_bits & _C_collate)
+ && (_C_byname_facet_bits & _C_collate) != _C_collate)
+ || ( (_C_byname_facet_bits & _C_ctype)
+ && (_C_byname_facet_bits & _C_ctype) != _C_ctype)
+ || ( (_C_byname_facet_bits & _C_monetary)
+ && (_C_byname_facet_bits & _C_monetary) != _C_monetary)
+ || ( (_C_byname_facet_bits & _C_numeric)
+ && (_C_byname_facet_bits & _C_numeric) != _C_numeric)
+ || ( (_C_byname_facet_bits & _C_time)
+ && (_C_byname_facet_bits & _C_time) != _C_time)
+ || ( (_C_byname_facet_bits & _C_messages)
+ && (_C_byname_facet_bits & _C_messages) != _C_messages))
return false;
// check whether all _byname facets in each category belong
Modified: stdcxx/branches/4.2.x/src/locale_combine.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/locale_combine.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/locale_combine.cpp (original)
+++ stdcxx/branches/4.2.x/src/locale_combine.cpp Fri Nov 14 17:26:04 2008
@@ -235,11 +235,11 @@
// compute and assign facet bitmaps
const int bits = _C_LC2facet_bits (cat);
- _C_std_facet_bits = one._C_std_facet_bits & ~bits
- | other._C_std_facet_bits & bits;
+ _C_std_facet_bits = (one._C_std_facet_bits & ~bits)
+ | (other._C_std_facet_bits & bits);
- _C_byname_facet_bits = one._C_byname_facet_bits & ~bits
- | other._C_byname_facet_bits & bits;
+ _C_byname_facet_bits = (one._C_byname_facet_bits & ~bits)
+ | (other._C_byname_facet_bits & bits);
for (size_t i = 0; i != _C_n_std_facets; ++i) {
Modified: stdcxx/branches/4.2.x/src/locale_eq.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/locale_eq.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/locale_eq.cpp (original)
+++ stdcxx/branches/4.2.x/src/locale_eq.cpp Fri Nov 14 17:26:04 2008
@@ -84,10 +84,10 @@
// share the exact same facets (otherwise the bits may or may not
// be the same)
_RWSTD_ASSERT ( !eql
- || _C_body->_C_std_facet_bits
- == rhs._C_body->_C_std_facet_bits
- && _C_body->_C_byname_facet_bits
- == rhs._C_body->_C_byname_facet_bits);
+ || ( _C_body->_C_std_facet_bits
+ == rhs._C_body->_C_std_facet_bits
+ && _C_body->_C_byname_facet_bits
+ == rhs._C_body->_C_byname_facet_bits));
// the names of both objects must be the same if the two objects
// share the exact same facets (otherwise the names may or may not
Modified: stdcxx/branches/4.2.x/src/num_get.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/num_get.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/num_get.cpp (original)
+++ stdcxx/branches/4.2.x/src/num_get.cpp Fri Nov 14 17:26:04 2008
@@ -147,7 +147,8 @@
_RWSTD_SIZE_T grpn = ngrpings;
// find the last non-zero grouping if it exists (see below)
- while (grpn-- != ngrpings && !grping [grpn]);
+ while (grpn-- != ngrpings && !grping [grpn])
+ /* silence gcc -Wempty-body warning */;
// the index of the last meaningful grouping (e.g., `grphi' of
// "\3\0\0\0" is 2 since the redundant NULs can be safely ignored)
@@ -545,7 +546,7 @@
_RWSTD_ASSERT (0 != end);
- if ('.' == *end || end == buf && '.' == buf [1]) {
+ if ('.' == *end || (end == buf && '.' == buf [1])) {
// on failure caused by an unrecognized decimal point
// set teporarily the global locale to "C" and reparse
__rw_setlocale loc ("C", _RWSTD_LC_NUMERIC);
@@ -649,7 +650,7 @@
_RWSTD_ASSERT (0 != end);
- if ('.' == *end || end == buf && '.' == buf [1]) {
+ if ('.' == *end || (end == buf && '.' == buf [1])) {
// on failure caused by an unrecognized decimal point
// set teporarily the global locale to "C" and reparse
__rw_setlocale loc ("C", _RWSTD_LC_NUMERIC);
@@ -728,7 +729,7 @@
_RWSTD_ASSERT (0 != end);
- if ('.' == *end || end == buf && '.' == buf [1]) {
+ if ('.' == *end || (end == buf && '.' == buf [1])) {
// on failure caused by an unrecognized decimal point
// set teporarily the global locale to "C" and reparse
__rw_setlocale loc ("C", _RWSTD_LC_NUMERIC);
@@ -794,9 +795,9 @@
// note that grouping is optional and parsing fails due to bad format
// only if the positions thousands_sep's do not match those specified
// by grouping; in such cases, the value is still stored
- if ( *grouping && ngroups > 1
- && 0 > __rw_check_grouping (groups, ngroups, grouping, ngroupings)
- || !*grouping && ngroups > 1)
+ if ( ( *grouping && ngroups > 1
+ && 0 > __rw_check_grouping (groups, ngroups, grouping, ngroupings))
+ || (!*grouping && ngroups > 1))
err |= _RWSTD_IOS_FAILBIT;
return err;
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=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/num_put.cpp (original)
+++ stdcxx/branches/4.2.x/src/num_put.cpp Fri Nov 14 17:26:04 2008
@@ -253,7 +253,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;
@@ -457,7 +459,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;
Modified: stdcxx/branches/4.2.x/src/string.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/string.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/string.cpp (original)
+++ stdcxx/branches/4.2.x/src/string.cpp Fri Nov 14 17:26:04 2008
@@ -36,7 +36,7 @@
_RWSTD_EXPORT void*
__rw_memcpy (void *dst, const void *src, size_t nbytes)
{
- _RWSTD_ASSERT (0 == nbytes || dst && src);
+ _RWSTD_ASSERT (0 == nbytes || (dst && src));
const char* csrc = _RWSTD_STATIC_CAST (const char*, src);
@@ -50,7 +50,7 @@
_RWSTD_EXPORT void*
__rw_memmove (void *dst, const void *src, 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);
@@ -101,7 +101,7 @@
_RWSTD_EXPORT int
__rw_memcmp (const void *s1, const void *s2, size_t nbytes)
{
- _RWSTD_ASSERT (0 == nbytes || s1 && s2);
+ _RWSTD_ASSERT (0 == nbytes || (s1 && s2));
typedef unsigned char UChar;
@@ -110,7 +110,8 @@
int result = 0;
- for ( ; nbytes && !(result = *cs1 - *cs2); ++cs1, ++cs2, --nbytes);
+ for ( ; nbytes && !(result = *cs1 - *cs2); ++cs1, ++cs2, --nbytes)
+ /* no-op */;
return result;
}
@@ -121,7 +122,8 @@
{
const char* const begin = str;
- for (; *str; ++str);
+ while (*str)
+ ++str;
return _RWSTD_STATIC_CAST (size_t, str - begin);
}
@@ -132,7 +134,7 @@
_RWSTD_EXPORT wchar_t*
__rw_wmemcpy (wchar_t *dst, const wchar_t *src, size_t nwchars)
{
- _RWSTD_ASSERT (0 == nwchars || dst && src);
+ _RWSTD_ASSERT (0 == nwchars || (dst && src));
for (wchar_t *tmp = dst; nwchars; --nwchars)
*tmp++ = *src++;
@@ -144,7 +146,7 @@
_RWSTD_EXPORT wchar_t*
__rw_wmemmove (wchar_t *dst, const wchar_t *src, size_t nwchars)
{
- _RWSTD_ASSERT (0 == nwchars || dst && src);
+ _RWSTD_ASSERT (0 == nwchars || (dst && src));
if (dst < src) {
while (nwchars--)
@@ -188,11 +190,12 @@
_RWSTD_EXPORT int
__rw_wmemcmp (const wchar_t *s1, const wchar_t *s2, 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;
}
@@ -205,7 +208,8 @@
const wchar_t* const begin = wstr;
- for (; *wstr; ++wstr);
+ while (*wstr)
+ ++wstr;
return _RWSTD_STATIC_CAST (size_t, wstr - begin);
}
Modified: stdcxx/branches/4.2.x/src/strstream.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/strstream.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/strstream.cpp (original)
+++ stdcxx/branches/4.2.x/src/strstream.cpp Fri Nov 14 17:26:04 2008
@@ -246,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;
}
Modified: stdcxx/branches/4.2.x/src/time_put.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/time_put.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/time_put.cpp (original)
+++ stdcxx/branches/4.2.x/src/time_put.cpp Fri Nov 14 17:26:04 2008
@@ -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;
Modified: stdcxx/branches/4.2.x/src/tmpbuf.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/tmpbuf.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/tmpbuf.cpp (original)
+++ stdcxx/branches/4.2.x/src/tmpbuf.cpp Fri Nov 14 17:26:04 2008
@@ -67,7 +67,7 @@
if ( nelems < 0
|| nbytes / size != _RWSTD_STATIC_CAST (size_t, nelems)
- || nelems && nbytes / nelems != size) {
+ || (nelems && nbytes / nelems != size)) {
*pptr = 0;
return 0;
}
Modified: stdcxx/branches/4.2.x/src/wcodecvt.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/wcodecvt.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/wcodecvt.cpp (original)
+++ stdcxx/branches/4.2.x/src/wcodecvt.cpp Fri Nov 14 17:26:04 2008
@@ -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;
}
@@ -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);
@@ -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.2.x/src/wctype.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/wctype.cpp?rev=714208&r1=714207&r2=714208&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/wctype.cpp (original)
+++ stdcxx/branches/4.2.x/src/wctype.cpp Fri Nov 14 17:26:04 2008
@@ -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;
@@ -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;
}