summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-10-23 18:45:32 +0000
committerdim <dim@FreeBSD.org>2012-10-23 18:45:32 +0000
commit99da76dc3d08b3012a3cf73037a072d9467d541f (patch)
tree226d9f42be774a1f218b861d3d044261e31f78a6
parente1bc3b4134d3444ad6395eda2a2cf360b58be705 (diff)
downloadFreeBSD-src-99da76dc3d08b3012a3cf73037a072d9467d541f.zip
FreeBSD-src-99da76dc3d08b3012a3cf73037a072d9467d541f.tar.gz
Fix a number of other clang warnings in libstdc++, which could appear
when building other C++ software with it. Also fix one actual bug in libsupc++, which was exposed by such a warning. This latter fix is the only functional change. MFC after: 1 week
-rw-r--r--contrib/libstdc++/include/debug/safe_iterator.tcc8
-rw-r--r--contrib/libstdc++/include/ext/ropeimpl.h2
-rw-r--r--contrib/libstdc++/libsupc++/tinfo.cc6
-rw-r--r--contrib/libstdc++/src/locale.cc2
-rw-r--r--contrib/libstdc++/src/strstream.cc10
-rw-r--r--contrib/libstdc++/src/tree.cc24
6 files changed, 29 insertions, 23 deletions
diff --git a/contrib/libstdc++/include/debug/safe_iterator.tcc b/contrib/libstdc++/include/debug/safe_iterator.tcc
index d23e90f..2293d5d 100644
--- a/contrib/libstdc++/include/debug/safe_iterator.tcc
+++ b/contrib/libstdc++/include/debug/safe_iterator.tcc
@@ -54,8 +54,8 @@ namespace __gnu_debug
static_cast<const _Sequence*>(_M_sequence)->begin();
std::pair<difference_type, _Distance_precision> __dist =
this->_M_get_distance(__begin, *this);
- bool __ok = (__dist.second == __dp_exact && __dist.first >= -__n
- || __dist.second != __dp_exact && __dist.first > 0);
+ bool __ok = ((__dist.second == __dp_exact && __dist.first >= -__n)
+ || (__dist.second != __dp_exact && __dist.first > 0));
return __ok;
}
else
@@ -64,8 +64,8 @@ namespace __gnu_debug
static_cast<const _Sequence*>(_M_sequence)->end();
std::pair<difference_type, _Distance_precision> __dist =
this->_M_get_distance(*this, __end);
- bool __ok = (__dist.second == __dp_exact && __dist.first >= __n
- || __dist.second != __dp_exact && __dist.first > 0);
+ bool __ok = ((__dist.second == __dp_exact && __dist.first >= __n)
+ || (__dist.second != __dp_exact && __dist.first > 0));
return __ok;
}
}
diff --git a/contrib/libstdc++/include/ext/ropeimpl.h b/contrib/libstdc++/include/ext/ropeimpl.h
index 28c0b1f..44d1dd0 100644
--- a/contrib/libstdc++/include/ext/ropeimpl.h
+++ b/contrib/libstdc++/include/ext/ropeimpl.h
@@ -1143,7 +1143,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
else
{
- char* __kind;
+ const char* __kind;
switch (__r->_M_tag)
{
diff --git a/contrib/libstdc++/libsupc++/tinfo.cc b/contrib/libstdc++/libsupc++/tinfo.cc
index e93ccbe..3b6260f 100644
--- a/contrib/libstdc++/libsupc++/tinfo.cc
+++ b/contrib/libstdc++/libsupc++/tinfo.cc
@@ -499,9 +499,9 @@ __do_dyncast (ptrdiff_t src2dst,
result.whole2dst =
__sub_kind (result.whole2dst | result2.whole2dst);
}
- else if ((result.dst_ptr != 0 & result2.dst_ptr != 0)
- || (result.dst_ptr != 0 & result2_ambig)
- || (result2.dst_ptr != 0 & result_ambig))
+ else if ((result.dst_ptr != 0 && result2.dst_ptr != 0)
+ || (result.dst_ptr != 0 && result2_ambig)
+ || (result2.dst_ptr != 0 && result_ambig))
{
// Found two different DST_TYPE bases, or a valid one and a set of
// ambiguous ones, must disambiguate. See whether SRC_PTR is
diff --git a/contrib/libstdc++/src/locale.cc b/contrib/libstdc++/src/locale.cc
index 12070eb..a760994 100644
--- a/contrib/libstdc++/src/locale.cc
+++ b/contrib/libstdc++/src/locale.cc
@@ -146,7 +146,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
locale::_S_normalize_category(category __cat)
{
int __ret = 0;
- if (__cat == none || (__cat & all) && !(__cat & ~all))
+ if (__cat == none || ((__cat & all) && !(__cat & ~all)))
__ret = __cat;
else
{
diff --git a/contrib/libstdc++/src/strstream.cc b/contrib/libstdc++/src/strstream.cc
index 5bbb33a..f221454 100644
--- a/contrib/libstdc++/src/strstream.cc
+++ b/contrib/libstdc++/src/strstream.cc
@@ -311,10 +311,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
strstreambuf::_M_free(char* p)
{
if (p)
- if (_M_free_fun)
- _M_free_fun(p);
- else
- delete[] p;
+ {
+ if (_M_free_fun)
+ _M_free_fun(p);
+ else
+ delete[] p;
+ }
}
void
diff --git a/contrib/libstdc++/src/tree.cc b/contrib/libstdc++/src/tree.cc
index 38a3037..b23ca8e 100644
--- a/contrib/libstdc++/src/tree.cc
+++ b/contrib/libstdc++/src/tree.cc
@@ -316,17 +316,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
else
__z->_M_parent->_M_right = __x;
if (__leftmost == __z)
- if (__z->_M_right == 0) // __z->_M_left must be null also
- __leftmost = __z->_M_parent;
- // makes __leftmost == _M_header if __z == __root
- else
- __leftmost = _Rb_tree_node_base::_S_minimum(__x);
+ {
+ if (__z->_M_right == 0) // __z->_M_left must be null also
+ __leftmost = __z->_M_parent;
+ // makes __leftmost == _M_header if __z == __root
+ else
+ __leftmost = _Rb_tree_node_base::_S_minimum(__x);
+ }
if (__rightmost == __z)
- if (__z->_M_left == 0) // __z->_M_right must be null also
- __rightmost = __z->_M_parent;
- // makes __rightmost == _M_header if __z == __root
- else // __x == __z->_M_left
- __rightmost = _Rb_tree_node_base::_S_maximum(__x);
+ {
+ if (__z->_M_left == 0) // __z->_M_right must be null also
+ __rightmost = __z->_M_parent;
+ // makes __rightmost == _M_header if __z == __root
+ else // __x == __z->_M_left
+ __rightmost = _Rb_tree_node_base::_S_maximum(__x);
+ }
}
if (__y->_M_color != _S_red)
{
OpenPOWER on IntegriCloud