Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2012 18:36:07 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241957 - in head/contrib/libstdc++: config/os/bsd/freebsd include/bits include/std
Message-ID:  <201210231836.q9NIa7wa031007@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Tue Oct 23 18:36:07 2012
New Revision: 241957
URL: http://svn.freebsd.org/changeset/base/241957

Log:
  Fix several clang warnings in libstdc++, which were exposed by the
  recent atf import.  These changes are purely cosmetic, no functional
  change.
  
  MFC after:	1 week

Modified:
  head/contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h
  head/contrib/libstdc++/include/bits/fstream.tcc
  head/contrib/libstdc++/include/bits/locale_facets.h
  head/contrib/libstdc++/include/bits/locale_facets.tcc
  head/contrib/libstdc++/include/bits/streambuf_iterator.h
  head/contrib/libstdc++/include/std/std_sstream.h

Modified: head/contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h
==============================================================================
--- head/contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h	Tue Oct 23 17:53:20 2012	(r241956)
+++ head/contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h	Tue Oct 23 18:36:07 2012	(r241957)
@@ -38,8 +38,9 @@
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
   /// @brief  Base class for ctype.
-  struct ctype_base
+  class ctype_base
   {
+  public:
     // Non-standard typedefs.
     typedef const int* 		__to_type;
 

Modified: head/contrib/libstdc++/include/bits/fstream.tcc
==============================================================================
--- head/contrib/libstdc++/include/bits/fstream.tcc	Tue Oct 23 17:53:20 2012	(r241956)
+++ head/contrib/libstdc++/include/bits/fstream.tcc	Tue Oct 23 18:36:07 2012	(r241957)
@@ -641,21 +641,23 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     setbuf(char_type* __s, streamsize __n)
     {
       if (!this->is_open())
-	if (__s == 0 && __n == 0)
-	  _M_buf_size = 1;
-	else if (__s && __n > 0)
-	  {
-	    // This is implementation-defined behavior, and assumes that
-	    // an external char_type array of length __n exists and has
-	    // been pre-allocated. If this is not the case, things will
-	    // quickly blow up. When __n > 1, __n - 1 positions will be
-	    // used for the get area, __n - 1 for the put area and 1
-	    // position to host the overflow char of a full put area.
-	    // When __n == 1, 1 position will be used for the get area
-	    // and 0 for the put area, as in the unbuffered case above.
-	    _M_buf = __s;
-	    _M_buf_size = __n;
-	  }
+	{
+	  if (__s == 0 && __n == 0)
+	    _M_buf_size = 1;
+	  else if (__s && __n > 0)
+	    {
+	      // This is implementation-defined behavior, and assumes that
+	      // an external char_type array of length __n exists and has
+	      // been pre-allocated. If this is not the case, things will
+	      // quickly blow up. When __n > 1, __n - 1 positions will be
+	      // used for the get area, __n - 1 for the put area and 1
+	      // position to host the overflow char of a full put area.
+	      // When __n == 1, 1 position will be used for the get area
+	      // and 0 for the put area, as in the unbuffered case above.
+	      _M_buf = __s;
+	      _M_buf_size = __n;
+	    }
+	}
       return this;
     }
 

Modified: head/contrib/libstdc++/include/bits/locale_facets.h
==============================================================================
--- head/contrib/libstdc++/include/bits/locale_facets.h	Tue Oct 23 17:53:20 2012	(r241956)
+++ head/contrib/libstdc++/include/bits/locale_facets.h	Tue Oct 23 18:36:07 2012	(r241957)
@@ -4335,8 +4335,9 @@ _GLIBCXX_END_LDBL_NAMESPACE
   /**
    *  @brief  Messages facet base class providing catalog typedef.
    */
-  struct messages_base
+  class messages_base
   {
+  public:
     typedef int catalog;
   };
 

Modified: head/contrib/libstdc++/include/bits/locale_facets.tcc
==============================================================================
--- head/contrib/libstdc++/include/bits/locale_facets.tcc	Tue Oct 23 17:53:20 2012	(r241956)
+++ head/contrib/libstdc++/include/bits/locale_facets.tcc	Tue Oct 23 18:36:07 2012	(r241957)
@@ -316,7 +316,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
       int __sep_pos = 0;
       while (!__testeof)
 	{
-	  if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep
+	  if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
 	      || __c == __lc->_M_decimal_point)
 	    break;
 	  else if (__c == __lit[__num_base::_S_izero])
@@ -558,7 +558,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
 	int __sep_pos = 0;
 	while (!__testeof)
 	  {
-	    if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep
+	    if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
 		|| __c == __lc->_M_decimal_point)
 	      break;
 	    else if (__c == __lit[__num_base::_S_izero] 
@@ -748,16 +748,20 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
 	      const char_type __c = *__beg;
 
 	      if (__testf)
-		if (__n < __lc->_M_falsename_size)
-		  __testf = __c == __lc->_M_falsename[__n];
-		else
-		  break;
+		{
+		  if (__n < __lc->_M_falsename_size)
+		    __testf = __c == __lc->_M_falsename[__n];
+		  else
+		    break;
+		}
 
 	      if (__testt)
-		if (__n < __lc->_M_truename_size)
-		  __testt = __c == __lc->_M_truename[__n];
-		else
-		  break;
+		{
+		  if (__n < __lc->_M_truename_size)
+		    __testt = __c == __lc->_M_truename[__n];
+		  else
+		    break;
+		}
 
 	      if (!__testf && !__testt)
 		break;
@@ -1387,9 +1391,9 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
 					 == money_base::space)))
 		    || (__i == 2 && ((static_cast<part>(__p.field[3])
 				      == money_base::value)
-				     || __mandatory_sign
+				     || (__mandatory_sign
 				     && (static_cast<part>(__p.field[3])
-					 == money_base::sign))))
+					 == money_base::sign)))))
 		  {
 		    const size_type __len = __lc->_M_curr_symbol_size;
 		    size_type __j = 0;

Modified: head/contrib/libstdc++/include/bits/streambuf_iterator.h
==============================================================================
--- head/contrib/libstdc++/include/bits/streambuf_iterator.h	Tue Oct 23 17:53:20 2012	(r241956)
+++ head/contrib/libstdc++/include/bits/streambuf_iterator.h	Tue Oct 23 18:36:07 2012	(r241957)
@@ -160,7 +160,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       {
 	const bool __thiseof = _M_at_eof();
 	const bool __beof = __b._M_at_eof();
-	return (__thiseof && __beof || (!__thiseof && !__beof));
+	return ((__thiseof && __beof) || (!__thiseof && !__beof));
       }
 
     private:

Modified: head/contrib/libstdc++/include/std/std_sstream.h
==============================================================================
--- head/contrib/libstdc++/include/std/std_sstream.h	Tue Oct 23 17:53:20 2012	(r241956)
+++ head/contrib/libstdc++/include/std/std_sstream.h	Tue Oct 23 18:36:07 2012	(r241957)
@@ -240,10 +240,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       {
 	const bool __testin = _M_mode & ios_base::in;
 	if (this->pptr() && this->pptr() > this->egptr())
-	  if (__testin)
-	    this->setg(this->eback(), this->gptr(), this->pptr());
-	  else
-	    this->setg(this->pptr(), this->pptr(), this->pptr());
+	  {
+	    if (__testin)
+	      this->setg(this->eback(), this->gptr(), this->pptr());
+	    else
+	      this->setg(this->pptr(), this->pptr(), this->pptr());
+	  }
       }
     };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210231836.q9NIa7wa031007>