From owner-svn-src-all@FreeBSD.ORG Tue Oct 23 18:45:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FF5E648; Tue, 23 Oct 2012 18:45:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D09C8FC08; Tue, 23 Oct 2012 18:45:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NIjXU9032647; Tue, 23 Oct 2012 18:45:33 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NIjWPZ032640; Tue, 23 Oct 2012 18:45:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201210231845.q9NIjWPZ032640@svn.freebsd.org> From: Dimitry Andric Date: Tue, 23 Oct 2012 18:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241959 - in head/contrib/libstdc++: include/debug include/ext libsupc++ src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 18:45:33 -0000 Author: dim Date: Tue Oct 23 18:45:32 2012 New Revision: 241959 URL: http://svn.freebsd.org/changeset/base/241959 Log: 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 Modified: head/contrib/libstdc++/include/debug/safe_iterator.tcc head/contrib/libstdc++/include/ext/ropeimpl.h head/contrib/libstdc++/libsupc++/tinfo.cc head/contrib/libstdc++/src/locale.cc head/contrib/libstdc++/src/strstream.cc head/contrib/libstdc++/src/tree.cc Modified: head/contrib/libstdc++/include/debug/safe_iterator.tcc ============================================================================== --- head/contrib/libstdc++/include/debug/safe_iterator.tcc Tue Oct 23 18:38:04 2012 (r241958) +++ head/contrib/libstdc++/include/debug/safe_iterator.tcc Tue Oct 23 18:45:32 2012 (r241959) @@ -54,8 +54,8 @@ namespace __gnu_debug static_cast(_M_sequence)->begin(); std::pair __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(_M_sequence)->end(); std::pair __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; } } Modified: head/contrib/libstdc++/include/ext/ropeimpl.h ============================================================================== --- head/contrib/libstdc++/include/ext/ropeimpl.h Tue Oct 23 18:38:04 2012 (r241958) +++ head/contrib/libstdc++/include/ext/ropeimpl.h Tue Oct 23 18:45:32 2012 (r241959) @@ -1143,7 +1143,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) } else { - char* __kind; + const char* __kind; switch (__r->_M_tag) { Modified: head/contrib/libstdc++/libsupc++/tinfo.cc ============================================================================== --- head/contrib/libstdc++/libsupc++/tinfo.cc Tue Oct 23 18:38:04 2012 (r241958) +++ head/contrib/libstdc++/libsupc++/tinfo.cc Tue Oct 23 18:45:32 2012 (r241959) @@ -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 Modified: head/contrib/libstdc++/src/locale.cc ============================================================================== --- head/contrib/libstdc++/src/locale.cc Tue Oct 23 18:38:04 2012 (r241958) +++ head/contrib/libstdc++/src/locale.cc Tue Oct 23 18:45:32 2012 (r241959) @@ -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 { Modified: head/contrib/libstdc++/src/strstream.cc ============================================================================== --- head/contrib/libstdc++/src/strstream.cc Tue Oct 23 18:38:04 2012 (r241958) +++ head/contrib/libstdc++/src/strstream.cc Tue Oct 23 18:45:32 2012 (r241959) @@ -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 Modified: head/contrib/libstdc++/src/tree.cc ============================================================================== --- head/contrib/libstdc++/src/tree.cc Tue Oct 23 18:38:04 2012 (r241958) +++ head/contrib/libstdc++/src/tree.cc Tue Oct 23 18:45:32 2012 (r241959) @@ -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) {