summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-10-23 18:36:07 +0000
committerdim <dim@FreeBSD.org>2012-10-23 18:36:07 +0000
commit65bdd05e47f047230b192c0f69850969adf5f11c (patch)
tree0a6f19f4ed8dc9b374ff6250e129cc27049157c9
parente644f55413ad7bfbb96b57ea68459b71bdbeae29 (diff)
downloadFreeBSD-src-65bdd05e47f047230b192c0f69850969adf5f11c.zip
FreeBSD-src-65bdd05e47f047230b192c0f69850969adf5f11c.tar.gz
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
-rw-r--r--contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h3
-rw-r--r--contrib/libstdc++/include/bits/fstream.tcc32
-rw-r--r--contrib/libstdc++/include/bits/locale_facets.h3
-rw-r--r--contrib/libstdc++/include/bits/locale_facets.tcc28
-rw-r--r--contrib/libstdc++/include/bits/streambuf_iterator.h2
-rw-r--r--contrib/libstdc++/include/std/std_sstream.h10
6 files changed, 44 insertions, 34 deletions
diff --git a/contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h b/contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h
index 56411ca..9366032 100644
--- a/contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h
+++ b/contrib/libstdc++/config/os/bsd/freebsd/ctype_base.h
@@ -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;
diff --git a/contrib/libstdc++/include/bits/fstream.tcc b/contrib/libstdc++/include/bits/fstream.tcc
index ea097c6..7b6f09b 100644
--- a/contrib/libstdc++/include/bits/fstream.tcc
+++ b/contrib/libstdc++/include/bits/fstream.tcc
@@ -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;
}
diff --git a/contrib/libstdc++/include/bits/locale_facets.h b/contrib/libstdc++/include/bits/locale_facets.h
index e31ae17..b38033d 100644
--- a/contrib/libstdc++/include/bits/locale_facets.h
+++ b/contrib/libstdc++/include/bits/locale_facets.h
@@ -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;
};
diff --git a/contrib/libstdc++/include/bits/locale_facets.tcc b/contrib/libstdc++/include/bits/locale_facets.tcc
index e8b9fd2..2d39f20 100644
--- a/contrib/libstdc++/include/bits/locale_facets.tcc
+++ b/contrib/libstdc++/include/bits/locale_facets.tcc
@@ -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;
diff --git a/contrib/libstdc++/include/bits/streambuf_iterator.h b/contrib/libstdc++/include/bits/streambuf_iterator.h
index a1cf234..c743bb3 100644
--- a/contrib/libstdc++/include/bits/streambuf_iterator.h
+++ b/contrib/libstdc++/include/bits/streambuf_iterator.h
@@ -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:
diff --git a/contrib/libstdc++/include/std/std_sstream.h b/contrib/libstdc++/include/std/std_sstream.h
index a09815c..5ca2781 100644
--- a/contrib/libstdc++/include/std/std_sstream.h
+++ b/contrib/libstdc++/include/std/std_sstream.h
@@ -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());
+ }
}
};
OpenPOWER on IntegriCloud