Author: sebor Date: Sun Sep 13 22:22:32 2009 New Revision: 814400 URL: http://svn.apache.org/viewvc?rev=814400&view=rev Log: 2009-09-13 Martin Sebor <se...@apache.org>
STDCXX-791 * include/deque.cc (deque::_C_push): Parenthesized logic expression to silence gcc -Wparentheses warning. * include/list.cc (list::splice): Same. * 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>>=): Same. * tests/iostream/27.filebuf.cpp (CodeCvt::do_in): Same. * tests/numerics/26.c.math.cp (test_behavior): Same. * tests/src/locale.cpp (rw_get_wchars): Same. * (UserTraits::lt, UserTraits::compare, UserTraits::copy, UserTraits::move): Same. * tests/src/cmdopt.cpp (_rw_print_help, _rw_getbounds, rw_runopts): Same. * tests/src/23.containers.cpp (_rw_sigcat): Same. * tests/src/opt_lines.cpp (_rw_enable_line): Same. * tests/src/printf.cpp (_rw_fmtstrarray, _rw_vasnprintf_ext, _rw_fmtstr): Same. * tests/src/opt_trace.cpp (_rw_setopt_trace_mask): Same. * tests/localization/22.locale.num.put.cpp (do_test): Same. * tests/localization/22.locale.messages.cpp (open_catalog): Same. * tests/localization/22.locale.numpunct.cpp (check_numpunct): Same. * tests/localization/22.locale.time.get.cpp (do_test): Same. * tests/localization/22.locale.money.get.cpp (do_test): Same. * tests/localization/22.locale.num.get.cpp (do_test): Same. * tests/self/0.fnmatch.cpp (test): Same. * tests/strings/21.string.compare.cpp (test_compare): Same. * tests/strings/21.string.io.cpp (test_io): Same. * tests/containers/23.vector.cons.cpp (test_ctors): Same. * tests/algorithms/25.equal.cpp (test_equal): Same. * tests/algorithms/25.transform.cpp (gen_test): Same. * tests/algorithms/25.replace.cpp (test_replace): Same. * util/collate.cpp (Def::process_order_stmt): Same. * examples/tutorial/icecream.cpp (irand): Same. * tests/support/18.numeric.special.float.cpp (VERIFY_FUNCTION): Same. * tests/iostream/27.filebuf.codecvt.cpp (cformat::do_in): Same. (run_test): Changed the type of a local to silence gcc's -Wsign-compare warnings. * include/rw/_ioiter.h (istreambuf_iterator::equal): Simplified expression to silence gcc -Wparentheses warning and to help gcc generate more optimal code (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38126). * tests/iostream/27.istream.sentry.cpp (test_ok): Same. Modified: stdcxx/branches/4.2.x/examples/tutorial/icecream.cpp stdcxx/branches/4.2.x/include/deque.cc stdcxx/branches/4.2.x/include/list.cc stdcxx/branches/4.2.x/include/rw/_ioiter.h stdcxx/branches/4.2.x/tests/algorithms/25.equal.cpp stdcxx/branches/4.2.x/tests/algorithms/25.replace.cpp stdcxx/branches/4.2.x/tests/algorithms/25.transform.cpp stdcxx/branches/4.2.x/tests/containers/23.vector.cons.cpp stdcxx/branches/4.2.x/tests/iostream/27.filebuf.codecvt.cpp stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp stdcxx/branches/4.2.x/tests/iostream/27.istream.sentry.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.messages.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.num.get.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.cpp stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.cpp stdcxx/branches/4.2.x/tests/numerics/26.c.math.cpp stdcxx/branches/4.2.x/tests/self/0.fnmatch.cpp stdcxx/branches/4.2.x/tests/src/23.containers.cpp stdcxx/branches/4.2.x/tests/src/cmdopt.cpp stdcxx/branches/4.2.x/tests/src/locale.cpp stdcxx/branches/4.2.x/tests/src/opt_lines.cpp stdcxx/branches/4.2.x/tests/src/opt_trace.cpp stdcxx/branches/4.2.x/tests/src/printf.cpp stdcxx/branches/4.2.x/tests/strings/21.string.compare.cpp stdcxx/branches/4.2.x/tests/strings/21.string.io.cpp stdcxx/branches/4.2.x/tests/support/18.numeric.special.float.cpp stdcxx/branches/4.2.x/util/collate.cpp Modified: stdcxx/branches/4.2.x/examples/tutorial/icecream.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/examples/tutorial/icecream.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/examples/tutorial/icecream.cpp (original) +++ stdcxx/branches/4.2.x/examples/tutorial/icecream.cpp Sun Sep 13 22:22:32 2009 @@ -141,7 +141,8 @@ std::random_shuffle (seq, seq + sizeof seq / sizeof *seq); - const int rnd = (seq [0] << 11) | (seq [1] << 8) | (seq [2] << 4) + seq [3]; + const int rnd = + ((seq [0] << 11) | (seq [1] << 8) | (seq [2] << 4)) + seq [3]; return rnd % n; } Modified: stdcxx/branches/4.2.x/include/deque.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/deque.cc?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/include/deque.cc (original) +++ stdcxx/branches/4.2.x/include/deque.cc Sun Sep 13 22:22:32 2009 @@ -233,8 +233,8 @@ const bool __empty = empty (); if ( __empty - || __at_back && _C_end._C_node == _C_nodes + _C_node_size - 1 - || !__at_back && _C_beg._C_node == _C_nodes) { + || (__at_back && _C_end._C_node == _C_nodes + _C_node_size - 1) + || (!__at_back && _C_beg._C_node == _C_nodes)) { _C_node_alloc_type __node_alloc (*this); Modified: stdcxx/branches/4.2.x/include/list.cc URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/list.cc?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/include/list.cc (original) +++ stdcxx/branches/4.2.x/include/list.cc Sun Sep 13 22:22:32 2009 @@ -286,7 +286,7 @@ _RWSTD_ASSERT_RANGE (__j, __k); // 23.2.2.4, p12 - check undefined behavior - _RWSTD_ASSERT (&__x != this || __i != __j && __i != __k); + _RWSTD_ASSERT (&__x != this || (__i != __j && __i != __k)); if (__j == __k) return; Modified: stdcxx/branches/4.2.x/include/rw/_ioiter.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_ioiter.h?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/include/rw/_ioiter.h (original) +++ stdcxx/branches/4.2.x/include/rw/_ioiter.h Sun Sep 13 22:22:32 2009 @@ -190,7 +190,7 @@ const bool __eof_rhs = !__rhs._C_sb || traits_type::eq_int_type (__rhs._C_sb->sgetc(), __eof); - return __eof_lhs && __eof_rhs || !__eof_lhs && !__eof_rhs; + return __eof_lhs == __eof_rhs; } Modified: stdcxx/branches/4.2.x/tests/algorithms/25.equal.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/algorithms/25.equal.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/algorithms/25.equal.cpp (original) +++ stdcxx/branches/4.2.x/tests/algorithms/25.equal.cpp Sun Sep 13 22:22:32 2009 @@ -125,7 +125,7 @@ } // verify 25.1.8, p1 - int success = res && i < mid_inx || !res && mid_inx <= i; + int success = (res && i < mid_inx) || (!res && mid_inx <= i); const bool equal_expected = i < mid_inx; Modified: stdcxx/branches/4.2.x/tests/algorithms/25.replace.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/algorithms/25.replace.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/algorithms/25.replace.cpp (original) +++ stdcxx/branches/4.2.x/tests/algorithms/25.replace.cpp Sun Sep 13 22:22:32 2009 @@ -210,8 +210,7 @@ success = val != src [i] - || val == src [i] - && replace_with.origin_ == xsrc [i].origin_; + || (val == src [i] && replace_with.origin_ == xsrc [i].origin_); if (!success) break; @@ -324,8 +323,7 @@ for (i = 0; i != nsrc; ++i) { success = val != src [i] - || val == src [i] - && replace_with.origin_ == xdst [i].origin_; + || (val == src [i] && replace_with.origin_ == xdst [i].origin_); if (!success) break; Modified: stdcxx/branches/4.2.x/tests/algorithms/25.transform.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/algorithms/25.transform.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/algorithms/25.transform.cpp (original) +++ stdcxx/branches/4.2.x/tests/algorithms/25.transform.cpp Sun Sep 13 22:22:32 2009 @@ -300,7 +300,7 @@ ////////////////////////////////////////////////////////////////// if (rw_opt_no_input_iter) { - if (1 == tag1 || 0 == tag1 && 1 == tag2) + if (1 == tag1 || (0 == tag1 && 1 == tag2)) rw_note (0, __FILE__, __LINE__, "InputIterator test disabled"); } else { @@ -316,7 +316,7 @@ ////////////////////////////////////////////////////////////////// if (rw_opt_no_fwd_iter) { - if (tag1 || !tag1 && tag2 || !tag1 && !tag2 && tag3) + if (tag1 || (!tag1 && tag2) || (!tag1 && !tag2 && tag3)) rw_note (0, __FILE__, __LINE__, "ForwardIterator test disabled"); } else { @@ -344,7 +344,7 @@ ////////////////////////////////////////////////////////////////// if (rw_opt_no_bidir_iter) { - if (tag1 || !tag1 && tag2 || !tag1 && !tag2 && tag3) + if (tag1 || (!tag1 && tag2) || (!tag1 && !tag2 && tag3)) rw_note (0, __FILE__, __LINE__, "BidirectionalIterator test disabled"); } @@ -373,7 +373,7 @@ ////////////////////////////////////////////////////////////////// if (rw_opt_no_rnd_iter) { - if (tag1 || !tag1 && tag2 || !tag1 && !tag2 && tag3) + if (tag1 || (!tag1 && tag2) || (!tag1 && !tag2 && tag3)) rw_note (0, __FILE__, __LINE__, "RandomAccessIterator test disabled"); } Modified: stdcxx/branches/4.2.x/tests/containers/23.vector.cons.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/containers/23.vector.cons.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/containers/23.vector.cons.cpp (original) +++ stdcxx/branches/4.2.x/tests/containers/23.vector.cons.cpp Sun Sep 13 22:22:32 2009 @@ -634,23 +634,23 @@ const Vector v1 (first, last, alloc); if ( i != v0.size () - || (!(i && !v0.empty () || !i && v0.empty ())) + || (!((i && !v0.empty ()) || (!i && v0.empty ()))) || (i != v1.size ()) - || (!(i && !v1.empty () || !i && v1.empty ()))) + || (!((i && !v1.empty ()) || (!i && v1.empty ())))) success = false; // verify size() and empty() rw_assert (i == v0.size (), 0, __LINE__, "size () == %zu, got %zu", i, v0.size ()); - rw_assert (i && !v0.empty () || !i && v0.empty (), + rw_assert ((i && !v0.empty ()) || (!i && v0.empty ()), 0, __LINE__, "size () == %zu, empty () == %d", v0.size (), v0.empty ()); rw_assert (i == v1.size (), 0, __LINE__, "size () == %zu, got %zu", i, v1.size ()); - rw_assert (i && !v1.empty () || !i && v1.empty (), + rw_assert ((i && !v1.empty ()) || (!i && v1.empty ()), 0, __LINE__, "size () == %zu, empty () == %d", v1.size (), v1.empty ()); } Modified: stdcxx/branches/4.2.x/tests/iostream/27.filebuf.codecvt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/iostream/27.filebuf.codecvt.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/iostream/27.filebuf.codecvt.cpp (original) +++ stdcxx/branches/4.2.x/tests/iostream/27.filebuf.codecvt.cpp Sun Sep 13 22:22:32 2009 @@ -503,7 +503,7 @@ else if ('?' == ch && !(mask & trigraphs)) { // (try to) convert a trigraph sequence if ( 2 > from_end - from_next - || '?' == from_next [1] && 3 > from_end - from_next) { + || ('?' == from_next [1] && 3 > from_end - from_next)) { res = partial; break; } @@ -1126,17 +1126,17 @@ // if end-of-file occurs on the input sequence RW_ASSERT_STATE (f, std::ios::eofbit | std::ios::failbit); - rw_assert (long (n) == buflen, 0, __LINE__, + rw_assert (std::size_t (n) == buflen, 0, __LINE__, "ifstream::read (%#p, %d); read %ld, expected %d", tmpbuf, sizeof tmpbuf, long (n), buflen); // assert that converted file contents are the same // as the originally generated buffer - const long len = long (n) < buflen ? long (n) : buflen; - for (long i = 0; i != len; ++i) { + const long len = std::size_t (n) < buflen ? std::size_t (n) : buflen; + for (std::size_t i = 0; i != len; ++i) { if (tmpbuf [i] != buffer [i]) { rw_assert (0, 0, __LINE__, - "'\\%03o' == '\\%03o'; offset %d", + "'\\%03o' == '\\%03o'; offset %zu", (unsigned char)buffer [i], (unsigned char)tmpbuf [i], i); break; 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=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp (original) +++ stdcxx/branches/4.2.x/tests/iostream/27.filebuf.cpp Sun Sep 13 22:22:32 2009 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2008 Rogue Wave Software. + * Copyright 1994-2008 Rogue Wave Software, Inc. * **************************************************************************/ @@ -2168,12 +2168,12 @@ return std::codecvt_base::partial; if ( from_next [0] != '\\' || from_next [1] != 'x' - || !( from_next [2] >= '0' && from_next [2] <= '9' - || from_next [2] >= 'A' && from_next [2] <= 'F' - || from_next [2] >= 'a' && from_next [2] <= 'f') - || !( from_next [3] >= '0' && from_next [3] <= '9' - || from_next [3] >= 'A' && from_next [3] <= 'F' - || from_next [3] >= 'a' && from_next [3] <= 'f')) + || !( (from_next [2] >= '0' && from_next [2] <= '9') + || (from_next [2] >= 'A' && from_next [2] <= 'F') + || (from_next [2] >= 'a' && from_next [2] <= 'f')) + || !( (from_next [3] >= '0' && from_next [3] <= '9') + || (from_next [3] >= 'A' && from_next [3] <= 'F') + || (from_next [3] >= 'a' && from_next [3] <= 'f'))) return std::codecvt_base::error; // convert a hex literal to a number Modified: stdcxx/branches/4.2.x/tests/iostream/27.istream.sentry.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/iostream/27.istream.sentry.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/iostream/27.istream.sentry.cpp (original) +++ stdcxx/branches/4.2.x/tests/iostream/27.istream.sentry.cpp Sun Sep 13 22:22:32 2009 @@ -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. * **************************************************************************/ @@ -434,9 +434,8 @@ _RWSTD_UNUSED (guard); - const bool success = - is.good () && guard - || !is.good () && !guard; + // verify that both are either false or true + const bool success = !is.good () == !guard; rw_assert (success, 0, __LINE__, "%u. %{$SENTRY}" Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.messages.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.messages.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/localization/22.locale.messages.cpp (original) +++ stdcxx/branches/4.2.x/tests/localization/22.locale.messages.cpp Sun Sep 13 22:22:32 2009 @@ -376,7 +376,7 @@ cat = (msgs.open)(cat_name, loc); const bool success = - expect_success && -1 < cat || expect_failure && cat < 0; + (expect_success && -1 < cat) || (expect_failure && cat < 0); rw_assert (success, 0, line, "messages<%s>::open(%#s, locale(%#s))" Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.cpp (original) +++ stdcxx/branches/4.2.x/tests/localization/22.locale.money.get.cpp Sun Sep 13 22:22:32 2009 @@ -361,7 +361,7 @@ err_expect = err; const int success = - !(-1 != consumed && last - next != consumed || err != err_expect); + !((-1 != consumed && last - next != consumed) || err != err_expect); rw_assert (success, __FILE__, lineno, "money_get<%s>::get (%{*Ac}, ..., %b, ..., %s&), " @@ -393,7 +393,7 @@ last = mg.get (next, last, intl, io, err, bs); int success = - !(-1 != consumed && last - next != consumed || err != err_expect); + !((-1 != consumed && last - next != consumed) || err != err_expect); rw_assert (success, __FILE__, lineno, "money_get<%s>::get (%{*Ac}, ..., %b, ..., " @@ -418,10 +418,10 @@ int n = std::sscanf (narrow_buf, fmt, &x); success = - !( err_expect & std::ios::failbit && !*grouping - && (1 == n || bs != initial) - || !(err_expect & std::ios::failbit) - && 1 < rw_ldblcmp (x, val)); + !( ( err_expect & std::ios::failbit && !*grouping + && (1 == n || bs != initial)) + || ( !(err_expect & std::ios::failbit) + && 1 < rw_ldblcmp (x, val))); rw_assert (success, __FILE__, lineno, "money_get<%s>::get (%{*Ac}, ..., %b, ..., " Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.num.get.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.num.get.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/localization/22.locale.num.get.cpp (original) +++ stdcxx/branches/4.2.x/tests/localization/22.locale.num.get.cpp Sun Sep 13 22:22:32 2009 @@ -380,7 +380,7 @@ // that the extracted value can be in success = err == err_expect - && (rw_equal (x, val) || val <= x && x <= val_max); + && (rw_equal (x, val) || (val <= x && x <= val_max)); nfailures += !success; @@ -416,8 +416,8 @@ const int n = std::sscanf (str, scanspec, &y); success = - !( err & std::ios::failbit && n > 0 - || !(err & std::ios::failbit) && 1 != n + !( (err & std::ios::failbit && n > 0) + || (!(err & std::ios::failbit) && 1 != n) || !rw_equal (x, y)); nfailures += !success; Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.cpp (original) +++ stdcxx/branches/4.2.x/tests/localization/22.locale.num.put.cpp Sun Sep 13 22:22:32 2009 @@ -419,7 +419,7 @@ || '+' == fill || pun.thousands_sep_ == fill || pun.decimal_point_ == fill - || fill >= '0' && fill <= '9') + || (fill >= '0' && fill <= '9')) return; // do not perform extraction if there is no data to extract Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.cpp (original) +++ stdcxx/branches/4.2.x/tests/localization/22.locale.numpunct.cpp Sun Sep 13 22:22:32 2009 @@ -224,8 +224,8 @@ // check that newly constructed locale matches - if ( 'C' == locnamebuf [0] && '\0' == locnamebuf [1] - || 'C' == locname [0] && '\0' == locname [1] + if ( ('C' == locnamebuf [0] && '\0' == locnamebuf [1]) + || ('C' == locname [0] && '\0' == locname [1]) || *loc == std::locale::classic ()) { // follow requirements in 22.2.3.1.2. p1, 2, and 3 check_decimal_point (charT ('.'), tname, loc); Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.cpp (original) +++ stdcxx/branches/4.2.x/tests/localization/22.locale.time.get.cpp Sun Sep 13 22:22:32 2009 @@ -89,7 +89,7 @@ _TRY { if ( '\0' == fmt [1] - || ('E' == fmt [0] || 'O' == fmt [0] && '\0' == fmt [2])) { + || ('E' == fmt [0] || ('O' == fmt [0] && '\0' == fmt [2]))) { // single-character format strings "a", "b", "x", "X", and "Y" // exercise the standard time_get interface, i.e., get_weekday(), Modified: stdcxx/branches/4.2.x/tests/numerics/26.c.math.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/numerics/26.c.math.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/numerics/26.c.math.cpp (original) +++ stdcxx/branches/4.2.x/tests/numerics/26.c.math.cpp Sun Sep 13 22:22:32 2009 @@ -208,7 +208,7 @@ const float xf = std::pow (fi, j); const float yf = std::pow (fi, fj); - rw_assert (rw_equal (xf, yf) || !i && j < 0, + rw_assert (rw_equal (xf, yf) || (!i && j < 0), 0, __LINE__, "std::pow (%d.0f, %d) = %g, " "std::pow (%d,0f, %d.0f) = %g", @@ -221,7 +221,7 @@ const double xd = std::pow (id, j); const double yd = std::pow (id, jd); - rw_assert (rw_equal (xd, yd) || !i && j < 0, + rw_assert (rw_equal (xd, yd) || (!i && j < 0), 0, __LINE__, "std::pow (%d.0, %d) = %g, " "std::pow (%d.0, %d.0) = %g", @@ -235,7 +235,7 @@ const long double xl = std::pow (il, j); const long double yl = std::pow (il, jl); - rw_assert (rw_equal (xl, yl) || !i && j < 0, + rw_assert (rw_equal (xl, yl) || (!i && j < 0), 0, __LINE__, "std::pow (%d.0L, %d) = %Lg, " "std::pow (%d.0L, %d.0L) = %Lg", Modified: stdcxx/branches/4.2.x/tests/self/0.fnmatch.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/self/0.fnmatch.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/self/0.fnmatch.cpp (original) +++ stdcxx/branches/4.2.x/tests/self/0.fnmatch.cpp Sun Sep 13 22:22:32 2009 @@ -48,7 +48,7 @@ const int native = exp; #endif // FNMATCH - if (result != native || -1 < exp && result != exp) { + if (result != native || (-1 < exp && result != exp)) { ++nerrors; Modified: stdcxx/branches/4.2.x/tests/src/23.containers.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/23.containers.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/src/23.containers.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/23.containers.cpp Sun Sep 13 22:22:32 2009 @@ -298,9 +298,10 @@ RW_ASSERT (0 != tname); if ( 0 == func || is_member - || Ids::arg_cont != argtype && Ids::arg_ccont != argtype) { + || (Ids::arg_cont != argtype && Ids::arg_ccont != argtype)) { // append the name or mnemonic of the argument type - rw_asnprintf (pbuf, pbufsize, "%{+}%{?}_%{:}%{?}, %{;}%{;}%s%s%s", + rw_asnprintf (pbuf, pbufsize, + "%{+}%{?}_%{:}%{?}, %{;}%{;}%s%s%s", 0 == func, 0 < argno, pfx, tname, sfx); } else { Modified: stdcxx/branches/4.2.x/tests/src/cmdopt.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/cmdopt.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/src/cmdopt.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/cmdopt.cpp Sun Sep 13 22:22:32 2009 @@ -121,8 +121,8 @@ if (opthelp && *opthelp) { - if ( opt->sopt_ == opthelp [0] && '\0' == opthelp [1] - || *lopt && 0 == strcmp (lopt + 1, opthelp)) { + if ( (opt->sopt_ == opthelp [0] && '\0' == opthelp [1]) + || (*lopt && 0 == strcmp (lopt + 1, opthelp))) { // remember that we found the option whose (short // or long) name we're to give help on; after printing @@ -374,7 +374,7 @@ if ( '*' == *next || '+' == *next - || val < 0 && '-' == *next + || (val < 0 && '-' == *next) || isdigit (*next)) { end = 0; @@ -991,11 +991,11 @@ // try to match the long option first, and only if it // doesn't match try the short single-character option - if ( cmplen == strlen (lopt) - && 0 == memcmp (optname, lopt, cmplen) - || opt->sopt_ - && optname [0] == opt->sopt_ - && (1 == optlen || opt->arg_)) { + if ( ( cmplen == strlen (lopt) + && 0 == memcmp (optname, lopt, cmplen)) + || ( opt->sopt_ + && optname [0] == opt->sopt_ + && (1 == optlen || opt->arg_))) { // matching option has been found found = true; Modified: stdcxx/branches/4.2.x/tests/src/locale.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/locale.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/src/locale.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/locale.cpp Sun Sep 13 22:22:32 2009 @@ -676,7 +676,7 @@ const wchar_t wc = wchar_t (i); const int len = wctomb (tmp, wc); - if (nbytes == 0 && 0 < len || nbytes != 0 && nbytes == len) { + if ((nbytes == 0 && 0 < len) || (nbytes != 0 && nbytes == len)) { // if the requested length is 0 (i.e., the caller doesn't // care) and the character is valid, store it // if the requested length is non-zero (including -1), @@ -706,7 +706,7 @@ const int len = wctomb (tmp, wc); - if (nbytes == 0 && 0 < len || nbytes != 0 && nbytes == len) { + if ((nbytes == 0 && 0 < len) || (nbytes != 0 && nbytes == len)) { wbuf [nchars++] = wc; if (nchars == bufsize) return nchars; Modified: stdcxx/branches/4.2.x/tests/src/opt_lines.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/opt_lines.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/src/opt_lines.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/opt_lines.cpp Sun Sep 13 22:22:32 2009 @@ -130,7 +130,7 @@ // skip any trailing whitespace for ( ; ' ' == *end; ++end); - if (end == parg || '-' != *end && ',' != *end && '\0' != *end) { + if (end == parg || ('-' != *end && ',' != *end && '\0' != *end)) { fprintf (stderr, "invalid character '%c' at position %d: \"%s\"\n", *end, int (parg - argbeg), argv [0]); Modified: stdcxx/branches/4.2.x/tests/src/opt_trace.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/opt_trace.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/src/opt_trace.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/opt_trace.cpp Sun Sep 13 22:22:32 2009 @@ -115,7 +115,7 @@ // skip any trailing whitespace for ( ; ' ' == *end; ++end); - if (end == parg || '-' != *end && ',' != *end && '\0' != *end) { + if (end == parg || ('-' != *end && ',' != *end && '\0' != *end)) { fprintf (stderr, "invalid character '%c' at position %d: \"%s\"\n", *end, int (parg - argbeg), argv [0]); Modified: stdcxx/branches/4.2.x/tests/src/printf.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/printf.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/src/printf.cpp (original) +++ stdcxx/branches/4.2.x/tests/src/printf.cpp Sun Sep 13 22:22:32 2009 @@ -2232,7 +2232,7 @@ len += n; - if (i + 1 == argc || _RWSTD_SIZE_MAX == argc && 0 == argv [i + 1]) + if (i + 1 == argc || (_RWSTD_SIZE_MAX == argc && 0 == argv [i + 1])) break; const unsigned pound = spec.fl_pound; @@ -2845,8 +2845,9 @@ break; case 'S': // %{S}, %{lS}, %{#*S} - if ( spec.mod == spec.mod_l || spec.mod == FmtSpec::mod_none - && spec.fl_pound && sizeof (wchar_t) == spec.width) { + if ( spec.mod == spec.mod_l + || ( spec.mod == FmtSpec::mod_none + && spec.fl_pound && sizeof (wchar_t) == spec.width)) { // std::wstring spec.param.ptr_ = PARAM (ptr_, pva); @@ -3269,7 +3270,7 @@ // verify that the length of the fomatted buffer is less than // its size (this test is unreliable if there are any embedded // NULs in the output) - RW_ASSERT (nchars < 0 || buf && strlen (buf) < bufsize); + RW_ASSERT (nchars < 0 || (buf && strlen (buf) < bufsize)); _RWSTD_UNUSED (nchars); Modified: stdcxx/branches/4.2.x/tests/strings/21.string.compare.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/strings/21.string.compare.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/strings/21.string.compare.cpp (original) +++ stdcxx/branches/4.2.x/tests/strings/21.string.compare.cpp Sun Sep 13 22:22:32 2009 @@ -800,9 +800,9 @@ } // verify the returned value - const bool success = res < 0 && tcase.nres == NPOS - || res > 0 && tcase.nres > 0 - || res == 0 && tcase.nres == 0; + const bool success = (res < 0 && tcase.nres == NPOS) + || (res > 0 && tcase.nres > 0) + || (res == 0 && tcase.nres == 0); rw_assert (success, 0, tcase.line, "line %d. %{$FUNCALL} == %d, got %d", Modified: stdcxx/branches/4.2.x/tests/strings/21.string.io.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/strings/21.string.io.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/strings/21.string.io.cpp (original) +++ stdcxx/branches/4.2.x/tests/strings/21.string.io.cpp Sun Sep 13 22:22:32 2009 @@ -1141,8 +1141,8 @@ func.which_ == StringIds::getline_istream_str || func.which_ == StringIds::getline_istream_str_val #ifndef _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE - || func.which_ == StringIds::inserter_ostream_cstr - && ret_state != Good + || ( func.which_ == StringIds::inserter_ostream_cstr + && ret_state != Good) #endif // _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE ? tcase.off : tcase.val; Modified: stdcxx/branches/4.2.x/tests/support/18.numeric.special.float.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/support/18.numeric.special.float.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/support/18.numeric.special.float.cpp (original) +++ stdcxx/branches/4.2.x/tests/support/18.numeric.special.float.cpp Sun Sep 13 22:22:32 2009 @@ -1259,8 +1259,8 @@ _RWSTD_UNUSED (pf); \ /* verify value */ \ rw_assert ( FLim::member () == FVal::member () \ - || FLim::member () != FLim::member () \ - && FVal::member () != FVal::member (), \ + || ( FLim::member () != FLim::member () \ + && FVal::member () != FVal::member ()), \ 0, __LINE__, \ "numeric_limits<%s>::" #member "() == %...@}, got %...@}", \ tname, fmt, FVal::member (), fmt, FLim::member ()); \ Modified: stdcxx/branches/4.2.x/util/collate.cpp URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/util/collate.cpp?rev=814400&r1=814399&r2=814400&view=diff ============================================================================== --- stdcxx/branches/4.2.x/util/collate.cpp (original) +++ stdcxx/branches/4.2.x/util/collate.cpp Sun Sep 13 22:22:32 2009 @@ -151,8 +151,8 @@ std::string second = ord_it->name.substr (comma_pos + 1); // verify a valid weight ordering - if ((first == "forward" && second != "position") || - first == "backward" && second != "position") { + if ( (first == "forward" && second != "position") + || (first == "backward" && second != "position")) { issue_diag (E_COLORD, true, &*ord_it, "unrecognized collating order\n"); break;