diff options
author | Chris Gregory <czipperz@gmail.com> | 2016-04-29 16:11:43 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2016-04-29 17:11:43 +0100 |
commit | f92ab29ffac7b8012c4787be66a43c08923c3663 (patch) | |
tree | 6fc3bcf79e417c6b1b8b408b428be97042699596 /libstdc++-v3/src/c++98 | |
parent | 8960db319597b6efca5063e70a787fcc822129fe (diff) | |
download | gcc-f92ab29ffac7b8012c4787be66a43c08923c3663.zip gcc-f92ab29ffac7b8012c4787be66a43c08923c3663.tar.gz gcc-f92ab29ffac7b8012c4787be66a43c08923c3663.tar.bz2 |
Remove trailing whitespace from libstdc++-v3 files
2016-04-29 Chris Gregory <czipperz@gmail.com>
* config/*: Remove trailing whitespace.
* src/*: Likewise.
* testsuite/tr1/*: Likewise.
* testsuite/util/*: Likewise.
From-SVN: r235645
Diffstat (limited to 'libstdc++-v3/src/c++98')
26 files changed, 350 insertions, 350 deletions
diff --git a/libstdc++-v3/src/c++98/Makefile.am b/libstdc++-v3/src/c++98/Makefile.am index 21a1343..7e84002 100644 --- a/libstdc++-v3/src/c++98/Makefile.am +++ b/libstdc++-v3/src/c++98/Makefile.am @@ -23,7 +23,7 @@ include $(top_srcdir)/fragment.am # Convenience library for C++98 runtime. -noinst_LTLIBRARIES = libc++98convenience.la +noinst_LTLIBRARIES = libc++98convenience.la headers = @@ -209,7 +209,7 @@ concept-inst.o: concept-inst.cc $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $< # Use special rules for parallel mode compilation. -PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL +PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL parallel_settings.lo: parallel_settings.cc $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $< parallel_settings.o: parallel_settings.cc @@ -243,7 +243,7 @@ AM_MAKEFLAGS = \ # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to # attempt to infer which configuration to use. -# +# # The second tag argument, `--tag disable-shared` means that libtool # only compiles each source once, for static objects. In actuality, # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/Makefile.in index 3c3bbbd..931f879 100644 --- a/libstdc++-v3/src/c++98/Makefile.in +++ b/libstdc++-v3/src/c++98/Makefile.in @@ -347,7 +347,7 @@ WARN_CXXFLAGS = \ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS) # Convenience library for C++98 runtime. -noinst_LTLIBRARIES = libc++98convenience.la +noinst_LTLIBRARIES = libc++98convenience.la headers = @ENABLE_DUAL_ABI_TRUE@cow_string_host_sources = \ @ENABLE_DUAL_ABI_TRUE@ collate_members_cow.cc \ @@ -435,7 +435,7 @@ libc__98convenience_la_SOURCES = $(sources) GLIBCXX_INCLUDE_DIR = $(glibcxx_builddir)/include # Use special rules for parallel mode compilation. -PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL +PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually @@ -466,7 +466,7 @@ AM_MAKEFLAGS = \ # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to # attempt to infer which configuration to use. -# +# # The second tag argument, `--tag disable-shared` means that libtool # only compiles each source once, for static objects. In actuality, # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to diff --git a/libstdc++-v3/src/c++98/bitmap_allocator.cc b/libstdc++-v3/src/c++98/bitmap_allocator.cc index 9a1cc2a..ebda0e8 100644 --- a/libstdc++-v3/src/c++98/bitmap_allocator.cc +++ b/libstdc++-v3/src/c++98/bitmap_allocator.cc @@ -39,7 +39,7 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) template class __mini_vector<size_t*>; - template size_t** __lower_bound(size_t**, size_t**, size_t const&, + template size_t** __lower_bound(size_t**, size_t**, size_t const&, free_list::_LT_pointer_compare); _GLIBCXX_END_NAMESPACE_VERSION } @@ -56,7 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif const vector_type& __free_list = _M_get_free_list(); using __gnu_cxx::__detail::__lower_bound; - iterator __tmp = __lower_bound(__free_list.begin(), __free_list.end(), + iterator __tmp = __lower_bound(__free_list.begin(), __free_list.end(), __sz, _LT_pointer_compare()); if (__tmp == __free_list.end() || !_M_should_i_give(**__tmp, __sz)) diff --git a/libstdc++-v3/src/c++98/codecvt.cc b/libstdc++-v3/src/c++98/codecvt.cc index 02b7b95..5f56f04 100644 --- a/libstdc++-v3/src/c++98/codecvt.cc +++ b/libstdc++-v3/src/c++98/codecvt.cc @@ -31,7 +31,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for locale::id of standard facets that are specialized. locale::id codecvt<char, char, mbstate_t>::id; -#ifdef _GLIBCXX_USE_WCHAR_T +#ifdef _GLIBCXX_USE_WCHAR_T locale::id codecvt<wchar_t, char, mbstate_t>::id; #endif @@ -50,69 +50,69 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION codecvt<char, char, mbstate_t>:: ~codecvt() { _S_destroy_c_locale(_M_c_locale_codecvt); } - + codecvt_base::result codecvt<char, char, mbstate_t>:: - do_out(state_type&, const intern_type* __from, + do_out(state_type&, const intern_type* __from, const intern_type*, const intern_type*& __from_next, - extern_type* __to, extern_type*, + extern_type* __to, extern_type*, extern_type*& __to_next) const - { + { // _GLIBCXX_RESOLVE_LIB_DEFECTS // According to the resolution of DR19, "If returns noconv [...] // there are no changes to the values in [to, to_limit)." - __from_next = __from; + __from_next = __from; __to_next = __to; - return noconv; + return noconv; } - + codecvt_base::result codecvt<char, char, mbstate_t>:: do_unshift(state_type&, extern_type* __to, extern_type*, extern_type*& __to_next) const - { - __to_next = __to; - return noconv; + { + __to_next = __to; + return noconv; } - + codecvt_base::result codecvt<char, char, mbstate_t>:: - do_in(state_type&, const extern_type* __from, + do_in(state_type&, const extern_type* __from, const extern_type*, const extern_type*& __from_next, intern_type* __to, intern_type*, intern_type*& __to_next) const { // _GLIBCXX_RESOLVE_LIB_DEFECTS // According to the resolution of DR19, "If returns noconv [...] // there are no changes to the values in [to, to_limit)." - __from_next = __from; + __from_next = __from; __to_next = __to; - return noconv; + return noconv; } - int + int codecvt<char, char, mbstate_t>:: - do_encoding() const throw() + do_encoding() const throw() { return 1; } - - bool + + bool codecvt<char, char, mbstate_t>:: - do_always_noconv() const throw() + do_always_noconv() const throw() { return true; } - - int + + int codecvt<char, char, mbstate_t>:: do_length (state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const - { + { size_t __d = static_cast<size_t>(__end - __from); - return std::min(__max, __d); + return std::min(__max, __d); } - - int + + int codecvt<char, char, mbstate_t>:: - do_max_length() const throw() + do_max_length() const throw() { return 1; } - + #ifdef _GLIBCXX_USE_WCHAR_T // codecvt<wchar_t, char, mbstate_t> required specialization codecvt<wchar_t, char, mbstate_t>:: @@ -130,7 +130,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION codecvt<wchar_t, char, mbstate_t>:: ~codecvt() { _S_destroy_c_locale(_M_c_locale_codecvt); } - + codecvt_base::result codecvt<wchar_t, char, mbstate_t>:: do_unshift(state_type&, extern_type* __to, @@ -140,8 +140,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __to_next = __to; return noconv; } - - bool + + bool codecvt<wchar_t, char, mbstate_t>:: do_always_noconv() const throw() { return false; } diff --git a/libstdc++-v3/src/c++98/compatibility.cc b/libstdc++-v3/src/c++98/compatibility.cc index fb83eee..c434db1 100644 --- a/libstdc++-v3/src/c++98/compatibility.cc +++ b/libstdc++-v3/src/c++98/compatibility.cc @@ -62,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__n == 1) return ignore(); - + _M_gcount = 0; sentry __cerb(*this, true); if ( __n > 0 && __cerb) @@ -94,7 +94,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { ++_M_gcount; __c = __sb->snextc(); - } + } } if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max && !traits_type::eq_int_type(__c, __eof)) @@ -124,7 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION this->setstate(__err); } return *this; - } + } #ifdef _GLIBCXX_USE_WCHAR_T template<> @@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__n == 1) return ignore(); - + _M_gcount = 0; sentry __cerb(*this, true); if (__n > 0 && __cerb) @@ -296,7 +296,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // std::istream template basic_istream<char>& - basic_istream<char>::ignore(); + basic_istream<char>::ignore(); template bool @@ -332,7 +332,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template void - basic_string<wchar_t>::_M_check_length(size_t, size_t, + basic_string<wchar_t>::_M_check_length(size_t, size_t, const char*) const; template @@ -341,7 +341,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template basic_istream<wchar_t>& - basic_istream<wchar_t>::ignore(); + basic_istream<wchar_t>::ignore(); template bool @@ -396,7 +396,7 @@ _ZN10__gnu_norm15_List_node_base6unhookEv; _ZN10__gnu_norm15_List_node_base7reverseEv; _ZN10__gnu_norm15_List_node_base8transferEPS0_S1_; */ -#include "list.cc" +#include "list.cc" _GLIBCXX_ASM_SYMVER(_ZNSt8__detail17_List_node_baseXX7_M_hookEPS0_, \ _ZN10__gnu_norm15_List_node_base4hookEPS0_, \ GLIBCXX_3.4) @@ -419,7 +419,7 @@ GLIBCXX_3.4) #undef _List_node_base // gcc-4.1.0 -// Long double versions of "C" math functions. +// Long double versions of "C" math functions. #if defined (_GLIBCXX_LONG_DOUBLE_COMPAT) \ || (defined (__arm__) && defined (__linux__) && defined (__ARM_EABI__)) \ || (defined (__hppa__) && defined (__linux__)) \ diff --git a/libstdc++-v3/src/c++98/complex_io.cc b/libstdc++-v3/src/c++98/complex_io.cc index b878cc1..2306f61 100644 --- a/libstdc++-v3/src/c++98/complex_io.cc +++ b/libstdc++-v3/src/c++98/complex_io.cc @@ -34,7 +34,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template basic_ostream<char, char_traits<char> >& - operator<<(basic_ostream<char, char_traits<char> >&, + operator<<(basic_ostream<char, char_traits<char> >&, const complex<float>&); template @@ -43,12 +43,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template basic_ostream<char, char_traits<char> >& - operator<<(basic_ostream<char, char_traits<char> >&, + operator<<(basic_ostream<char, char_traits<char> >&, const complex<double>&); template basic_istream<char, char_traits<char> >& - operator>>(basic_istream<char, char_traits<char> >&, + operator>>(basic_istream<char, char_traits<char> >&, complex<long double>&); template diff --git a/libstdc++-v3/src/c++98/ext-inst.cc b/libstdc++-v3/src/c++98/ext-inst.cc index 1bee95e..4f181dd 100644 --- a/libstdc++-v3/src/c++98/ext-inst.cc +++ b/libstdc++-v3/src/c++98/ext-inst.cc @@ -38,7 +38,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } template - const unsigned long + const unsigned long rope<char, std::allocator<char> >::_S_min_len[min_len]; template @@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #ifdef _GLIBCXX_USE_WCHAR_T template - const unsigned long + const unsigned long rope<wchar_t, std::allocator<wchar_t> >::_S_min_len[min_len]; template diff --git a/libstdc++-v3/src/c++98/globals_io.cc b/libstdc++-v3/src/c++98/globals_io.cc index a1d63cd..ed1e32b 100644 --- a/libstdc++-v3/src/c++98/globals_io.cc +++ b/libstdc++-v3/src/c++98/globals_io.cc @@ -38,7 +38,7 @@ // NB: asm directives can rename these non-exported, namespace // __gnu_cxx symbols into exported, namespace std symbols with the // appropriate symbol version name. -// The rename syntax is +// The rename syntax is // asm (".symver currentname,oldname@@GLIBCXX_3.2") // In macro form: // _GLIBCXX_ASM_SYMVER(currentname, oldname, GLIBCXX_3.2) @@ -51,7 +51,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // NB: Iff <iostream> is included, these definitions become wonky. typedef char fake_istream[sizeof(istream)] __attribute__ ((aligned(__alignof__(istream)))); - typedef char fake_ostream[sizeof(ostream)] + typedef char fake_ostream[sizeof(ostream)] __attribute__ ((aligned(__alignof__(ostream)))); fake_istream cin; fake_ostream cout; @@ -59,9 +59,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION fake_ostream clog; #ifdef _GLIBCXX_USE_WCHAR_T - typedef char fake_wistream[sizeof(wistream)] + typedef char fake_wistream[sizeof(wistream)] __attribute__ ((aligned(__alignof__(wistream)))); - typedef char fake_wostream[sizeof(wostream)] + typedef char fake_wostream[sizeof(wostream)] __attribute__ ((aligned(__alignof__(wostream)))); fake_wistream wcin; fake_wostream wcout; diff --git a/libstdc++-v3/src/c++98/hash-long-double-tr1-aux.cc b/libstdc++-v3/src/c++98/hash-long-double-tr1-aux.cc index 9b38213..50cfe6f 100644 --- a/libstdc++-v3/src/c++98/hash-long-double-tr1-aux.cc +++ b/libstdc++-v3/src/c++98/hash-long-double-tr1-aux.cc @@ -24,7 +24,7 @@ namespace std _GLIBCXX_VISIBILITY(default) { - namespace tr1 + namespace tr1 { // For long double, careful with random padding bits (e.g., on x86, // 10 bytes -> 12 bytes) and resort to frexp. diff --git a/libstdc++-v3/src/c++98/hash_tr1.cc b/libstdc++-v3/src/c++98/hash_tr1.cc index 0ff7c61..f4fe611 100644 --- a/libstdc++-v3/src/c++98/hash_tr1.cc +++ b/libstdc++-v3/src/c++98/hash_tr1.cc @@ -30,7 +30,7 @@ namespace std _GLIBCXX_VISIBILITY(default) { - namespace tr1 + namespace tr1 { #ifndef _GLIBCXX_LONG_DOUBLE_COMPAT_IMPL template<> diff --git a/libstdc++-v3/src/c++98/hashtable_tr1.cc b/libstdc++-v3/src/c++98/hashtable_tr1.cc index 0e2fe90..6be2b9b 100644 --- a/libstdc++-v3/src/c++98/hashtable_tr1.cc +++ b/libstdc++-v3/src/c++98/hashtable_tr1.cc @@ -26,7 +26,7 @@ namespace std _GLIBCXX_VISIBILITY(default) { - namespace tr1 + namespace tr1 { #include "../shared/hashtable-aux.cc" } diff --git a/libstdc++-v3/src/c++98/ios_failure.cc b/libstdc++-v3/src/c++98/ios_failure.cc index ac90525..1edb7af 100644 --- a/libstdc++-v3/src/c++98/ios_failure.cc +++ b/libstdc++-v3/src/c++98/ios_failure.cc @@ -38,7 +38,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ios_base::failure::~failure() throw() { } - + const char* ios_base::failure::what() const throw() { return _M_msg.c_str(); } diff --git a/libstdc++-v3/src/c++98/ios_init.cc b/libstdc++-v3/src/c++98/ios_init.cc index 2fdc93d..64d6783 100644 --- a/libstdc++-v3/src/c++98/ios_init.cc +++ b/libstdc++-v3/src/c++98/ios_init.cc @@ -62,7 +62,7 @@ namespace std _GLIBCXX_VISIBILITY(default) _GLIBCXX_BEGIN_NAMESPACE_VERSION using namespace __gnu_internal; - + extern istream cin; extern ostream cout; extern ostream cerr; @@ -109,9 +109,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION new (&wclog) wostream(&buf_wcerr_sync); wcin.tie(&wcout); wcerr.setf(ios_base::unitbuf); - wcerr.tie(&wcout); + wcerr.tie(&wcout); #endif - + // NB: Have to set refcount above one, so that standard // streams are not re-initialized with uses of ios_base::Init // besides <iostream> static object, ie just using <ios> with @@ -129,26 +129,26 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_S_refcount); // Catch any exceptions thrown by basic_ostream::flush() __try - { + { // Flush standard output streams as required by 27.4.2.1.6 cout.flush(); cerr.flush(); clog.flush(); - + #ifdef _GLIBCXX_USE_WCHAR_T wcout.flush(); wcerr.flush(); - wclog.flush(); + wclog.flush(); #endif } __catch(...) { } } - } + } - bool + bool ios_base::sync_with_stdio(bool __sync) - { + { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 49. Underspecification of ios_base::sync_with_stdio bool __ret = ios_base::Init::_S_synced_with_stdio; @@ -185,7 +185,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION cin.rdbuf(&buf_cin); cerr.rdbuf(&buf_cerr); clog.rdbuf(&buf_cerr); - + #ifdef _GLIBCXX_USE_WCHAR_T new (&buf_wcout) stdio_filebuf<wchar_t>(stdout, ios_base::out); new (&buf_wcin) stdio_filebuf<wchar_t>(stdin, ios_base::in); @@ -196,7 +196,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION wclog.rdbuf(&buf_wcerr); #endif } - return __ret; + return __ret; } _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/src/c++98/istream.cc b/libstdc++-v3/src/c++98/istream.cc index b258a39..93fa12e8 100644 --- a/libstdc++-v3/src/c++98/istream.cc +++ b/libstdc++-v3/src/c++98/istream.cc @@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); int_type __c = __sb->sgetc(); - + while (_M_gcount + 1 < __n && !traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __idelim)) @@ -82,7 +82,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __err |= ios_base::eofbit; else if (traits_type::eq_int_type(__c, __idelim)) { - ++_M_gcount; + ++_M_gcount; __sb->sbumpc(); } else @@ -290,7 +290,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); int_type __c = __sb->sgetc(); - + while (_M_gcount + 1 < __n && !traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __idelim)) @@ -324,7 +324,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __err |= ios_base::eofbit; else if (traits_type::eq_int_type(__c, __idelim)) { - ++_M_gcount; + ++_M_gcount; __sb->sbumpc(); } else diff --git a/libstdc++-v3/src/c++98/locale.cc b/libstdc++-v3/src/c++98/locale.cc index 40763fd..00a972d 100644 --- a/libstdc++-v3/src/c++98/locale.cc +++ b/libstdc++-v3/src/c++98/locale.cc @@ -69,7 +69,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // These are no longer exported. locale::_Impl* locale::_S_classic; - locale::_Impl* locale::_S_global; + locale::_Impl* locale::_S_global; #ifdef __GTHREADS __gthread_once_t locale::_S_once = __GTHREAD_ONCE_INIT; @@ -132,7 +132,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __ret.reserve(128); __ret += _S_categories[0]; __ret += '='; - __ret += _M_impl->_M_names[0]; + __ret += _M_impl->_M_names[0]; for (size_t __i = 1; __i < _S_categories_size; ++__i) { __ret += ';'; @@ -145,7 +145,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } locale::category - locale::_S_normalize_category(category __cat) + locale::_S_normalize_category(category __cat) { int __ret = 0; if (__cat == none || ((__cat & all) && !(__cat & ~all))) @@ -155,27 +155,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // NB: May be a C-style "LC_ALL" category; convert. switch (__cat) { - case LC_COLLATE: - __ret = collate; + case LC_COLLATE: + __ret = collate; break; - case LC_CTYPE: + case LC_CTYPE: __ret = ctype; break; - case LC_MONETARY: + case LC_MONETARY: __ret = monetary; break; - case LC_NUMERIC: + case LC_NUMERIC: __ret = numeric; break; - case LC_TIME: - __ret = time; + case LC_TIME: + __ret = time; break; #ifdef _GLIBCXX_HAVE_LC_MESSAGES - case LC_MESSAGES: + case LC_MESSAGES: __ret = messages; break; -#endif - case LC_ALL: +#endif + case LC_ALL: __ret = all; break; default: @@ -237,12 +237,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (_M_caches) for (size_t __i = 0; __i < _M_facets_size; ++__i) if (_M_caches[__i]) - _M_caches[__i]->_M_remove_reference(); + _M_caches[__i]->_M_remove_reference(); delete [] _M_caches; if (_M_names) for (size_t __i = 0; __i < _S_categories_size; ++__i) - delete [] _M_names[__i]; + delete [] _M_names[__i]; delete [] _M_names; } @@ -266,7 +266,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { _M_caches[__j] = __imp._M_caches[__j]; if (_M_caches[__j]) - _M_caches[__j]->_M_add_reference(); + _M_caches[__j]->_M_add_reference(); } _M_names = new char*[_S_categories_size]; for (size_t __k = 0; __k < _S_categories_size; ++__k) @@ -290,22 +290,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION void locale::_Impl:: - _M_replace_category(const _Impl* __imp, + _M_replace_category(const _Impl* __imp, const locale::id* const* __idpp) { for (; *__idpp; ++__idpp) _M_replace_facet(__imp, *__idpp); } - + void locale::_Impl:: _M_replace_facet(const _Impl* __imp, const locale::id* __idp) { size_t __index = __idp->_M_id(); - if ((__index > (__imp->_M_facets_size - 1)) + if ((__index > (__imp->_M_facets_size - 1)) || !__imp->_M_facets[__index]) __throw_runtime_error(__N("locale::_Impl::_M_replace_facet")); - _M_install_facet(__idp, __imp->_M_facets[__index]); + _M_install_facet(__idp, __imp->_M_facets[__index]); } void @@ -324,7 +324,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // New facet array. const facet** __oldf = _M_facets; const facet** __newf; - __newf = new const facet*[__new_size]; + __newf = new const facet*[__new_size]; for (size_t __i = 0; __i < _M_facets_size; ++__i) __newf[__i] = _M_facets[__i]; for (size_t __l = _M_facets_size; __l < __new_size; ++__l) diff --git a/libstdc++-v3/src/c++98/locale_facets.cc b/libstdc++-v3/src/c++98/locale_facets.cc index 9f3d3b1..4819a29 100644 --- a/libstdc++-v3/src/c++98/locale_facets.cc +++ b/libstdc++-v3/src/c++98/locale_facets.cc @@ -28,26 +28,26 @@ namespace std _GLIBCXX_VISIBILITY(default) _GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for static const data members of time_base. - template<> + template<> const char* __timepunct_cache<char>::_S_timezones[14] = - { - "GMT", "HST", "AKST", "PST", "MST", "CST", "EST", "AST", "NST", "CET", - "IST", "EET", "CST", "JST" + { + "GMT", "HST", "AKST", "PST", "MST", "CST", "EST", "AST", "NST", "CET", + "IST", "EET", "CST", "JST" }; - + #ifdef _GLIBCXX_USE_WCHAR_T - template<> + template<> const wchar_t* __timepunct_cache<wchar_t>::_S_timezones[14] = - { - L"GMT", L"HST", L"AKST", L"PST", L"MST", L"CST", L"EST", L"AST", - L"NST", L"CET", L"IST", L"EET", L"CST", L"JST" + { + L"GMT", L"HST", L"AKST", L"PST", L"MST", L"CST", L"EST", L"AST", + L"NST", L"CET", L"IST", L"EET", L"CST", L"JST" }; #endif // Definitions for static const data members of money_base. - const money_base::pattern + const money_base::pattern money_base::_S_default_pattern = { {symbol, sign, none, value} }; const char* money_base::_S_atoms = "-0123456789"; @@ -59,7 +59,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // According to the resolution of DR 231, about 22.2.2.2.2, p11, // "str.precision() is specified in the conversion specification". void - __num_base::_S_format_float(const ios_base& __io, char* __fptr, + __num_base::_S_format_float(const ios_base& __io, char* __fptr, char __mod) throw() { ios_base::fmtflags __flags = __io.flags(); @@ -108,7 +108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const size_t __min = std::min(__n, size_t(__grouping_size - 1)); size_t __i = __n; bool __test = true; - + // Parsed number groupings have to match the // numpunct::grouping string exactly, starting at the // right-most point of the parsed sequence of elements ... diff --git a/libstdc++-v3/src/c++98/locale_init.cc b/libstdc++-v3/src/c++98/locale_init.cc index 5629b82..169068c 100644 --- a/libstdc++-v3/src/c++98/locale_init.cc +++ b/libstdc++-v3/src/c++98/locale_init.cc @@ -55,7 +55,7 @@ _GLIBCXX_LOC_ID(_ZNSt8messagesIwE2idE); #endif -namespace +namespace { const int num_facets = _GLIBCXX_NUM_FACETS + _GLIBCXX_NUM_UNICODE_FACETS + (_GLIBCXX_USE_DUAL_ABI ? _GLIBCXX_NUM_CXX11_FACETS : 0); @@ -125,7 +125,7 @@ namespace typedef char fake_money_get_c[sizeof(money_get<char>)] __attribute__ ((aligned(__alignof__(money_get<char>)))); fake_money_get_c money_get_c; - + typedef char fake_money_put_c[sizeof(money_put<char>)] __attribute__ ((aligned(__alignof__(money_put<char>)))); fake_money_put_c money_put_c; @@ -179,7 +179,7 @@ namespace typedef char fake_money_get_w[sizeof(money_get<wchar_t>)] __attribute__ ((aligned(__alignof__(money_get<wchar_t>)))); fake_money_get_w money_get_w; - + typedef char fake_money_put_w[sizeof(money_put<wchar_t>)] __attribute__ ((aligned(__alignof__(money_put<wchar_t>)))); fake_money_put_w money_put_w; @@ -246,7 +246,7 @@ namespace std _GLIBCXX_VISIBILITY(default) _GLIBCXX_BEGIN_NAMESPACE_VERSION locale::locale() throw() : _M_impl(0) - { + { _S_initialize(); // Checked locking to optimize the common case where _S_global @@ -294,7 +294,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const locale& locale::classic() - { + { _S_initialize(); return *(new (&c_locale) locale(_S_classic)); } @@ -305,10 +305,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // 2 references. // One reference for _S_classic, one for _S_global _S_classic = new (&c_locale_impl) _Impl(2); - _S_global = _S_classic; + _S_global = _S_classic; } - void + void locale::_S_initialize() { #ifdef __GTHREADS @@ -323,7 +323,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const locale::id* const locale::_Impl::_S_id_ctype[] = { - &std::ctype<char>::id, + &std::ctype<char>::id, &codecvt<char, char, mbstate_t>::id, #ifdef _GLIBCXX_USE_WCHAR_T &std::ctype<wchar_t>::id, @@ -339,9 +339,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const locale::id* const locale::_Impl::_S_id_numeric[] = { - &num_get<char>::id, - &num_put<char>::id, - &numpunct<char>::id, + &num_get<char>::id, + &num_put<char>::id, + &numpunct<char>::id, #ifdef _GLIBCXX_USE_WCHAR_T &num_get<wchar_t>::id, &num_put<wchar_t>::id, @@ -349,7 +349,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif 0 }; - + const locale::id* const locale::_Impl::_S_id_collate[] = { @@ -363,24 +363,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const locale::id* const locale::_Impl::_S_id_time[] = { - &__timepunct<char>::id, - &time_get<char>::id, - &time_put<char>::id, + &__timepunct<char>::id, + &time_get<char>::id, + &time_put<char>::id, #ifdef _GLIBCXX_USE_WCHAR_T - &__timepunct<wchar_t>::id, + &__timepunct<wchar_t>::id, &time_get<wchar_t>::id, &time_put<wchar_t>::id, #endif 0 }; - + const locale::id* const locale::_Impl::_S_id_monetary[] = { - &money_get<char>::id, - &money_put<char>::id, - &moneypunct<char, false>::id, - &moneypunct<char, true >::id, + &money_get<char>::id, + &money_put<char>::id, + &moneypunct<char, false>::id, + &moneypunct<char, true >::id, #ifdef _GLIBCXX_USE_WCHAR_T &money_get<wchar_t>::id, &money_put<wchar_t>::id, @@ -393,7 +393,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const locale::id* const locale::_Impl::_S_id_messages[] = { - &std::messages<char>::id, + &std::messages<char>::id, #ifdef _GLIBCXX_USE_WCHAR_T &std::messages<wchar_t>::id, #endif @@ -457,9 +457,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Construct "C" _Impl. locale::_Impl:: - _Impl(size_t __refs) throw() + _Impl(size_t __refs) throw() : _M_refcount(__refs), _M_facets(0), _M_facets_size(num_facets), - _M_caches(0), _M_names(0) + _M_caches(0), _M_names(0) { _M_facets = new (&facet_vec) const facet*[_M_facets_size](); _M_caches = new (&cache_vec) const facet*[_M_facets_size](); @@ -503,7 +503,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_init_facet(new (&time_get_c) time_get<char>(1)); _M_init_facet(new (&time_put_c) time_put<char>(1)); - _M_init_facet(new (&messages_c) std::messages<char>(1)); + _M_init_facet(new (&messages_c) std::messages<char>(1)); #ifdef _GLIBCXX_USE_WCHAR_T _M_init_facet(new (&ctype_w) std::ctype<wchar_t>(1)); diff --git a/libstdc++-v3/src/c++98/localename.cc b/libstdc++-v3/src/c++98/localename.cc index 1c0e50c..c610b18 100644 --- a/libstdc++-v3/src/c++98/localename.cc +++ b/libstdc++-v3/src/c++98/localename.cc @@ -36,7 +36,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__s) { - _S_initialize(); + _S_initialize(); if (std::strcmp(__s, "C") == 0 || std::strcmp(__s, "POSIX") == 0) (_M_impl = _S_classic)->_M_add_reference(); else if (std::strcmp(__s, "") != 0) @@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // If LC_ALL is set we are done. if (__env && std::strcmp(__env, "") != 0) { - if (std::strcmp(__env, "C") == 0 + if (std::strcmp(__env, "C") == 0 || std::strcmp(__env, "POSIX") == 0) (_M_impl = _S_classic)->_M_add_reference(); else @@ -59,13 +59,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // LANG may set a default different from "C". string __lang; __env = std::getenv("LANG"); - if (!__env || std::strcmp(__env, "") == 0 - || std::strcmp(__env, "C") == 0 + if (!__env || std::strcmp(__env, "") == 0 + || std::strcmp(__env, "C") == 0 || std::strcmp(__env, "POSIX") == 0) __lang = "C"; - else + else __lang = __env; - + // Scan the categories looking for the first one // different from LANG. size_t __i = 0; @@ -73,8 +73,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION for (; __i < _S_categories_size; ++__i) { __env = std::getenv(_S_categories[__i]); - if (__env && std::strcmp(__env, "") != 0 - && std::strcmp(__env, "C") != 0 + if (__env && std::strcmp(__env, "") != 0 + && std::strcmp(__env, "C") != 0 && std::strcmp(__env, "POSIX") != 0) break; } @@ -86,7 +86,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION && __lang != __env) break; } - + // If one is found, build the complete string of // the form LC_CTYPE=xxx;LC_NUMERIC=yyy; and so on... if (__i < _S_categories_size) @@ -143,7 +143,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION locale::locale(const locale& __base, const char* __s, category __cat) : _M_impl(0) - { + { // NB: There are complicated, yet more efficient ways to do // this. Building up locales on a per-category way is tedious, so // let's do it this way until people complain. @@ -156,17 +156,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { _M_coalesce(__base, __add, __cat); } void - locale::_M_coalesce(const locale& __base, const locale& __add, + locale::_M_coalesce(const locale& __base, const locale& __add, category __cat) { - __cat = _S_normalize_category(__cat); - _M_impl = new _Impl(*__base._M_impl, 1); + __cat = _S_normalize_category(__cat); + _M_impl = new _Impl(*__base._M_impl, 1); - __try + __try { _M_impl->_M_replace_categories(__add._M_impl, __cat); } - __catch(...) - { - _M_impl->_M_remove_reference(); + __catch(...) + { + _M_impl->_M_remove_reference(); __throw_exception_again; } } @@ -235,7 +235,7 @@ const int num_facets = _GLIBCXX_NUM_FACETS + _GLIBCXX_NUM_UNICODE_FACETS __smon); } } - + // Construct all standard facets and add them to _M_facets. _M_init_facet(new std::ctype<char>(__cloc, 0, false)); _M_init_facet(new codecvt<char, char, mbstate_t>(__cloc)); @@ -251,7 +251,7 @@ const int num_facets = _GLIBCXX_NUM_FACETS + _GLIBCXX_NUM_UNICODE_FACETS _M_init_facet(new time_get<char>); _M_init_facet(new time_put<char>); _M_init_facet(new std::messages<char>(__cloc, __s)); - + #ifdef _GLIBCXX_USE_WCHAR_T _M_init_facet(new std::ctype<wchar_t>(__cloc)); _M_init_facet(new codecvt<wchar_t, char, mbstate_t>(__cloc)); @@ -289,7 +289,7 @@ const int num_facets = _GLIBCXX_NUM_FACETS + _GLIBCXX_NUM_UNICODE_FACETS locale::facet::_S_destroy_c_locale(__clocm); this->~_Impl(); __throw_exception_again; - } + } } void diff --git a/libstdc++-v3/src/c++98/math_stubs_float.cc b/libstdc++-v3/src/c++98/math_stubs_float.cc index b71e2ca..4434a68 100644 --- a/libstdc++-v3/src/c++98/math_stubs_float.cc +++ b/libstdc++-v3/src/c++98/math_stubs_float.cc @@ -28,7 +28,7 @@ // we use the following crude approximations. We keep saying that we'll do // better later, but never do. -extern "C" +extern "C" { #ifndef _GLIBCXX_HAVE_FABSF float diff --git a/libstdc++-v3/src/c++98/math_stubs_long_double.cc b/libstdc++-v3/src/c++98/math_stubs_long_double.cc index 0ce31b8..6aeebad 100644 --- a/libstdc++-v3/src/c++98/math_stubs_long_double.cc +++ b/libstdc++-v3/src/c++98/math_stubs_long_double.cc @@ -28,7 +28,7 @@ // we use the following crude approximations. We keep saying that we'll do // better later, but never do. -extern "C" +extern "C" { #ifndef _GLIBCXX_HAVE_FABSL long double diff --git a/libstdc++-v3/src/c++98/misc-inst.cc b/libstdc++-v3/src/c++98/misc-inst.cc index f4be038..bc22e12 100644 --- a/libstdc++-v3/src/c++98/misc-inst.cc +++ b/libstdc++-v3/src/c++98/misc-inst.cc @@ -37,30 +37,30 @@ namespace std _GLIBCXX_VISIBILITY(default) _GLIBCXX_BEGIN_NAMESPACE_VERSION // string related to iostreams - template - basic_istream<char>& + template + basic_istream<char>& operator>>(basic_istream<char>&, string&); - template - basic_ostream<char>& + template + basic_ostream<char>& operator<<(basic_ostream<char>&, const string&); - template - basic_istream<char>& + template + basic_istream<char>& getline(basic_istream<char>&, string&, char); - template - basic_istream<char>& + template + basic_istream<char>& getline(basic_istream<char>&, string&); #ifdef _GLIBCXX_USE_WCHAR_T - template - basic_istream<wchar_t>& + template + basic_istream<wchar_t>& operator>>(basic_istream<wchar_t>&, wstring&); - template - basic_ostream<wchar_t>& + template + basic_ostream<wchar_t>& operator<<(basic_ostream<wchar_t>&, const wstring&); - template - basic_istream<wchar_t>& + template + basic_istream<wchar_t>& getline(basic_istream<wchar_t>&, wstring&, wchar_t); - template - basic_istream<wchar_t>& + template + basic_istream<wchar_t>& getline(basic_istream<wchar_t>&, wstring&); #endif diff --git a/libstdc++-v3/src/c++98/mt_allocator.cc b/libstdc++-v3/src/c++98/mt_allocator.cc index 5f7807c..efc694a0 100644 --- a/libstdc++-v3/src/c++98/mt_allocator.cc +++ b/libstdc++-v3/src/c++98/mt_allocator.cc @@ -72,7 +72,7 @@ namespace return freelist_mutex; } - static void + static void _M_destroy_thread_key(void* __id) { // Return this thread id record to the front of thread_freelist. @@ -80,7 +80,7 @@ namespace { __gnu_cxx::__scoped_lock sentry(get_freelist_mutex()); uintptr_t _M_id = reinterpret_cast<uintptr_t>(__id); - + typedef __gnu_cxx::__pool<true>::_Thread_record _Thread_record; _Thread_record* __tr = &freelist._M_thread_freelist_array[_M_id - 1]; __tr->_M_next = freelist._M_thread_freelist; @@ -124,23 +124,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION char* __c = __p - _M_get_align(); _Block_record* __block = reinterpret_cast<_Block_record*>(__c); - + // Single threaded application - return to global pool. __block->_M_next = __bin._M_first[0]; __bin._M_first[0] = __block; } - char* + char* __pool<false>::_M_reserve_block(size_t __bytes, const size_t __thread_id) { // Round up to power of 2 and figure out which bin to use. const size_t __which = _M_binmap[__bytes]; _Bin_record& __bin = _M_bin[__which]; const _Tune& __options = _M_get_options(); - const size_t __bin_size = (__options._M_min_bin << __which) + const size_t __bin_size = (__options._M_min_bin << __which) + __options._M_align; size_t __block_count = __options._M_chunk_size - sizeof(_Block_address); - __block_count /= __bin_size; + __block_count /= __bin_size; // Get a new block dynamically, set it up for use. void* __v = ::operator new(__options._M_chunk_size); @@ -174,12 +174,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _M_force_new must not change after the first allocate(), which // in turn calls this method, so if it's false, it's false forever // and we don't need to return here ever again. - if (_M_options._M_force_new) + if (_M_options._M_force_new) { _M_init = true; return; } - + // Create the bins. // Calculate the number of bins required based on _M_max_bytes. // _M_bin_size is statically-initialized to one. @@ -189,7 +189,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __bin_size <<= 1; ++_M_bin_size; } - + // Setup the bin map for quick lookup of the relevant bin. const size_t __j = (_M_options._M_max_bytes + 1) * sizeof(_Binmap_type); _M_binmap = static_cast<_Binmap_type*>(::operator new(__j)); @@ -205,7 +205,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } *__bp++ = __bint; } - + // Initialize _M_bin and its members. void* __v = ::operator new(sizeof(_Bin_record) * _M_bin_size); _M_bin = static_cast<_Bin_record*>(__v); @@ -220,7 +220,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_init = true; } - + #ifdef __GTHREADS void __pool<true>::_M_destroy() throw() @@ -279,7 +279,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // in order to avoid too much contention we wait until the // number of records is "high enough". const size_t __thread_id = _M_get_thread_id(); - const _Tune& __options = _M_get_options(); + const _Tune& __options = _M_get_options(); const size_t __limit = (100 * (_M_bin_size - __which) * __options._M_freelist_headroom); @@ -319,7 +319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __tmp = __tmp->_M_next; __bin._M_first[__thread_id] = __tmp->_M_next; __bin._M_free[__thread_id] -= __removed; - + __gthread_mutex_lock(__bin._M_mutex); __tmp->_M_next = __bin._M_first[0]; __bin._M_first[0] = __first; @@ -336,7 +336,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __block->_M_next = __bin._M_first[__thread_id]; __bin._M_first[__thread_id] = __block; - + ++__bin._M_free[__thread_id]; } else @@ -348,7 +348,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } - char* + char* __pool<true>::_M_reserve_block(size_t __bytes, const size_t __thread_id) { // Round up to power of 2 and figure out which bin to use. @@ -357,13 +357,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const size_t __bin_size = ((__options._M_min_bin << __which) + __options._M_align); size_t __block_count = __options._M_chunk_size - sizeof(_Block_address); - __block_count /= __bin_size; - + __block_count /= __bin_size; + // Are we using threads? // - Yes, check if there are free blocks on the global // list. If so, grab up to __block_count blocks in one - // lock and change ownership. If the global list is - // empty, we allocate a new chunk and add those blocks + // lock and change ownership. If the global list is + // empty, we allocate a new chunk and add those blocks // directly to our own freelist (with us as owner). // - No, all operations are made directly to global pool 0 // no need to lock or change ownership but check for free @@ -449,7 +449,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } __block->_M_next = 0; } - + __block = __bin._M_first[__thread_id]; __bin._M_first[__thread_id] = __block->_M_next; @@ -471,7 +471,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _M_force_new must not change after the first allocate(), // which in turn calls this method, so if it's false, it's false // forever and we don't need to return here ever again. - if (_M_options._M_force_new) + if (_M_options._M_force_new) { _M_init = true; return; @@ -486,7 +486,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __bin_size <<= 1; ++_M_bin_size; } - + // Setup the bin map for quick lookup of the relevant bin. const size_t __j = (_M_options._M_max_bytes + 1) * sizeof(_Binmap_type); _M_binmap = static_cast<_Binmap_type*>(::operator new(__j)); @@ -502,11 +502,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } *__bp++ = __bint; } - + // Initialize _M_bin and its members. void* __v = ::operator new(sizeof(_Bin_record) * _M_bin_size); _M_bin = static_cast<_Bin_record*>(__v); - + // If __gthread_active_p() create and initialize the list of // free thread ids. Single threaded applications use thread id 0 // directly and have no need for this. @@ -577,7 +577,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { _Bin_record& __bin = _M_bin[__n]; __v = ::operator new(sizeof(_Block_record*) * __max_threads); - std::memset(__v, 0, sizeof(_Block_record*) * __max_threads); + std::memset(__v, 0, sizeof(_Block_record*) * __max_threads); __bin._M_first = static_cast<_Block_record**>(__v); __bin._M_address = 0; @@ -592,10 +592,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::memset(__v, 0, (sizeof(size_t) * __max_threads + sizeof(_Atomic_word) * __max_threads)); __bin._M_used = static_cast<size_t*>(__v); - + __v = ::operator new(sizeof(__gthread_mutex_t)); __bin._M_mutex = static_cast<__gthread_mutex_t*>(__v); - + #ifdef __GTHREAD_MUTEX_INIT { // Do not copy a POSIX/gthr mutex once in use. @@ -656,7 +656,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } // XXX GLIBCXX_ABI Deprecated - void + void __pool<true>::_M_destroy_thread_key(void*) throw () { } // XXX GLIBCXX_ABI Deprecated @@ -666,7 +666,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _M_force_new must not change after the first allocate(), // which in turn calls this method, so if it's false, it's false // forever and we don't need to return here ever again. - if (_M_options._M_force_new) + if (_M_options._M_force_new) { _M_init = true; return; @@ -681,7 +681,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __bin_size <<= 1; ++_M_bin_size; } - + // Setup the bin map for quick lookup of the relevant bin. const size_t __j = (_M_options._M_max_bytes + 1) * sizeof(_Binmap_type); _M_binmap = static_cast<_Binmap_type*>(::operator new(__j)); @@ -697,11 +697,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } *__bp++ = __bint; } - + // Initialize _M_bin and its members. void* __v = ::operator new(sizeof(_Bin_record) * _M_bin_size); _M_bin = static_cast<_Bin_record*>(__v); - + // If __gthread_active_p() create and initialize the list of // free thread ids. Single threaded applications use thread id 0 // directly and have no need for this. @@ -737,7 +737,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { // Initialize per thread key to hold pointer to // _M_thread_freelist. - __gthread_key_create(&freelist._M_key, + __gthread_key_create(&freelist._M_key, ::_M_destroy_thread_key); freelist._M_thread_freelist = _M_thread_freelist; } @@ -780,8 +780,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __v = ::operator new(sizeof(size_t) * __max_threads); std::memset(__v, 0, sizeof(size_t) * __max_threads); __bin._M_free = static_cast<size_t*>(__v); - - __v = ::operator new(sizeof(size_t) * __max_threads + + + __v = ::operator new(sizeof(size_t) * __max_threads + sizeof(_Atomic_word) * __max_threads); std::memset(__v, 0, (sizeof(size_t) * __max_threads + sizeof(_Atomic_word) * __max_threads)); @@ -789,7 +789,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __v = ::operator new(sizeof(__gthread_mutex_t)); __bin._M_mutex = static_cast<__gthread_mutex_t*>(__v); - + #ifdef __GTHREAD_MUTEX_INIT { // Do not copy a POSIX/gthr mutex once in use. diff --git a/libstdc++-v3/src/c++98/pool_allocator.cc b/libstdc++-v3/src/c++98/pool_allocator.cc index 987a8fd..bce7ded 100644 --- a/libstdc++-v3/src/c++98/pool_allocator.cc +++ b/libstdc++-v3/src/c++98/pool_allocator.cc @@ -47,7 +47,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Definitions for __pool_alloc_base. __pool_alloc_base::_Obj* volatile* __pool_alloc_base::_M_get_free_list(size_t __bytes) throw () - { + { size_t __i = ((__bytes + (size_t)_S_align - 1) / (size_t)_S_align - 1); return _S_free_list + __i; } @@ -65,7 +65,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION char* __result; size_t __total_bytes = __n * __nobjs; size_t __bytes_left = _S_end_free - _S_start_free; - + if (__bytes_left >= __total_bytes) { __result = _S_start_free; @@ -89,7 +89,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ((_Obj*)(void*)_S_start_free)->_M_free_list_link = *__free_list; *__free_list = (_Obj*)(void*)_S_start_free; } - + size_t __bytes_to_get = (2 * __total_bytes + _M_round_up(_S_heap_size >> 4)); __try @@ -125,7 +125,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return _M_allocate_chunk(__n, __nobjs); } } - + // Returns an object of size __n, and optionally adds to "size // __n"'s free list. We assume that __n is properly aligned. We // hold the allocation lock. @@ -138,11 +138,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Obj* __result; _Obj* __current_obj; _Obj* __next_obj; - + if (__nobjs == 1) return __chunk; __free_list = _M_get_free_list(__n); - + // Build free list in chunk. __result = (_Obj*)(void*)__chunk; *__free_list = __next_obj = (_Obj*)(void*)(__chunk + __n); @@ -162,11 +162,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } __pool_alloc_base::_Obj* volatile __pool_alloc_base::_S_free_list[_S_free_list_size]; - + char* __pool_alloc_base::_S_start_free = 0; - + char* __pool_alloc_base::_S_end_free = 0; - + size_t __pool_alloc_base::_S_heap_size = 0; // Instantiations. diff --git a/libstdc++-v3/src/c++98/strstream.cc b/libstdc++-v3/src/c++98/strstream.cc index f32dd10..bf61696 100644 --- a/libstdc++-v3/src/c++98/strstream.cc +++ b/libstdc++-v3/src/c++98/strstream.cc @@ -53,13 +53,13 @@ namespace std _GLIBCXX_VISIBILITY(default) _GLIBCXX_BEGIN_NAMESPACE_VERSION strstreambuf::strstreambuf(streamsize initial_capacity) - : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(true), + : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(true), _M_frozen(false), _M_constant(false) { streamsize n = std::max(initial_capacity, streamsize(16)); - + char* buf = _M_alloc(n); - if (buf) + if (buf) { setp(buf, buf + n); setg(buf, buf, buf); @@ -67,13 +67,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } strstreambuf::strstreambuf(void* (*alloc_f)(size_t), void (*free_f)(void*)) - : _Base(), _M_alloc_fun(alloc_f), _M_free_fun(free_f), _M_dynamic(true), + : _Base(), _M_alloc_fun(alloc_f), _M_free_fun(free_f), _M_dynamic(true), _M_frozen(false), _M_constant(false) { streamsize n = 16; char* buf = _M_alloc(n); - if (buf) + if (buf) { setp(buf, buf + n); setg(buf, buf, buf); @@ -81,33 +81,33 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } strstreambuf::strstreambuf(char* get, streamsize n, char* put) throw () - : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), + : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), _M_frozen(false), _M_constant(false) { _M_setup(get, put, n); } strstreambuf::strstreambuf(signed char* get, streamsize n, signed char* put) throw () - : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), + : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), _M_frozen(false), _M_constant(false) { _M_setup(reinterpret_cast<char*>(get), reinterpret_cast<char*>(put), n); } - strstreambuf::strstreambuf(unsigned char* get, streamsize n, + strstreambuf::strstreambuf(unsigned char* get, streamsize n, unsigned char* put) throw () - : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), + : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), _M_frozen(false), _M_constant(false) { _M_setup(reinterpret_cast<char*>(get), reinterpret_cast<char*>(put), n); } strstreambuf::strstreambuf(const char* get, streamsize n) throw () - : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), + : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), _M_frozen(false), _M_constant(true) { _M_setup(const_cast<char*>(get), 0, n); } strstreambuf::strstreambuf(const signed char* get, streamsize n) throw () - : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), + : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), _M_frozen(false), _M_constant(true) { _M_setup(reinterpret_cast<char*>(const_cast<signed char*>(get)), 0, n); } strstreambuf::strstreambuf(const unsigned char* get, streamsize n) throw () - : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), + : _Base(), _M_alloc_fun(0), _M_free_fun(0), _M_dynamic(false), _M_frozen(false), _M_constant(true) { _M_setup(reinterpret_cast<char*>(const_cast<unsigned char*>(get)), 0, n); } @@ -117,61 +117,61 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_free(eback()); } - void + void strstreambuf::freeze(bool frozenflag) throw () { if (_M_dynamic) _M_frozen = frozenflag; } - char* + char* strstreambuf::str() throw () { freeze(true); return eback(); } - int + int strstreambuf::pcount() const throw () { return pptr() ? pptr() - pbase() : 0; } - strstreambuf::int_type - strstreambuf::overflow(int_type c) + strstreambuf::int_type + strstreambuf::overflow(int_type c) { if (c == traits_type::eof()) return traits_type::not_eof(c); - + // Try to expand the buffer. - if (pptr() == epptr() && _M_dynamic && !_M_frozen && !_M_constant) + if (pptr() == epptr() && _M_dynamic && !_M_frozen && !_M_constant) { ptrdiff_t old_size = epptr() - pbase(); ptrdiff_t new_size = std::max(ptrdiff_t(2 * old_size), ptrdiff_t(1)); - + char* buf = _M_alloc(new_size); - if (buf) + if (buf) { memcpy(buf, pbase(), old_size); char* old_buffer = pbase(); bool reposition_get = false; ptrdiff_t old_get_offset; - if (gptr() != 0) + if (gptr() != 0) { reposition_get = true; old_get_offset = gptr() - eback(); } - + setp(buf, buf + new_size); __safe_pbump(old_size); if (reposition_get) - setg(buf, buf + old_get_offset, buf + + setg(buf, buf + old_get_offset, buf + std::max(old_get_offset, old_size)); _M_free(old_buffer); } } - - if (pptr() != epptr()) + + if (pptr() != epptr()) { *pptr() = c; pbump(1); @@ -181,22 +181,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return traits_type::eof(); } - strstreambuf::int_type + strstreambuf::int_type strstreambuf::pbackfail(int_type c) { - if (gptr() != eback()) + if (gptr() != eback()) { - if (c == _Traits::eof()) + if (c == _Traits::eof()) { gbump(-1); return _Traits::not_eof(c); } - else if (c == _Traits::to_int_type(gptr()[-1])) + else if (c == _Traits::to_int_type(gptr()[-1])) { // KLUDGE gbump(-1); return c; } - else if (!_M_constant) + else if (!_M_constant) { gbump(-1); *gptr() = c; @@ -206,12 +206,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return _Traits::eof(); } - strstreambuf::int_type + strstreambuf::int_type strstreambuf::underflow() { if (gptr() == egptr() && pptr() && pptr() > egptr()) setg(eback(), gptr(), pptr()); - + if (gptr() != egptr()) return (unsigned char) *gptr(); else @@ -223,13 +223,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return this; } strstreambuf::pos_type - strstreambuf::seekoff(off_type off, ios_base::seekdir dir, + strstreambuf::seekoff(off_type off, ios_base::seekdir dir, ios_base::openmode mode) { bool do_get = false; bool do_put = false; - if ((mode & (ios_base::in | ios_base::out)) + if ((mode & (ios_base::in | ios_base::out)) == (ios_base::in | ios_base::out) && (dir == ios_base::beg || dir == ios_base::end)) do_get = do_put = true; @@ -247,7 +247,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION char* seekhigh = epptr() ? epptr() : egptr(); off_type newoff; - switch (dir) + switch (dir) { case ios_base::beg: newoff = 0; @@ -261,25 +261,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION default: return pos_type(off_type(-1)); } - + off += newoff; if (off < 0 || off > seekhigh - seeklow) return pos_type(off_type(-1)); - if (do_put) + if (do_put) { - if (seeklow + off < pbase()) + if (seeklow + off < pbase()) { setp(seeklow, epptr()); __safe_pbump(off); } - else + else { setp(pbase(), epptr()); __safe_pbump(off - (pbase() - seeklow)); } } - if (do_get) + if (do_get) { if (off <= egptr() - seeklow) setg(seeklow, seeklow + off, egptr()); @@ -295,7 +295,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION strstreambuf::seekpos(pos_type pos, ios_base::openmode mode) { return seekoff(pos - pos_type(off_type(0)), ios_base::beg, mode); } - char* + char* strstreambuf::_M_alloc(size_t n) { if (_M_alloc_fun) @@ -304,7 +304,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return new char[n]; } - void + void strstreambuf::_M_free(char* p) { if (p) @@ -316,19 +316,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } - void + void strstreambuf::_M_setup(char* get, char* put, streamsize n) throw () { - if (get) + if (get) { size_t N = n > 0 ? size_t(n) : n == 0 ? strlen(get) : size_t(INT_MAX); - - if (put) + + if (put) { setg(get, get, put); setp(put, put + N); } - else + else setg(get, get, get + N); } } @@ -351,11 +351,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION istrstream::~istrstream() { } - strstreambuf* + strstreambuf* istrstream::rdbuf() const throw () { return const_cast<strstreambuf*>(&_M_buf); } - char* + char* istrstream::str() throw () { return _M_buf.str(); } @@ -364,25 +364,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { basic_ios<char>::init(&_M_buf); } ostrstream::ostrstream(char* s, int n, ios_base::openmode mode) - : basic_ios<char>(), basic_ostream<char>(0), + : basic_ios<char>(), basic_ostream<char>(0), _M_buf(s, n, mode & ios_base::app ? s + strlen(s) : s) { basic_ios<char>::init(&_M_buf); } ostrstream::~ostrstream() {} - strstreambuf* + strstreambuf* ostrstream::rdbuf() const throw () { return const_cast<strstreambuf*>(&_M_buf); } - void + void ostrstream::freeze(bool freezeflag) throw () { _M_buf.freeze(freezeflag); } - char* + char* ostrstream::str() throw () { return _M_buf.str(); } - int + int ostrstream::pcount() const throw () { return _M_buf.pcount(); } @@ -391,25 +391,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { basic_ios<char>::init(&_M_buf); } strstream::strstream(char* s, int n, ios_base::openmode mode) - : basic_ios<char>(), basic_iostream<char>(0), + : basic_ios<char>(), basic_iostream<char>(0), _M_buf(s, n, mode & ios_base::app ? s + strlen(s) : s) { basic_ios<char>::init(&_M_buf); } strstream::~strstream() { } - strstreambuf* + strstreambuf* strstream::rdbuf() const throw () { return const_cast<strstreambuf*>(&_M_buf); } - void + void strstream::freeze(bool freezeflag) throw () { _M_buf.freeze(freezeflag); } - int + int strstream::pcount() const throw () { return _M_buf.pcount(); } - char* + char* strstream::str() throw () { return _M_buf.str(); } diff --git a/libstdc++-v3/src/c++98/tree.cc b/libstdc++-v3/src/c++98/tree.cc index 6a7c1f5..d771cd8 100644 --- a/libstdc++-v3/src/c++98/tree.cc +++ b/libstdc++-v3/src/c++98/tree.cc @@ -59,16 +59,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static _Rb_tree_node_base* local_Rb_tree_increment(_Rb_tree_node_base* __x) throw () { - if (__x->_M_right != 0) + if (__x->_M_right != 0) { __x = __x->_M_right; while (__x->_M_left != 0) __x = __x->_M_left; } - else + else { _Rb_tree_node_base* __y = __x->_M_parent; - while (__x == __y->_M_right) + while (__x == __y->_M_right) { __x = __y; __y = __y->_M_parent; @@ -94,20 +94,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static _Rb_tree_node_base* local_Rb_tree_decrement(_Rb_tree_node_base* __x) throw () { - if (__x->_M_color == _S_red + if (__x->_M_color == _S_red && __x->_M_parent->_M_parent == __x) __x = __x->_M_right; - else if (__x->_M_left != 0) + else if (__x->_M_left != 0) { _Rb_tree_node_base* __y = __x->_M_left; while (__y->_M_right != 0) __y = __y->_M_right; __x = __y; } - else + else { _Rb_tree_node_base* __y = __x->_M_parent; - while (__x == __y->_M_left) + while (__x == __y->_M_left) { __x = __y; __y = __y->_M_parent; @@ -129,8 +129,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return local_Rb_tree_decrement(const_cast<_Rb_tree_node_base*>(__x)); } - static void - local_Rb_tree_rotate_left(_Rb_tree_node_base* const __x, + static void + local_Rb_tree_rotate_left(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root) { _Rb_tree_node_base* const __y = __x->_M_right; @@ -139,7 +139,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (__y->_M_left !=0) __y->_M_left->_M_parent = __x; __y->_M_parent = __x->_M_parent; - + if (__x == __root) __root = __y; else if (__x == __x->_M_parent->_M_left) @@ -153,15 +153,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /* Static keyword was missing on _Rb_tree_rotate_left. Export the symbol for backward compatibility until next ABI change. */ - void - _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, + void + _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root) { local_Rb_tree_rotate_left (__x, __root); } - static void - local_Rb_tree_rotate_right(_Rb_tree_node_base* const __x, + static void + local_Rb_tree_rotate_right(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root) { _Rb_tree_node_base* const __y = __x->_M_left; @@ -184,14 +184,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /* Static keyword was missing on _Rb_tree_rotate_right Export the symbol for backward compatibility until next ABI change. */ - void - _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, + void + _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root) { local_Rb_tree_rotate_right (__x, __root); } - void + void _Rb_tree_insert_and_rebalance(const bool __insert_left, _Rb_tree_node_base* __x, _Rb_tree_node_base* __p, @@ -229,24 +229,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __header._M_right = __x; // maintain rightmost pointing to max node } // Rebalance. - while (__x != __root - && __x->_M_parent->_M_color == _S_red) + while (__x != __root + && __x->_M_parent->_M_color == _S_red) { _Rb_tree_node_base* const __xpp = __x->_M_parent->_M_parent; - if (__x->_M_parent == __xpp->_M_left) + if (__x->_M_parent == __xpp->_M_left) { _Rb_tree_node_base* const __y = __xpp->_M_right; - if (__y && __y->_M_color == _S_red) + if (__y && __y->_M_color == _S_red) { __x->_M_parent->_M_color = _S_black; __y->_M_color = _S_black; __xpp->_M_color = _S_red; __x = __xpp; } - else + else { - if (__x == __x->_M_parent->_M_right) + if (__x == __x->_M_parent->_M_right) { __x = __x->_M_parent; local_Rb_tree_rotate_left(__x, __root); @@ -256,19 +256,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION local_Rb_tree_rotate_right(__xpp, __root); } } - else + else { _Rb_tree_node_base* const __y = __xpp->_M_left; - if (__y && __y->_M_color == _S_red) + if (__y && __y->_M_color == _S_red) { __x->_M_parent->_M_color = _S_black; __y->_M_color = _S_black; __xpp->_M_color = _S_red; __x = __xpp; } - else + else { - if (__x == __x->_M_parent->_M_left) + if (__x == __x->_M_parent->_M_left) { __x = __x->_M_parent; local_Rb_tree_rotate_right(__x, __root); @@ -283,7 +283,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } _Rb_tree_node_base* - _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, + _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, _Rb_tree_node_base& __header) throw () { _Rb_tree_node_base *& __root = __header._M_parent; @@ -298,7 +298,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION else if (__y->_M_right == 0) // __z has exactly one non-null child. y == z. __x = __y->_M_left; // __x is not null. - else + else { // __z has two non-null children. Set __y to __y = __y->_M_right; // __z's successor. __x might be null. @@ -306,12 +306,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __y = __y->_M_left; __x = __y->_M_right; } - if (__y != __z) + if (__y != __z) { // relink y in place of z. y is z's successor - __z->_M_left->_M_parent = __y; + __z->_M_left->_M_parent = __y; __y->_M_left = __z->_M_left; - if (__y != __z->_M_right) + if (__y != __z->_M_right) { __x_parent = __y->_M_parent; if (__x) __x->_M_parent = __y->_M_parent; @@ -320,31 +320,31 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __z->_M_right->_M_parent = __y; } else - __x_parent = __y; + __x_parent = __y; if (__root == __z) __root = __y; else if (__z->_M_parent->_M_left == __z) __z->_M_parent->_M_left = __y; - else + else __z->_M_parent->_M_right = __y; __y->_M_parent = __z->_M_parent; std::swap(__y->_M_color, __z->_M_color); __y = __z; // __y now points to node to be actually deleted } - else + else { // __y == __z __x_parent = __y->_M_parent; - if (__x) - __x->_M_parent = __y->_M_parent; + if (__x) + __x->_M_parent = __y->_M_parent; if (__root == __z) __root = __x; - else + else if (__z->_M_parent->_M_left == __z) __z->_M_parent->_M_left = __x; else __z->_M_parent->_M_right = __x; - if (__leftmost == __z) + if (__leftmost == __z) { if (__z->_M_right == 0) // __z->_M_left must be null also __leftmost = __z->_M_parent; @@ -352,41 +352,41 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION else __leftmost = _Rb_tree_node_base::_S_minimum(__x); } - if (__rightmost == __z) + if (__rightmost == __z) { if (__z->_M_left == 0) // __z->_M_right must be null also - __rightmost = __z->_M_parent; + __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) - { + if (__y->_M_color != _S_red) + { while (__x != __root && (__x == 0 || __x->_M_color == _S_black)) - if (__x == __x_parent->_M_left) + if (__x == __x_parent->_M_left) { _Rb_tree_node_base* __w = __x_parent->_M_right; - if (__w->_M_color == _S_red) + if (__w->_M_color == _S_red) { __w->_M_color = _S_black; __x_parent->_M_color = _S_red; local_Rb_tree_rotate_left(__x_parent, __root); __w = __x_parent->_M_right; } - if ((__w->_M_left == 0 || + if ((__w->_M_left == 0 || __w->_M_left->_M_color == _S_black) && - (__w->_M_right == 0 || - __w->_M_right->_M_color == _S_black)) + (__w->_M_right == 0 || + __w->_M_right->_M_color == _S_black)) { __w->_M_color = _S_red; __x = __x_parent; __x_parent = __x_parent->_M_parent; - } - else + } + else { - if (__w->_M_right == 0 - || __w->_M_right->_M_color == _S_black) + if (__w->_M_right == 0 + || __w->_M_right->_M_color == _S_black) { __w->_M_left->_M_color = _S_black; __w->_M_color = _S_red; @@ -395,35 +395,35 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } __w->_M_color = __x_parent->_M_color; __x_parent->_M_color = _S_black; - if (__w->_M_right) + if (__w->_M_right) __w->_M_right->_M_color = _S_black; local_Rb_tree_rotate_left(__x_parent, __root); break; } - } - else - { + } + else + { // same as above, with _M_right <-> _M_left. _Rb_tree_node_base* __w = __x_parent->_M_left; - if (__w->_M_color == _S_red) + if (__w->_M_color == _S_red) { __w->_M_color = _S_black; __x_parent->_M_color = _S_red; local_Rb_tree_rotate_right(__x_parent, __root); __w = __x_parent->_M_left; } - if ((__w->_M_right == 0 || + if ((__w->_M_right == 0 || __w->_M_right->_M_color == _S_black) && - (__w->_M_left == 0 || - __w->_M_left->_M_color == _S_black)) + (__w->_M_left == 0 || + __w->_M_left->_M_color == _S_black)) { __w->_M_color = _S_red; __x = __x_parent; __x_parent = __x_parent->_M_parent; - } - else + } + else { - if (__w->_M_left == 0 || __w->_M_left->_M_color == _S_black) + if (__w->_M_left == 0 || __w->_M_left->_M_color == _S_black) { __w->_M_right->_M_color = _S_black; __w->_M_color = _S_red; @@ -432,7 +432,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } __w->_M_color = __x_parent->_M_color; __x_parent->_M_color = _S_black; - if (__w->_M_left) + if (__w->_M_left) __w->_M_left->_M_color = _S_black; local_Rb_tree_rotate_right(__x_parent, __root); break; @@ -450,14 +450,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (__node == 0) return 0; unsigned int __sum = 0; - do + do { - if (__node->_M_color == _S_black) + if (__node->_M_color == _S_black) ++__sum; - if (__node == __root) + if (__node == __root) break; __node = __node->_M_parent; - } + } while (1); return __sum; } diff --git a/libstdc++-v3/src/c++98/valarray.cc b/libstdc++-v3/src/c++98/valarray.cc index fb3c326..7ca8fe9 100644 --- a/libstdc++-v3/src/c++98/valarray.cc +++ b/libstdc++-v3/src/c++98/valarray.cc @@ -35,10 +35,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Some explicit instantiations. template void __valarray_fill(size_t* __restrict__, size_t, const size_t&); - + template void __valarray_copy(const size_t* __restrict__, size_t, size_t* __restrict__); - + template valarray<size_t>::valarray(size_t); template valarray<size_t>::valarray(const valarray<size_t>&); template valarray<size_t>::~valarray(); @@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION valarray<size_t>& __t = const_cast<valarray<size_t>&>(__a); return __valarray_product(&__t[0], &__t[0] + __n); } - + // Map a gslice, described by its multidimensional LENGTHS // and corresponding STRIDES, to a linear array of INDEXES // for the purpose of indexing a flat, one-dimensional array @@ -96,12 +96,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } } - + gslice::_Indexer::_Indexer(size_t __o, const valarray<size_t>& __l, const valarray<size_t>& __s) : _M_count(1), _M_start(__o), _M_size(__l), _M_stride(__s), _M_index(__l.size() == 0 ? 0 : __valarray_product(__l)) - { __gslice_to_index(__o, __l, __s, _M_index); } + { __gslice_to_index(__o, __l, __s, _M_index); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace |