]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compatibility.cc: Make C++0x safe, add in explicit casts to bool for stream sentry...
authorBenjamin Kosnik <bkoz@redhat.com>
Thu, 6 Aug 2009 19:33:33 +0000 (19:33 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 6 Aug 2009 19:33:33 +0000 (19:33 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.tcc
libstdc++-v3/include/bits/istream.tcc
libstdc++-v3/include/bits/ostream.tcc
libstdc++-v3/include/bits/ostream_insert.h
libstdc++-v3/src/compatibility.cc
libstdc++-v3/src/istream.cc

index dafe95f6ce4bbbac4ff16a719033bd1c2a62d727..c668f538db177fb220038ae489feae92a02a2d97 100644 (file)
@@ -1,3 +1,13 @@
+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-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR libstdc++/15523
index d450a4717de8ff75e24b283f1fd60aeff7379987..10dea7563d8f61dda874b8aa944d70737fb3c8de 100644 (file)
@@ -1007,7 +1007,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       __size_type __extracted = 0;
       typename __ios_base::iostate __err = __ios_base::goodbit;
       typename __istream_type::sentry __cerb(__in, false);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          __try
            {
@@ -1078,7 +1078,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       const __size_type __n = __str.max_size();
       typename __ios_base::iostate __err = __ios_base::goodbit;
       typename __istream_type::sentry __cerb(__in, true);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          __try
            {
index d005f736f03d9b4e831bb2e2aa72684bf1f62258..6d1679d152fb6699d0d3364eab2ffe06a303bbf4 100644 (file)
@@ -87,7 +87,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       _M_extract(_ValueT& __v)
       {
        sentry __cerb(*this, false);
-       if (__cerb)
+       if (static_cast<bool>(__cerb))
          {
            ios_base::iostate __err = ios_base::goodbit;
            __try
@@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // 118. basic_istream uses nonexistent num_get member functions.
       sentry __cerb(*this, false);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -161,7 +161,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // 118. basic_istream uses nonexistent num_get member functions.
       sentry __cerb(*this, false);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -205,7 +205,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     {
       ios_base::iostate __err = ios_base::goodbit;
       sentry __cerb(*this, false);
-      if (__cerb && __sbout)
+      if (__sbout && static_cast<bool>(__cerb))
        {
          __try
            {
@@ -240,7 +240,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
            {
@@ -274,7 +274,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
            {
@@ -311,7 +311,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
            {
@@ -358,7 +358,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
            {
@@ -402,7 +402,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
             {
@@ -461,7 +461,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     {
       _M_gcount = 0;
       sentry __cerb(*this, true);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -494,7 +494,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
@@ -556,7 +556,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
@@ -622,7 +622,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       int_type __c = traits_type::eof();
       _M_gcount = 0;
       sentry __cerb(*this, true);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -651,7 +651,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     {
       _M_gcount = 0;
       sentry __cerb(*this, true);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -680,7 +680,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     {
       _M_gcount = 0;
       sentry __cerb(*this, true);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -714,7 +714,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       // 60. What is a formatted input function?
       _M_gcount = 0;
       sentry __cerb(*this, true);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -747,7 +747,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       // 60. What is a formatted input function?
       _M_gcount = 0;
       sentry __cerb(*this, true);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -780,7 +780,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       // DR60.  Do not change _M_gcount.
       int __ret = -1;
       sentry __cerb(*this, true);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -906,7 +906,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       typedef typename __istream_type::int_type         __int_type;
 
       typename __istream_type::sentry __cerb(__in, false);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -943,7 +943,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       streamsize __extracted = 0;
       ios_base::iostate __err = ios_base::goodbit;
       typename __istream_type::sentry __cerb(__in, false);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          __try
            {
index 1147212aa14648682aa053bf5389a4b8cd759fba..df68a57fa6108942566f89d271fc573179a3177a 100644 (file)
@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       _M_insert(_ValueT __v)
       {
        sentry __cerb(*this);
-       if (__cerb)
+       if (static_cast<bool>(__cerb))
          {
            ios_base::iostate __err = ios_base::goodbit;
            __try
@@ -121,7 +121,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     {
       ios_base::iostate __err = ios_base::goodbit;
       sentry __cerb(*this);
-      if (__cerb && __sbin)
+      if (__sbin && static_cast<bool>(__cerb))
        {
          __try
            {
@@ -155,7 +155,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       // Unformatted output functions should catch exceptions thrown
       // from streambuf members.
       sentry __cerb(*this);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          ios_base::iostate __err = ios_base::goodbit;
          __try
@@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       // Unformatted output functions should catch exceptions thrown
       // from streambuf members.
       sentry __cerb(*this);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          __try
            { _M_write(__s, __n); }
index e0017ee7cfd321add37c153e1ea00550f668746e..4fc52c86affdfd7c4c0ff6f5b00bce4ed2f2efb8 100644 (file)
@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       typedef typename __ostream_type::ios_base    __ios_base;
 
       typename __ostream_type::sentry __cerb(__out);
-      if (__cerb)
+      if (static_cast<bool>(__cerb))
        {
          __try
            {
index 73432681ecffa8cca5042006894eb8160b3aa9f7..53d8e84e4f26d45e9794549f039de084524c987a 100644 (file)
@@ -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
index 7b7f0bf927871eb08c857155d833633c702a2338..0e7cbfb90843dcc454e793a448c6b39636146801 100644 (file)
@@ -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
            {