Commit 880b527f by Benjamin Kosnik

revert: compatibility.cc: Make C++0x safe, add in explicit casts to bool for stream sentry objects.

2009-09-04  Benjamin Kosnik  <bkoz@redhat.com>

	Revert.
	2009-08-06  Benjamin Kosnik  <bkoz@redhat.com>
	* src/compatibility.cc: Make C++0x safe, add in explicit casts to
	bool for stream sentry objects.
	* include/bits/istream.tcc: Same.
	* include/bits/ostream.tcc: Same.
	* include/bits/basic_string.tcc: Same.
	* include/bits/ostream_insert.h: Same.
	* src/istream.cc: Same.

From-SVN: r151445
parent e8fc61f7
2009-09-04 Benjamin Kosnik <bkoz@redhat.com>
Revert.
2009-08-06 Benjamin Kosnik <bkoz@redhat.com>
* src/compatibility.cc: Make C++0x safe, add in explicit casts to
bool for stream sentry objects.
* include/bits/istream.tcc: Same.
* include/bits/ostream.tcc: Same.
* include/bits/basic_string.tcc: Same.
* include/bits/ostream_insert.h: Same.
* src/istream.cc: Same.
2009-09-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 2009-09-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure.ac: Replace AC_CONFIG_COMMANDS([default]) * configure.ac: Replace AC_CONFIG_COMMANDS([default])
......
...@@ -1007,7 +1007,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -1007,7 +1007,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__size_type __extracted = 0; __size_type __extracted = 0;
typename __ios_base::iostate __err = __ios_base::goodbit; typename __ios_base::iostate __err = __ios_base::goodbit;
typename __istream_type::sentry __cerb(__in, false); typename __istream_type::sentry __cerb(__in, false);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -1078,7 +1078,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -1078,7 +1078,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __size_type __n = __str.max_size(); const __size_type __n = __str.max_size();
typename __ios_base::iostate __err = __ios_base::goodbit; typename __ios_base::iostate __err = __ios_base::goodbit;
typename __istream_type::sentry __cerb(__in, true); typename __istream_type::sentry __cerb(__in, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
......
...@@ -87,7 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -87,7 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_extract(_ValueT& __v) _M_extract(_ValueT& __v)
{ {
sentry __cerb(*this, false); sentry __cerb(*this, false);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions. // 118. basic_istream uses nonexistent num_get member functions.
sentry __cerb(*this, false); sentry __cerb(*this, false);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -161,7 +161,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -161,7 +161,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions. // 118. basic_istream uses nonexistent num_get member functions.
sentry __cerb(*this, false); sentry __cerb(*this, false);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -205,7 +205,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -205,7 +205,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, false); sentry __cerb(*this, false);
if (__sbout && static_cast<bool>(__cerb)) if (__cerb && __sbout)
{ {
__try __try
{ {
...@@ -240,7 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -240,7 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -274,7 +274,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -274,7 +274,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -311,7 +311,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -311,7 +311,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -358,7 +358,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -358,7 +358,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -402,7 +402,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -402,7 +402,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -461,7 +461,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -461,7 +461,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ {
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -494,7 +494,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -494,7 +494,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ {
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (__n > 0 && static_cast<bool>(__cerb)) if (__cerb && __n > 0)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -556,7 +556,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -556,7 +556,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ {
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (__n > 0 && static_cast<bool>(__cerb)) if (__cerb && __n > 0)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -622,7 +622,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -622,7 +622,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
int_type __c = traits_type::eof(); int_type __c = traits_type::eof();
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -651,7 +651,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -651,7 +651,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ {
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -680,7 +680,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -680,7 +680,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ {
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -714,7 +714,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -714,7 +714,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// 60. What is a formatted input function? // 60. What is a formatted input function?
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -747,7 +747,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -747,7 +747,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// 60. What is a formatted input function? // 60. What is a formatted input function?
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -780,7 +780,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -780,7 +780,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// DR60. Do not change _M_gcount. // DR60. Do not change _M_gcount.
int __ret = -1; int __ret = -1;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -906,7 +906,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -906,7 +906,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typedef typename __istream_type::int_type __int_type; typedef typename __istream_type::int_type __int_type;
typename __istream_type::sentry __cerb(__in, false); typename __istream_type::sentry __cerb(__in, false);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -943,7 +943,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -943,7 +943,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
streamsize __extracted = 0; streamsize __extracted = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
typename __istream_type::sentry __cerb(__in, false); typename __istream_type::sentry __cerb(__in, false);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
......
...@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_insert(_ValueT __v) _M_insert(_ValueT __v)
{ {
sentry __cerb(*this); sentry __cerb(*this);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -121,7 +121,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -121,7 +121,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this); sentry __cerb(*this);
if (__sbin && static_cast<bool>(__cerb)) if (__cerb && __sbin)
{ {
__try __try
{ {
...@@ -155,7 +155,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -155,7 +155,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Unformatted output functions should catch exceptions thrown // Unformatted output functions should catch exceptions thrown
// from streambuf members. // from streambuf members.
sentry __cerb(*this); sentry __cerb(*this);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Unformatted output functions should catch exceptions thrown // Unformatted output functions should catch exceptions thrown
// from streambuf members. // from streambuf members.
sentry __cerb(*this); sentry __cerb(*this);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ _M_write(__s, __n); } { _M_write(__s, __n); }
......
...@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typedef typename __ostream_type::ios_base __ios_base; typedef typename __ostream_type::ios_base __ios_base;
typename __ostream_type::sentry __cerb(__out); typename __ostream_type::sentry __cerb(__out);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
......
...@@ -62,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -62,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (__n > 0 && static_cast<bool>(__cerb)) if ( __n > 0 && __cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (__n > 0 && static_cast<bool>(__cerb)) if (__n > 0 && __cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
......
...@@ -39,7 +39,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -39,7 +39,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (__n > 0 && static_cast<bool>(__cerb)) if (__n > 0 && __cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -205,7 +205,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -205,7 +205,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
streamsize __extracted = 0; streamsize __extracted = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__istream_type::sentry __cerb(__in, false); __istream_type::sentry __cerb(__in, false);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -288,7 +288,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -288,7 +288,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__size_type __extracted = 0; __size_type __extracted = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__istream_type::sentry __cerb(__in, false); __istream_type::sentry __cerb(__in, false);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -370,7 +370,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -370,7 +370,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __size_type __n = __str.max_size(); const __size_type __n = __str.max_size();
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__istream_type::sentry __cerb(__in, true); __istream_type::sentry __cerb(__in, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -446,7 +446,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -446,7 +446,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
...@@ -523,7 +523,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -523,7 +523,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0; _M_gcount = 0;
sentry __cerb(*this, true); sentry __cerb(*this, true);
if (__n > 0 && static_cast<bool>(__cerb)) if (__n > 0 && __cerb)
{ {
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__try __try
...@@ -616,7 +616,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -616,7 +616,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __size_type __n = __str.max_size(); const __size_type __n = __str.max_size();
ios_base::iostate __err = ios_base::goodbit; ios_base::iostate __err = ios_base::goodbit;
__istream_type::sentry __cerb(__in, true); __istream_type::sentry __cerb(__in, true);
if (static_cast<bool>(__cerb)) if (__cerb)
{ {
__try __try
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment