aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2009-08-06 19:33:33 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2009-08-06 19:33:33 +0000
commit21da6d0f102f64fa2965d25c0d3d367028c5272e (patch)
tree495603992158a7b3ad1228b7ad2ee93c34be95f3 /libstdc++-v3/src
parentde2aa20e758bdc2b520855b9a4dc1b344fb51b18 (diff)
downloadgcc-21da6d0f102f64fa2965d25c0d3d367028c5272e.zip
gcc-21da6d0f102f64fa2965d25c0d3d367028c5272e.tar.gz
gcc-21da6d0f102f64fa2965d25c0d3d367028c5272e.tar.bz2
compatibility.cc: Make C++0x safe, add in explicit casts to bool for stream sentry objects.
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: r150539
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/compatibility.cc4
-rw-r--r--libstdc++-v3/src/istream.cc18
2 files changed, 11 insertions, 11 deletions
diff --git a/libstdc++-v3/src/compatibility.cc b/libstdc++-v3/src/compatibility.cc
index 7343268..53d8e84 100644
--- a/libstdc++-v3/src/compatibility.cc
+++ b/libstdc++-v3/src/compatibility.cc
@@ -62,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0;
sentry __cerb(*this, true);
- if (__cerb && __n > 0)
+ if (__n > 0 && static_cast<bool>(__cerb))
{
ios_base::iostate __err = ios_base::goodbit;
__try
@@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0;
sentry __cerb(*this, true);
- if (__cerb && __n > 0)
+ if (__n > 0 && static_cast<bool>(__cerb))
{
ios_base::iostate __err = ios_base::goodbit;
__try
diff --git a/libstdc++-v3/src/istream.cc b/libstdc++-v3/src/istream.cc
index 7b7f0bf..0e7cbfb 100644
--- a/libstdc++-v3/src/istream.cc
+++ b/libstdc++-v3/src/istream.cc
@@ -39,7 +39,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true);
- if (__cerb)
+ if (static_cast<bool>(__cerb))
{
__try
{
@@ -116,12 +116,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0;
sentry __cerb(*this, true);
- if (__cerb && __n > 0)
+ if (__n > 0 && static_cast<bool>(__cerb))
{
ios_base::iostate __err = ios_base::goodbit;
__try
{
- const char_type __cdelim = traits_type::to_char_type(__delim);
+ const char_type __cdelim = traits_type::to_char_type(__delim);
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sgetc();
@@ -205,7 +205,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
streamsize __extracted = 0;
ios_base::iostate __err = ios_base::goodbit;
__istream_type::sentry __cerb(__in, false);
- if (__cerb)
+ if (static_cast<bool>(__cerb))
{
__try
{
@@ -288,7 +288,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__size_type __extracted = 0;
ios_base::iostate __err = ios_base::goodbit;
__istream_type::sentry __cerb(__in, false);
- if (__cerb)
+ if (static_cast<bool>(__cerb))
{
__try
{
@@ -370,7 +370,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __size_type __n = __str.max_size();
ios_base::iostate __err = ios_base::goodbit;
__istream_type::sentry __cerb(__in, true);
- if (__cerb)
+ if (static_cast<bool>(__cerb))
{
__try
{
@@ -446,7 +446,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0;
ios_base::iostate __err = ios_base::goodbit;
sentry __cerb(*this, true);
- if (__cerb)
+ if (static_cast<bool>(__cerb))
{
__try
{
@@ -523,7 +523,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_gcount = 0;
sentry __cerb(*this, true);
- if (__cerb && __n > 0)
+ if (__n > 0 && static_cast<bool>(__cerb))
{
ios_base::iostate __err = ios_base::goodbit;
__try
@@ -616,7 +616,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __size_type __n = __str.max_size();
ios_base::iostate __err = ios_base::goodbit;
__istream_type::sentry __cerb(__in, true);
- if (__cerb)
+ if (static_cast<bool>(__cerb))
{
__try
{