Browse files

2009-09-13 Martin Sebor <sebor@apache.org>

	Merged revs 814395, 814400, 814401, 814405, and 814409 from
	branches/4.2.x.

	2009-09-13  Martin Sebor  <sebor@apache.org>

	* tests/regress/23.vector.stdcxx-1037.cpp (Alloc::Alloc(const Alloc&)):
	Corrected syntax to prevent compiler errors. (Does a recent version of
	any compiler actually allow this? Maybe Visual C++?)

	2009-09-13  Martin Sebor  <sebor@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.

	2009-09-13  Martin Sebor  <sebor@apache.org>

	STDCXX-791
	* include/valarray (valarray::valarray(const gslice_array&,
	gslice_array::operator=, gslice_array::operator*=,
	gslice_array::operator/=, gslice_array::operator+=,
	gslice_array::operator-=, gslice_array::operator%=,
	gslice_array::operator^=, gslice_array::operator&=,
	gslice_array::operator|=, gslice_array::operator<<=,
	gslice_array::operator>>=): Parenthesized logic expression
	to silence gcc -Wparentheses warning. (Missed in r814400).

	2009-09-13  Martin Sebor  <sebor@apache.org>

	STDCXX-791
	* tests/src/char.cpp (UserTraits::lt, UserTraits::compare,
	UserTraits::copy, UserTraits::move): Parenthesized logic expression
	to silence gcc -Wparentheses warning. (Missed in r814400).

	2009-09-13  Martin Sebor  <sebor@apache.org>

	* tests/localization/22.locale.ctype.tolower.cpp (locale_list): Removed
	unused global variable to silence gcc -Wshadow warnings.
	* tests/localization/22.locale.messages.mt.cpp (run_test): Silenced
	gcc's -Wunused warning, corrected a logic error in a preprocessor
	conditional and fixed a typo.
	* tests/localization/22.locale.statics.mt.cpp (test_global): Changed
	type of a local variable to avoid gcc's -Wsign-compare warnings.
	* tests/regress/22.locale.messages.stdcxx-542.cpp (run_test): Same.
	* tests/containers/23.bitset.cpp (test_ctors, stress_ctors,
	test_operators, test_other, stress_count, test_elem_access,
	test_to_string): Corrected formatting directive for size_t argument.
	* tests/regress/23.set.stdcxx-216.cpp (Value::Value(unsigned): Renamed
	a function formal argument to avoid a gcc -Wshadow warning. Removed
	commented out debugging code.
	* tests/regress/21.string.append.stdcxx-438.cpp (operator new): Threw
	std::bad_alloc on failure as required instead of returning null to
	silence a gcc warning.
	* tests/regress/21.string.replace.stdcxx-175.cpp (main): Removed
	unused arguments to silence gcc -Wunused warnings.
	* tests/regress/23.list.special.stdcxx-334.cpp (operator==, operator!=,
	main): Same.
	* tests/regress/23.list.insert.stdcxx-331.cpp (main): Same.
	* tests/regress/21.string.stdcxx-466.cpp (main): Same.
	* tests/regress/23.list.cons.stdcxx-268.cpp (main): Same.
	* util/locale.cpp (write_coll_info): Removed an empty else branch
	to silence a gcc -Wmissing-braces warning.
	* util/exec.cpp (wait_for_child): Added braces to silence a gcc
	-Wmissing-braces warning.


git-svn-id: http://svn.apache.org/repos/asf/stdcxx/trunk@814419 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 68ff42e commit 79e6bcd7d6530820ac00fb7c560353b2633ae036 sebor committed Sep 13, 2009
Showing with 230 additions and 235 deletions.
  1. +2 −1 examples/tutorial/icecream.cpp
  2. +2 −2 include/deque.cc
  3. +1 −1 include/list.cc
  4. +1 −1 include/rw/_ioiter.h
  5. +24 −26 include/valarray
  6. +1 −1 tests/algorithms/25.equal.cpp
  7. +2 −4 tests/algorithms/25.replace.cpp
  8. +4 −4 tests/algorithms/25.transform.cpp
  9. +79 −79 tests/containers/23.bitset.cpp
  10. +4 −4 tests/containers/23.vector.cons.cpp
  11. +5 −5 tests/iostream/27.filebuf.codecvt.cpp
  12. +7 −7 tests/iostream/27.filebuf.cpp
  13. +3 −4 tests/iostream/27.istream.sentry.cpp
  14. +0 −2 tests/localization/22.locale.ctype.tolower.cpp
  15. +1 −1 tests/localization/22.locale.messages.cpp
  16. +13 −5 tests/localization/22.locale.messages.mt.cpp
  17. +6 −6 tests/localization/22.locale.money.get.cpp
  18. +3 −3 tests/localization/22.locale.num.get.cpp
  19. +1 −1 tests/localization/22.locale.num.put.cpp
  20. +2 −2 tests/localization/22.locale.numpunct.cpp
  21. +1 −1 tests/localization/22.locale.statics.mt.cpp
  22. +1 −1 tests/localization/22.locale.time.get.cpp
  23. +3 −3 tests/numerics/26.c.math.cpp
  24. +1 −1 tests/regress/21.string.append.stdcxx-438.cpp
  25. +3 −5 tests/regress/21.string.replace.stdcxx-175.cpp
  26. +1 −1 tests/regress/21.string.stdcxx-466.cpp
  27. +2 −2 tests/regress/22.locale.messages.stdcxx-542.cpp
  28. +2 −1 tests/regress/23.list.cons.stdcxx-268.cpp
  29. +2 −1 tests/regress/23.list.insert.stdcxx-331.cpp
  30. +4 −3 tests/regress/23.list.special.stdcxx-334.cpp
  31. +6 −17 tests/regress/23.set.stdcxx-216.cpp
  32. +2 −1 tests/regress/23.vector.stdcxx-1037.cpp
  33. +1 −1 tests/self/0.fnmatch.cpp
  34. +3 −2 tests/src/23.containers.cpp
  35. +5 −5 tests/src/char.cpp
  36. +8 −8 tests/src/cmdopt.cpp
  37. +2 −2 tests/src/locale.cpp
  38. +1 −1 tests/src/opt_lines.cpp
  39. +1 −1 tests/src/opt_trace.cpp
  40. +5 −4 tests/src/printf.cpp
  41. +3 −3 tests/strings/21.string.compare.cpp
  42. +2 −2 tests/strings/21.string.io.cpp
  43. +2 −2 tests/support/18.numeric.special.float.cpp
  44. +2 −2 util/collate.cpp
  45. +6 −4 util/exec.cpp
  46. +0 −2 util/locale.cpp
View
3 examples/tutorial/icecream.cpp
@@ -141,7 +141,8 @@ int irand (int n)
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;
}
View
4 include/deque.cc
@@ -233,8 +233,8 @@ _C_push (bool __at_back, const_reference __x)
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);
View
2 include/list.cc
@@ -286,7 +286,7 @@ splice (iterator __i, list &__x, iterator __j, iterator __k)
_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;
View
2 include/rw/_ioiter.h
@@ -190,7 +190,7 @@ equal (const istreambuf_iterator &__rhs) const
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;
}
View
50 include/valarray
@@ -1856,8 +1856,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] = __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -1871,8 +1871,7 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( !gsl->is_reseted() || !__cpt && gsl->ind_numb() )
- {
+ while (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ())) {
(*_C_array)[__i] = value;
__i= gsl->next_ind();
__cpt++;
@@ -1889,8 +1888,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] *= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -1904,8 +1903,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] /= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -1919,8 +1918,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] += __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -1934,8 +1933,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted() || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] -= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -1950,8 +1949,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] %= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -1965,8 +1964,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] ^= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -1980,8 +1979,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted() || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] &= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -1995,8 +1994,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted() || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] |= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -2010,8 +2009,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] <<= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -2025,8 +2024,8 @@ gslice_array<_TypeT>::operator= (const valarray<_TypeT>& __rhs) const
_RWSTD_SIZE_T __i = gsl->next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( (!gsl->is_reseted() || !__cpt && gsl->ind_numb()) && __cpt < __rhs.size() )
- {
+ while ( (!gsl->is_reseted () || (!__cpt && gsl->ind_numb ()))
+ && __cpt < __rhs.size ()) {
(*_C_array)[__i] >>= __rhs[__cpt];
__i= gsl->next_ind();
__cpt++;
@@ -2158,8 +2157,7 @@ inline valarray<_TypeT>::valarray(const gslice_array<_TypeT>& sl_ar)
_RWSTD_SIZE_T __i = __sl.next_ind();
_RWSTD_SIZE_T __cpt = 0;
- while( !__sl.is_reseted() || !__cpt && __maxinx )
- {
+ while (!__sl.is_reseted () || (!__cpt && __maxinx)) {
__tmp[__cpt] = (*(sl_ar.get_ref_mem_array()))[__i];
__i= __sl.next_ind();
__cpt++;
View
2 tests/algorithms/25.equal.cpp
@@ -125,7 +125,7 @@ void test_equal (std::size_t N,
}
// 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;
View
6 tests/algorithms/25.replace.cpp
@@ -210,8 +210,7 @@ void test_replace (int line,
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 @@ void test_replace (int line,
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;
View
8 tests/algorithms/25.transform.cpp
@@ -300,7 +300,7 @@ void gen_test (const T* ptr,
//////////////////////////////////////////////////////////////////
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 @@ void gen_test (const T* ptr,
//////////////////////////////////////////////////////////////////
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 @@ void gen_test (const T* ptr,
//////////////////////////////////////////////////////////////////
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 @@ void gen_test (const T* ptr,
//////////////////////////////////////////////////////////////////
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");
}
View
158 tests/containers/23.bitset.cpp
@@ -379,25 +379,25 @@ void test_ctors (const std::bitset<N>*)
const ULong bmask = ULong (::bitmax (N));
{ // bitset::bitset()
- rw_info (0, 0, __LINE__, "std::bitset<%d>::bitset()", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::bitset()", N);
const std::bitset<N> b;
rw_assert (0 == b.to_ulong (), 0, __LINE__,
- "bitset<%d>::bitset ().to_ulong() == 0, got %#lx",
+ "bitset<%zu>::bitset ().to_ulong() == 0, got %#lx",
b.to_ulong ());
}
{ // bitset::bitset (unsigned long)
- rw_info (0, 0, __LINE__, "std::bitset<%d>::bitset (unsigned long)", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::bitset (unsigned long)", N);
const std::bitset<N> b (ULONG_MAX & bmask);
rw_assert ((ULONG_MAX & bmask) == b.to_ulong (), 0, __LINE__,
- "bitset<%d>::bitset (%#lx).to_ulong() == 0, got %#lx",
+ "bitset<%zu>::bitset (%#lx).to_ulong() == 0, got %#lx",
N, ULONG_MAX & bmask, b.to_ulong ());
}
{ // bitset (const string& str, size_t pos = 0, size_t n = (size_t)-1);
- rw_info (0, 0, __LINE__, "std::bitset<%d>::bitset (string)", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::bitset (string)", N);
test_set<N> ts;
ts.set ();
@@ -407,12 +407,12 @@ void test_ctors (const std::bitset<N>*)
if (N <= sizeof (unsigned long) * CHAR_BIT)
rw_assert (b == bmask, 0, __LINE__,
- "bitset<%d>::bitset(string(\"%s\").to_ulong()"
+ "bitset<%zu>::bitset(string(\"%s\").to_ulong()"
" == %#x, got %#x", N, ts.bits (), bmask,
b.to_ulong ());
else
rw_assert (test_set<N>(b) == ts, 0, __LINE__,
- "bitset<%d>::bitset(string(\"111...111\")"
+ "bitset<%zu>::bitset(string(\"111...111\")"
" == 111...111, got %s",
N, test_set<N>(b).bits ());
@@ -423,24 +423,24 @@ void test_ctors (const std::bitset<N>*)
}
{ // bitset (const bitset<N>& rhs)
- rw_info (0, 0, __LINE__, "std::bitset<%d>::bitset (const bitset&)", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::bitset (const bitset&)", N);
const std::bitset<N> b1 (12345);
const std::bitset<N> b2 (b1);
rw_assert (b1.to_ulong () == b2.to_ulong (), 0, __LINE__,
- "bitset<%d>::bitset (bitset<%d>(%#lx)).to_ulong() == %#lx,"
- " got %#lx", N, b1.to_ulong (), b2.to_ulong ());
+ "bitset<%zu>::bitset (bitset<%1$zu>(%#lx)).to_ulong() "
+ "== %#2$lx, got %#lx", N, b1.to_ulong (), b2.to_ulong ());
rw_info (0, 0, __LINE__,
- "std::bitset<%d>::operator=(const bitset&)", N);
+ "std::bitset<%zu>::operator=(const bitset&)", N);
std::bitset<N> b3;
b3 = b1;
rw_assert (b1.to_ulong () == b3.to_ulong (), 0, __LINE__,
- "bitset<%d>::bitset (bitset<%d>(%#lx)).to_ulong() == %#lx,"
- " got %#lx", N, b1.to_ulong (), b3.to_ulong ());
+ "bitset<%zu>::bitset (bitset<%1$zu>(%#lx)).to_ulong() "
+ "== %#1$lx, got %#lx", N, b1.to_ulong (), b3.to_ulong ());
}
}
@@ -449,7 +449,7 @@ void test_ctors (const std::bitset<N>*)
template <std::size_t N>
void stress_ctors (const std::bitset<N>*)
{
- rw_info (0, 0, __LINE__, "std::bitset<%d>::bitset (string)", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::bitset (string)", N);
const std::size_t max_mask = bitmax (N);
@@ -462,7 +462,7 @@ void stress_ctors (const std::bitset<N>*)
const std::bitset<N> b1 (n);
rw_assert (n == b1.to_ulong (), 0, __LINE__,
- "bitset<%d>::bitset(%#lx).to_ulong() == %#lx, got %#lx",
+ "bitset<%zu>::bitset(%#lx).to_ulong() == %#lx, got %#lx",
N, n, n, b1.to_ulong ());
test_set<N> ts;
@@ -471,7 +471,7 @@ void stress_ctors (const std::bitset<N>*)
// exercise 23.3.5.1, p3
std::bitset<N> b2 = std::bitset<N>(std::string (ts.bits ()));
rw_assert (test_set<N>(b2) == ts, 0, __LINE__,
- "bitset<%d>::bitset (\"%s\") got %s",
+ "bitset<%zu>::bitset (\"%s\") got %s",
N, ts.bits (), b2.to_string ().c_str ());
}
}
@@ -482,7 +482,7 @@ template <std::size_t N>
void test_operators (const std::bitset<N>*)
{
#define TEST_OP(op) do { \
- rw_info (!i, 0, __LINE__, "std::bitset<%d>::operator" #op \
+ rw_info (!i, 0, __LINE__, "std::bitset<%zu>::operator" #op \
"= (const bitset&)", N); \
\
test_set<N> lhs = test_set<N>().random (); \
@@ -493,12 +493,12 @@ void test_operators (const std::bitset<N>*)
const std::bitset<N> b_res = b_lhs op ## = b_rhs; \
\
rw_assert (res == test_set<N>(b_res), 0, __LINE__, \
- "bitset<%lu>::operator" #op "= (const bitset<%lu>&):" \
+ "bitset<%zu>::operator" #op "= (const bitset<%zu>&):" \
" %s " #op " %s == %s, got %s", \
N, N, lhs.bits (), rhs.bits (), res.bits (), \
test_set<N>(b_res).bits ()); \
\
- rw_info (!i, 0, __LINE__, "std::bitset<%d>::operator" #op \
+ rw_info (!i, 0, __LINE__, "std::bitset<%zu>::operator" #op \
" (const bitset&)", N); \
lhs.random (); \
b_lhs = std::bitset<N>(std::string (lhs.bits ())); \
@@ -507,7 +507,7 @@ void test_operators (const std::bitset<N>*)
const std::bitset<N> b_res2 = b_lhs op b_rhs; \
\
rw_assert (res2 == test_set<N>(b_res2), 0, __LINE__, \
- "bitset<%lu>::operator" #op " (const bitset<%lu>&):" \
+ "bitset<%zu>::operator" #op " (const bitset<%zu>&):" \
" %s " #op " %s == %s, got %s", \
N, N, lhs.bits (), rhs.bits (), res2.bits (), \
test_set<N>(b_res2).bits ()); \
@@ -530,7 +530,7 @@ void test_operators (const std::bitset<N>*)
// 23.3.5.2, p5 and 23.3.5.3, p3
TEST_OP (^);
- rw_info (!i, 0, __LINE__, "std::bitset<%d>::operator<<=(size_t)", N);
+ rw_info (!i, 0, __LINE__, "std::bitset<%zu>::operator<<=(size_t)", N);
const test_set<N> ts1 = test_set<N>().random ();
const test_set<N> ts2 = test_set<N>(ts1) <<= i % M;
@@ -541,11 +541,11 @@ void test_operators (const std::bitset<N>*)
b1 <<= i % M;
rw_assert (test_set<N>(b1) == ts2, 0, __LINE__,
- "bitset<%d>::operator<<=(%lu): %s << %lu == %s, got %s",
+ "bitset<%zu>::operator<<=(%lu): %s << %lu == %s, got %s",
N, i % M, ts1.bits (), i % M, ts2.bits (),
test_set<N>(b1).bits ());
- rw_info (!i, 0, __LINE__, "std::bitset<%d>::operator>>=(size_t)", N);
+ rw_info (!i, 0, __LINE__, "std::bitset<%zu>::operator>>=(size_t)", N);
const test_set<N> ts3 = test_set<N>(ts1) >>= i % M;
std::bitset<N> b2 = std::bitset<N>(std::string (ts1.bits ()));
@@ -554,32 +554,32 @@ void test_operators (const std::bitset<N>*)
b2 >>= i % M;
rw_assert (test_set<N>(b2) == ts3, 0, __LINE__,
- "bitset<%d>::operator>>=(%lu): %s >> %lu == %s, got %s",
+ "bitset<%zu>::operator>>=(%lu): %s >> %lu == %s, got %s",
N, i % M, ts1.bits (), i % M, ts3.bits (),
test_set<N>(b2).bits ());
rw_info (!i, 0, __LINE__,
- "std::bitset<%d>::operator<<=(size_t) (unused bits)", N);
+ "std::bitset<%zu>::operator<<=(size_t) (unused bits)", N);
if (N) {
b1.set (N - 1);
std::size_t first = b1.count ();
std::size_t second = (b1 <<= 1).count ();
rw_assert (!(first == second), 0, __LINE__,
- "bitset<%lu>::operator<<=(1): "
+ "bitset<%zu>::operator<<=(1): "
"after <<= 1: expected %lu, got %lu",
N, first - 1, second);
}
rw_info (!i, 0, __LINE__,
- "std::bitset<%d>::operator>>=(size_t) (unused bits)", N);
+ "std::bitset<%zu>::operator>>=(size_t) (unused bits)", N);
if (N) {
b2.set ();
std::size_t first = b2.count ();
std::size_t second = (b2 >>= 1).count ();
rw_assert (first - 1 == second, 0, __LINE__,
- "bitset<%lu>::operator>>=(1): "
+ "bitset<%zu>::operator>>=(1): "
"after >>= 1: expected %lu, got %lu",
N, first - 1, second);
}
@@ -603,64 +603,64 @@ void test_other (const std::bitset<N>*)
std::bitset<N> b2 = ~b1;
rw_assert (ts2 == test_set<N>(b2), 0, __LINE__,
- "bitset<%d>::operator~(): ~%s == %s, got %s",
+ "bitset<%zu>::operator~(): ~%s == %s, got %s",
N, ts1.bits (), ts2.bits (), test_set<N>(b2).bits ());
// 23.3.5.2, p25
b2.flip ();
rw_assert (ts1 == test_set<N>(b2), 0, __LINE__,
- "bitset<%d>::flip (): ~%s == %s, got %s",
+ "bitset<%zu>::flip (): ~%s == %s, got %s",
N, ts1.bits (), ts2.bits (), test_set<N>(b2).bits ());
// 23.3.5.2, p27
for (std::size_t _j = 0; _j != N; ++_j)
b2.flip (_j);
rw_assert (ts2 == test_set<N>(b2), 0, __LINE__,
- "bitset<%d>::flip () == %s, got %s",
+ "bitset<%zu>::flip () == %s, got %s",
N, ts2.bits (), test_set<N>(b2).bits ());
// 23.3.5.3, p35
rw_assert (ts2.count () == b2.count (), 0, __LINE__,
- "bitset<%d>::count () == %d, got %d [%s]",
+ "bitset<%zu>::count () == %zu, got %d [%s]",
N, ts2.count (), b2.count (), test_set<N>(b2).bits());
// 23.3.5.3, p37
- rw_assert (b2 == b2 && (N && !(b1 == b2) || !N && b1 == b2),
+ rw_assert (b2 == b2 && ((N && !(b1 == b2)) || (!N && b1 == b2)),
0, __LINE__,
- "bitset<%d>::operator==(const bitset<%ul>&) [%s]",
- N, N, N ? test_set<N>(b2).bits () : "<empty>");
+ "bitset<%zu>::operator== (const bitset&) [%s]",
+ N, N ? test_set<N>(b2).bits () : "<empty>");
// 23.3.5.3, p38
- rw_assert ((N && b1 != b2 || !N && !(b1 != b2)) && !(b2 != b2),
+ rw_assert ((N && b1 != b2) || (!N && !(b1 != b2) && !(b2 != b2)),
0, __LINE__,
- "bitset<%d>::operator!=(const bitset<%ul>&) [%s]",
- N, N, N ? test_set<N>(b2).bits () : "<empty>");
+ "bitset<%zu>::operator!= (const bitset&) [%s]",
+ N, N ? test_set<N>(b2).bits () : "<empty>");
// 23.3.5.3, p42
- rw_assert (b2.count() && b2.any() || !b2.count() && !b2.any(),
+ rw_assert ((b2.count () && b2.any ()) || (!b2.count () && !b2.any ()),
0, __LINE__,
- "bitset<%d>::any () [%s]",
+ "bitset<%zu>::any () [%s]",
N, test_set<N>(b2).bits ());
// 23.3.5.3, p43
- rw_assert (b2.count() && !b2.none() || !b2.count() && b2.none(),
+ rw_assert ((b2.count () && !b2.none ()) || (!b2.count () && b2.none ()),
0, __LINE__,
- "bitset<%d>::none () [%s]",
+ "bitset<%zu>::none () [%s]",
N, test_set<N>(b2).bits ());
for (std::size_t k = 0; k != N; ++k) {
test_set<N> ts3 = test_set<N>(ts1) <<= k;
std::bitset<N> b3 = b1 << k;
rw_assert (test_set<N>(b3) == ts3, 0, __LINE__,
- "bitset<%lu>::operator<<(%lu)", N, k);
+ "bitset<%zu>::operator<< (%zu)", N, k);
ts3 = test_set<N>(ts1) >>= k;
b3 = b1 >> k;
rw_assert (test_set<N>(b3) == ts3, 0, __LINE__,
- "bitset<%lu>::operator>>(%lu)", N, k);
+ "bitset<%zu>::operator>> (%zu)", N, k);
}
}
}
@@ -670,7 +670,7 @@ void test_other (const std::bitset<N>*)
template <std::size_t N>
void stress_count (const std::bitset<N>*)
{
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::count()", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::count()", N);
for (std::size_t i = 0; i != N; i++) {
std::bitset<N> b;
@@ -679,7 +679,7 @@ void stress_count (const std::bitset<N>*)
b.set (j);
rw_assert (b.count () == i, 0, __LINE__,
- "%lu. std::bitset<%lu>::count()", i, N);
+ "%lu. std::bitset<%zu>::count()", i, N);
}
}
@@ -688,9 +688,9 @@ void stress_count (const std::bitset<N>*)
template <std::size_t N>
void test_elem_access (const std::bitset<N>*)
{
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::test(size_t)", N);
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::operator[](size_t)", N);
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::operator[](size_t) const", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::test(size_t)", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::operator[](size_t)", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::operator[](size_t) const", N);
for (std::size_t i = 0; i != NLOOPS; ++i) {
@@ -700,18 +700,18 @@ void test_elem_access (const std::bitset<N>*)
for (std::size_t _j = 0; _j != N; ++_j) {
// 23.3.5.2, p39
rw_assert (b.test (_j) == ts.test (_j), 0, __LINE__,
- "bitset<%lu>::test (%lu): %s",
+ "bitset<%zu>::test (%lu): %s",
N, _j, test_set<N>(b).bits ());
// 23.3.5.2, p??: see lwg issue 11
rw_assert (b [_j] == ts.test (_j), 0, __LINE__,
- "bitset<%lu>::operator[](%lu): %s",
+ "bitset<%zu>::operator[](%lu): %s",
N, _j, test_set<N>(b).bits ());
// 23.3.5.2, p??: see lwg issue 11
rw_assert (((const std::bitset<N>&)b) [_j] == ts.test (_j),
0, __LINE__,
- "bitset<%lu>::operator[](%lu) const: %s",
+ "bitset<%zu>::operator[](%lu) const: %s",
N, _j, test_set<N>(b).bits ());
// exercise std::bitset<N>::reference
@@ -720,18 +720,18 @@ void test_elem_access (const std::bitset<N>*)
// std::bitset<N>::reference::flip()
r.flip ();
rw_assert (r == !ts.test (_j), 0, __LINE__,
- "bitset<%lu>::reference::flip()", N);
+ "bitset<%zu>::reference::flip()", N);
// std::bitset<N>::reference::operator~()
bool toggled = ~r;
rw_assert (toggled == ts.test (_j), 0, __LINE__,
- "bitset<%lu>::reference::operator~()", N);
+ "bitset<%zu>::reference::operator~()", N);
// std::bitset<N>::reference::operator=(bool)
r = toggled;
rw_assert (r == ts.test (_j) && b.test (_j) == ts.test (_j),
0, __LINE__,
- "bitset<%lu>::reference::operator=(bool)", N);
+ "bitset<%zu>::reference::operator=(bool)", N);
}
}
}
@@ -1031,7 +1031,7 @@ void test_to_string (std::bitset<N>*, charT*, Traits*, Alloc*,
static const char* const aname = alloc_name (Alloc ());
rw_info (0, 0, __LINE__,
- "std::bitset<%lu>::to_string<%s, %s, %s >()",
+ "std::bitset<%zu>::to_string<%s, %s, %s >()",
N, cname, tname, aname);
test_set<N> ts;
@@ -1063,37 +1063,37 @@ void test_to_string (std::bitset<N>*, charT*, Traits*, Alloc*,
pos = compare (str3.data (), ts.bits (), "01");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string () == \"%s\", got \"%s\": "
+ "bitset<%zu>::to_string () == \"%s\", got \"%s\": "
"mismatch at bit %d",
N, ts.bits (), TO_STR (str3), pos);
// specify one of the two function arguments (exercise the default
// or the respective overload)
rw_info (0, 0, __LINE__,
- "std::bitset<%lu>::to_string<%s, %s, %s >(\"%s\")",
+ "std::bitset<%zu>::to_string<%s, %s, %s >(\"%s\")",
N, cname, tname, aname, cname);
str3 = bitset_to_string_3 (bs, 1, zero, one, (String3*)0);
pos = compare (str3.data (), ts.bits (), "o1");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string ('o') == %s, got %s: "
+ "bitset<%zu>::to_string ('o') == %s, got %s: "
"mismatch at bit %d", N,
to_string (ts.bits (), "o1").c_str (),
TO_STR (str3), pos);
// specify both of the two function arguments
rw_info (0, 0, __LINE__,
- "std::bitset<%lu>::to_string<%s, %s, %s >(%s, %s)",
+ "std::bitset<%zu>::to_string<%s, %s, %s >(%s, %s)",
N, cname, tname, aname, cname, cname);
str3 = bitset_to_string_3 (bs, 2, zero, one, (String3*)0);
pos = compare (str3.data (), ts.bits (), "ox");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string ('o', 'x') == %s, got %s: "
+ "bitset<%zu>::to_string ('o', 'x') == %s, got %s: "
"mismatch at bit %d", N,
to_string (ts.bits (), "ox").c_str (),
TO_STR (str3), pos);
@@ -1103,7 +1103,7 @@ void test_to_string (std::bitset<N>*, charT*, Traits*, Alloc*,
// exercise the overload of the to_string() member function template
// that takes the first two template parameters different from char,
// and char_traits<char>
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::to_string<%s, %s >()",
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::to_string<%s, %s >()",
N, cname, tname);
typedef std::allocator<charT> CharTAlloc;
@@ -1117,36 +1117,36 @@ void test_to_string (std::bitset<N>*, charT*, Traits*, Alloc*,
pos = compare (str2.data (), ts.bits (), "01");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string () == %s, got %s: mismatch at bit %d",
+ "bitset<%zu>::to_string () == %s, got %s: mismatch at bit %d",
N, ts.bits (), TO_STR (str2), pos);
// specify one of the two function arguments (exercise the default
// or the respective overload)
rw_info (0, 0, __LINE__,
- "std::bitset<%lu>::to_string<%s, %s >(%s)",
+ "std::bitset<%zu>::to_string<%s, %s >(%s)",
N, cname, tname, cname);
str2 = bitset_to_string_2 (bs, 1, zero, one, (String2*)0);
pos = compare (str2.data (), ts.bits (), "o1");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string ('o') == %s, got %s: "
+ "bitset<%zu>::to_string ('o') == %s, got %s: "
"mismatch at bit %d", N,
to_string (ts.bits (), "o1").c_str (),
TO_STR (str2), pos);
// specify both of the two function arguments
rw_info (0, 0, __LINE__,
- "std::bitset<%lu>::to_string<%s, %s >(%s, %s)",
+ "std::bitset<%zu>::to_string<%s, %s >(%s, %s)",
N, cname, tname, cname, cname);
str2 = bitset_to_string_2 (bs, 2, zero, one, (String2*)0);
pos = compare (str2.data (), ts.bits (), "ox");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string ('o', 'x') == %s, got %s: "
+ "bitset<%zu>::to_string ('o', 'x') == %s, got %s: "
"mismatch at bit %d", N,
to_string (ts.bits (), "ox").c_str (),
TO_STR (str2), pos);
@@ -1155,7 +1155,7 @@ void test_to_string (std::bitset<N>*, charT*, Traits*, Alloc*,
////////////////////////////////////////////////////////////////////////
// exercise the overload of the to_string() member function template
// that takes the first template parameter different from char
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::to_string<%s>()",
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::to_string<%s>()",
N, cname);
typedef std::char_traits<charT> CharTraits;
@@ -1169,35 +1169,35 @@ void test_to_string (std::bitset<N>*, charT*, Traits*, Alloc*,
pos = compare (str1.data (), ts.bits (), "01");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string () == %s, got %s: mismatch at bit %d",
+ "bitset<%zu>::to_string () == %s, got %s: mismatch at bit %d",
N, ts.bits (), TO_STR (str1), pos);
// specify one of the two function arguments (exercise the default
// or the respective overload)
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::to_string<%s>(%s)",
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::to_string<%s>(%s)",
N, cname, cname);
str1 = bitset_to_string_1 (bs, 1, zero, one, (String1*)0);
pos = compare (str1.data (), ts.bits (), "o1");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string ('o') == %s, got %s: "
+ "bitset<%zu>::to_string ('o') == %s, got %s: "
"mismatch at bit %d", N,
to_string (ts.bits (), "o1").c_str (),
TO_STR (str1), pos);
// specify both of the two function arguments
rw_info (0, 0, __LINE__,
- "std::bitset<%lu>::to_string<%s>(%s, %s)",
+ "std::bitset<%zu>::to_string<%s>(%s, %s)",
N, cname, cname, cname);
str1 = bitset_to_string_1 (bs, 2, zero, one, (String1*)0);
pos = compare (str1.data (), ts.bits (), "ox");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string ('o', 'x') == %s, got %s: "
+ "bitset<%zu>::to_string ('o', 'x') == %s, got %s: "
"mismatch at bit %d", N,
to_string (ts.bits (), "ox").c_str (),
TO_STR (str1), pos);
@@ -1209,7 +1209,7 @@ void test_to_string (std::bitset<N>*, charT*, Traits*, Alloc*,
if (nontemplate_done)
return;
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::to_string ()", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::to_string ()", N);
typedef std::string String0;
@@ -1221,32 +1221,32 @@ void test_to_string (std::bitset<N>*, charT*, Traits*, Alloc*,
pos = compare (str0.data (), ts.bits (), "01");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string () == %s, got %s: mismatch at bit %d",
+ "bitset<%zu>::to_string () == %s, got %s: mismatch at bit %d",
N, ts.bits (), str0.c_str (), pos);
// specify one of the two function arguments (exercise the default
// or the respective overload)
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::to_string (char)", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::to_string (char)", N);
str0 = bitset_to_string_0 (bs, 1, 'o', 'x', (String0*)0);
pos = compare (str0.data (), ts.bits (), "o1");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string ('o') == %s, got %s: "
+ "bitset<%zu>::to_string ('o') == %s, got %s: "
"mismatch at bit %d", N,
to_string (ts.bits (), "o1").c_str (),
str0.c_str (), pos);
// specify both of the two function arguments
- rw_info (0, 0, __LINE__, "std::bitset<%lu>::to_string (char, char)", N);
+ rw_info (0, 0, __LINE__, "std::bitset<%zu>::to_string (char, char)", N);
str0 = bitset_to_string_0 (bs, 2, 'o', 'x', (String0*)0);
pos = compare (str0.data (), ts.bits (), "ox");
rw_assert (-1 == pos, 0, __LINE__,
- "bitset<%lu>::to_string ('o', 'x') == %s, got %s: "
+ "bitset<%zu>::to_string ('o', 'x') == %s, got %s: "
"mismatch at bit %d", N,
to_string (ts.bits (), "ox").c_str (),
str0.c_str (), pos);
View
8 tests/containers/23.vector.cons.cpp
@@ -634,23 +634,23 @@ void test_ctors (Vector*, T*, Alloc alloc)
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 ());
}
View
10 tests/iostream/27.filebuf.codecvt.cpp
@@ -503,7 +503,7 @@ cformat::do_in ( state_type& /* unused */,
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 @@ run_test (int, char*[])
// 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;
View
14 tests/iostream/27.filebuf.cpp
@@ -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.
*
**************************************************************************/
@@ -2096,12 +2096,12 @@ CodeCvt<charT>::do_in ( state_type &state,
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
View
7 tests/iostream/27.istream.sentry.cpp
@@ -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 @@ void test_ok (const charT*, const Traits*,
_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}"
View
2 tests/localization/22.locale.ctype.tolower.cpp
@@ -83,8 +83,6 @@ const char* locale_root;
"{zh-CN-*-{GB*,UTF-8,CP125?}}," \
"{ru-RU-*-{KOI*,UTF-8,CP125?}}}"
-const char* locale_list = 0;
-
#define BEGIN_LOCALE_LOOP(num, locname, loop_cntrl) \
const char* locale_list = rw_locale_query (LC_CTYPE, LOCALES); \
for (const char* locname = locale_list; \
View
2 tests/localization/22.locale.messages.cpp
@@ -376,7 +376,7 @@ open_catalog (const std::messages<charT> &msgs,
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))"
View
18 tests/localization/22.locale.messages.mt.cpp
@@ -375,13 +375,21 @@ run_test (int, char**)
try {
const std::locale loc (data.locale_name_);
- const std::messages<char>& nm =
- std::use_facet<std::messages<char> >(loc);
+ {
+ const std::messages<char>& nm =
+ std::use_facet<std::messages<char> >(loc);
-#ifdef _RWSTD_NO_WCHAR_T
+ _RWSTD_UNUSED (nm);
+ }
- const std::messages<wchar_t>& nm =
- std::use_facet<std::messages<wchar_t> >(loc);
+#ifndef _RWSTD_NO_WCHAR_T
+
+ {
+ const std::messages<wchar_t>& wm =
+ std::use_facet<std::messages<wchar_t> >(loc);
+
+ _RWSTD_UNUSED (wm);
+ }
#endif // _RWSTD_NO_WCHAR_T
View
12 tests/localization/22.locale.money.get.cpp
@@ -361,7 +361,7 @@ void do_test (bool intl, // international?
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 @@ void do_test (bool intl, // international?
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 @@ void do_test (bool intl, // international?
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, ..., "
View
6 tests/localization/22.locale.num.get.cpp
@@ -380,7 +380,7 @@ int do_test (int lineno, // line number
// 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 @@ int do_test (int lineno, // line number
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;
View
2 tests/localization/22.locale.num.put.cpp
@@ -419,7 +419,7 @@ void do_test (charT /* dummy */,
|| '+' == 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
View
4 tests/localization/22.locale.numpunct.cpp
@@ -224,8 +224,8 @@ bool check_numpunct (charT,
// 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);
View
2 tests/localization/22.locale.statics.mt.cpp
@@ -93,7 +93,7 @@ test_classic (void*)
static void*
test_global (void*)
{
- for (std::size_t i = 0; i != opt_nloops; ++i) {
+ for (std::size_t i = 0; i != std::size_t (opt_nloops); ++i) {
if (rw_thread_pool_timeout_expired ())
break;
View
2 tests/localization/22.locale.time.get.cpp
@@ -89,7 +89,7 @@ void do_test (int lineno, charT, const char *cname,
_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(),
View
6 tests/numerics/26.c.math.cpp
@@ -208,7 +208,7 @@ test_behavior ()
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 @@ test_behavior ()
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 @@ test_behavior ()
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",
View
2 tests/regress/21.string.append.stdcxx-438.cpp
@@ -40,7 +40,7 @@ void* operator new (std::size_t n) throw (std::bad_alloc)
{
void* const ptr = std::malloc (n + sizeof n);
if (!ptr)
- return 0;
+ throw std::bad_alloc ();
std::memset (ptr, -1, n);
*(std::size_t*)ptr = n;
View
8 tests/regress/21.string.replace.stdcxx-175.cpp
@@ -28,17 +28,15 @@
#include <string>
#include <stdexcept>
-int main (int argc, char* argv [])
+int main ()
{
std::string s (4095, 'a');
- try
- {
+ try {
s.replace (0, 1, "a", s.max_size () + 1);
assert (!"Expect length error, got nothing");
}
- catch (std::length_error& e)
- {
+ catch (std::length_error&) {
}
return 0;
View
2 tests/regress/21.string.stdcxx-466.cpp
@@ -27,7 +27,7 @@
#include <cassert>
#include <string>
-int main (int argc, char* argv[])
+int main ()
{
std::string s ("efgh");
View
4 tests/regress/22.locale.messages.stdcxx-542.cpp
@@ -65,7 +65,7 @@ static int run_test (int, char**)
messagesT::catalog cats [4];
- int i;
+ std::size_t i;
// test STDCXX-508
for (i = 0; i < sizeof (cats) / sizeof (*cats); ++i) {
@@ -74,7 +74,7 @@ static int run_test (int, char**)
}
// test STDCXX-542
- for (--i; i >= 0; --i)
+ while (i-- > 0)
msgs.close (cats [i]);
std::remove (CATALOG CAT_EXT);
View
3 tests/regress/23.list.cons.stdcxx-268.cpp
@@ -51,7 +51,8 @@ class ListItem
int ListItem::count_ = 0;
-int main(int argc, char* argv[])
+
+int main ()
{
typedef std::list<ListItem> List;
ListItem items [20];
View
3 tests/regress/23.list.insert.stdcxx-331.cpp
@@ -51,7 +51,8 @@ class ListItem
int ListItem::count_ = 0;
-int main (int argc, char* argv[])
+
+int main ()
{
typedef std::list<ListItem> List;
ListItem items [20];
View
7 tests/regress/23.list.special.stdcxx-334.cpp
@@ -32,17 +32,18 @@ class Alloc : public std::allocator <char>
{
};
-bool operator == (Alloc a1, Alloc a2)
+bool operator== (Alloc, Alloc)
{
return false;
}
-bool operator != (Alloc a1, Alloc a2)
+bool operator!= (Alloc, Alloc)
{
return true;
}
-int main(int argc, char* argv[])
+
+int main ()
{
const char src [] = "source string";
const char dst [] = "destination string";
View
23 tests/regress/23.set.stdcxx-216.cpp
@@ -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.
*
**************************************************************************/
@@ -33,15 +33,15 @@ struct Value
{
static const unsigned magic = 0x12344321;
- Value (unsigned value = 0)
- : value (value)
- , valid (magic)
+ Value (unsigned val = 0)
+ : value (val),
+ valid (magic)
{
}
Value (const Value& key)
- : value (key.value)
- , valid (key.magic)
+ : value (key.value),
+ valid (key.magic)
{
}
@@ -89,17 +89,6 @@ struct Value
unsigned valid;
};
-//#include <iostream>
-//
-//void dump (const std::set<Value>& s)
-//{
-// std::set<Value>::const_iterator b = s.begin ();
-// std::set<Value>::const_iterator e = s.end ();
-//
-// for (/**/; b != e; ++b)
-// std::cout << b->value << ' ';
-// std::cout << std::endl;
-//}
int main ()
{
View
3 tests/regress/23.vector.stdcxx-1037.cpp
@@ -42,7 +42,8 @@ struct Alloc : std::allocator<T>
};
template <typename U>
- Alloc (const Alloc<U>& other) : std::allocator (other), i_ (other.i_) { }
+ Alloc (const Alloc<U>& other)
+ : std::allocator<T>(other), i_ (other.i_) { }
template <typename U>
Alloc& operator= (const Alloc<U>& other)
View
2 tests/self/0.fnmatch.cpp
@@ -48,7 +48,7 @@ test (int line, int exp, const char *pat, const char *str)
const int native = exp;
#endif // FNMATCH
- if (result != native || -1 < exp && result != exp) {
+ if (result != native || (-1 < exp && result != exp)) {
++nerrors;
View
5 tests/src/23.containers.cpp
@@ -298,9 +298,10 @@ _rw_sigcat (char **pbuf, size_t *pbufsize,
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 {
View
10 tests/src/char.cpp
@@ -332,21 +332,21 @@ lt (const char_type &c1, const char_type &c2)
{
++n_calls_ [MemFun::lt];
- return c1.f < c2.f || c1.f == c2.f && c1.c < c2.c;
+ return c1.f < c2.f || (c1.f == c2.f && c1.c < c2.c);
}
int UserTraits<UserChar>::
compare (const char_type *s1, const char_type *s2, size_t n)
{
- RW_ASSERT (0 == n || s1 && s2);
+ RW_ASSERT (0 == n || (s1 && s2));
++n_calls_ [MemFun::compare];
for (size_t i = 0; i != n; ++i) {
if (s1 [i].f != s2 [i].f || s1 [i].c != s2 [i].c) {
if ( s1 [i].f < s2 [i].f
- || s1 [i].f == s2 [i].f && s1 [i].c < s2 [i].c)
+ || (s1 [i].f == s2 [i].f && s1 [i].c < s2 [i].c))
return -1;
return 1;
@@ -393,7 +393,7 @@ UserTraits<UserChar>::char_type*
UserTraits<UserChar>::
copy (char_type *dst, const char_type *src, size_t n)
{
- RW_ASSERT (0 == n || dst && src);
+ RW_ASSERT (0 == n || (dst && src));
++n_calls_ [MemFun::copy];
@@ -408,7 +408,7 @@ UserTraits<UserChar>::char_type*
UserTraits<UserChar>::
move (char_type *dst, const char_type *src, size_t n)
{
- RW_ASSERT (0 == n || dst && src);
+ RW_ASSERT (0 == n || (dst && src));
++n_calls_ [MemFun::move];
View
16 tests/src/cmdopt.cpp
@@ -121,8 +121,8 @@ _rw_print_help (int argc, char *argv[])
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 @@ _rw_getbounds (const char *next, char sep, RW_VA_LIST_ARG_PTR pva)
if ( '*' == *next
|| '+' == *next
- || val < 0 && '-' == *next
+ || (val < 0 && '-' == *next)
|| isdigit (*next)) {
end = 0;
@@ -991,11 +991,11 @@ rw_runopts (int argc, char *argv[])
// 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;
View
4 tests/src/locale.cpp
@@ -676,7 +676,7 @@ rw_get_wchars (wchar_t *wbuf, size_t bufsize, int nbytes /* = 0 */)
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 @@ rw_get_wchars (wchar_t *wbuf, size_t bufsize, int nbytes /* = 0 */)
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;
View
2 tests/src/opt_lines.cpp
@@ -130,7 +130,7 @@ _rw_enable_line (int argc, char *argv[], int flags)
// 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]);
View
2 tests/src/opt_trace.cpp
@@ -115,7 +115,7 @@ _rw_setopt_trace_mask (int argc, char *argv[])
// 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]);
View
9 tests/src/printf.cpp
@@ -2232,7 +2232,7 @@ _rw_fmtstrarray (FmtSpec *pspec, size_t paramno, Buffer &buf,
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 @@ _rw_vasnprintf_ext (FmtSpec *pspec,
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 @@ rw_sprintfa (const char *fmt, ...)
// 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);
View
6 tests/strings/21.string.compare.cpp
@@ -800,9 +800,9 @@ void test_compare (charT, Traits*, Allocator*,
}
// 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",
View
4 tests/strings/21.string.io.cpp
@@ -1141,8 +1141,8 @@ void test_io (charT*, Traits*, Allocator*,
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;
View
4 tests/support/18.numeric.special.float.cpp
@@ -1259,8 +1259,8 @@ void test_limits (FloatT, const char *tname, const char *fmt)
_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 ()); \
View
4 util/collate.cpp
@@ -151,8 +151,8 @@ unsigned int Def::process_order_stmt (collate_section_t& section)
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;
View
10 util/exec.cpp
@@ -550,8 +550,9 @@ wait_for_child (pid_t child_pid, int timeout, struct target_status* result)
else if (WIFCONTINUED (status))
stopped = 0;
#endif
- else
- ; /* huh? */
+ else {
+ /* huh? */
+ }
}
else if ((pid_t)-1 == wait_pid) {
if (EINTR == errno && alarm_timeout) {
@@ -619,8 +620,9 @@ wait_for_child (pid_t child_pid, int timeout, struct target_status* result)
if (waitopts)
/* bad waitpid options, reset to 0 and try again */
waitopts = 0;
- else
- ; /* Now what? */
+ else {
+ /* Now what? */
+ }
}
else if (ECHILD == errno) {
/* should not happen */
View
2 util/locale.cpp
@@ -865,8 +865,6 @@ write_coll_info (const std::string &ch, unsigned int idx,
if (n_cmap2_it != cmap->get_mb_cmap().end())
std::cout << cmap->get_rw_cmap().find(
n_cmap2_it->second)->second;
- else
- ;
}
else {
for (unsigned int j = 0; j < idx; j++) {

0 comments on commit 79e6bcd

Please sign in to comment.