From 83042fcaec9b5763ddc895a57c6618afbfc4c897 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 3 Feb 2004 17:59:05 +0000 Subject: [PATCH] stl_iterator_base_funcs.h: Minor formatting and indentation tweaks. 2004-02-03 Paolo Carlini * include/bits/stl_iterator_base_funcs.h: Minor formatting and indentation tweaks. * include/bits/stl_iterator_base_types.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_tempbuf.h: Likewise. From-SVN: r77182 --- libstdc++-v3/ChangeLog | 9 +++++ .../include/bits/stl_iterator_base_funcs.h | 6 ++-- .../include/bits/stl_iterator_base_types.h | 9 +++-- libstdc++-v3/include/bits/stl_list.h | 21 ++++++++---- libstdc++-v3/include/bits/stl_map.h | 2 +- libstdc++-v3/include/bits/stl_tempbuf.h | 33 ++++++++++--------- 6 files changed, 52 insertions(+), 28 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fcd8a45c868..c073ca735a7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2004-02-03 Paolo Carlini + + * include/bits/stl_iterator_base_funcs.h: Minor formatting + and indentation tweaks. + * include/bits/stl_iterator_base_types.h: Likewise. + * include/bits/stl_list.h: Likewise. + * include/bits/stl_map.h: Likewise. + * include/bits/stl_tempbuf.h: Likewise. + 2004-02-02 Jerry Quinn * include/bits/gslice.h, include/bits/gslice_array.h, diff --git a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h index c933ee0c2be..b7626d9355b 100644 --- a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h @@ -137,9 +137,11 @@ namespace std __glibcxx_function_requires(_BidirectionalIteratorConcept< _BidirectionalIterator>) if (__n > 0) - while (__n--) ++__i; + while (__n--) + ++__i; else - while (__n++) --__i; + while (__n++) + --__i; } template diff --git a/libstdc++-v3/include/bits/stl_iterator_base_types.h b/libstdc++-v3/include/bits/stl_iterator_base_types.h index 5054340e46f..c3bb1c55727 100644 --- a/libstdc++-v3/include/bits/stl_iterator_base_types.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_types.h @@ -124,7 +124,8 @@ namespace std * provide tighter, more correct semantics. */ template - struct iterator_traits { + struct iterator_traits + { typedef typename _Iterator::iterator_category iterator_category; typedef typename _Iterator::value_type value_type; typedef typename _Iterator::difference_type difference_type; @@ -133,7 +134,8 @@ namespace std }; template - struct iterator_traits<_Tp*> { + struct iterator_traits<_Tp*> + { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; @@ -142,7 +144,8 @@ namespace std }; template - struct iterator_traits { + struct iterator_traits + { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index 546369b369c..2c6504a710a 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -76,15 +76,21 @@ namespace __gnu_norm _List_node_base* _M_next; ///< Self-explanatory _List_node_base* _M_prev; ///< Self-explanatory - static void swap(_List_node_base& __x, - _List_node_base& __y); + static void + swap(_List_node_base& __x, _List_node_base& __y); - void transfer(_List_node_base * const __first, - _List_node_base * const __last); + void + transfer(_List_node_base * const __first, + _List_node_base * const __last); - void reverse(); - void hook(_List_node_base * const __position); - void unhook(); + void + reverse(); + + void + hook(_List_node_base * const __position); + + void + unhook(); }; /// @if maint An actual node in the %list. @endif @@ -286,6 +292,7 @@ namespace __gnu_norm // allocator_type and _Node_Alloc_type. The conversion is // required by table 32 in [20.1.5]. typedef typename _Alloc::template rebind<_List_node<_Tp> >::other + _Node_Alloc_type; _List_node_base _M_node; diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 6cb0845267e..04876ba7c99 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -336,7 +336,7 @@ namespace __gnu_norm iterator __i = lower_bound(__k); // __i->first is greater than or equivalent to __k. if (__i == end() || key_comp()(__k, (*__i).first)) - __i = insert(__i, value_type(__k, mapped_type())); + __i = insert(__i, value_type(__k, mapped_type())); return (*__i).second; } diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h index 87080c6220f..96f909787bb 100644 --- a/libstdc++-v3/include/bits/stl_tempbuf.h +++ b/libstdc++-v3/include/bits/stl_tempbuf.h @@ -132,7 +132,9 @@ namespace std private: // Disable copy constructor and assignment operator. _Temporary_buffer(const _Temporary_buffer&); - void operator=(const _Temporary_buffer&); + + void + operator=(const _Temporary_buffer&); }; @@ -140,27 +142,28 @@ namespace std _Temporary_buffer<_ForwardIterator, _Tp>:: _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) : _M_original_len(std::distance(__first, __last)), - _M_len(0) , _M_buffer(0) + _M_len(0), _M_buffer(0) { // Workaround for a __type_traits bug in the pre-7.3 compiler. typedef typename __type_traits<_Tp>::has_trivial_default_constructor _Trivial; try - { - pair __p(get_temporary_buffer(_M_original_len)); - _M_buffer = __p.first; - _M_len = __p.second; - if (_M_len > 0) - _M_initialize_buffer(*__first, _Trivial()); - } + { + pair __p(get_temporary_buffer< + value_type>(_M_original_len)); + _M_buffer = __p.first; + _M_len = __p.second; + if (_M_len > 0) + _M_initialize_buffer(*__first, _Trivial()); + } catch(...) - { - std::return_temporary_buffer(_M_buffer); - _M_buffer = 0; - _M_len = 0; - __throw_exception_again; - } + { + std::return_temporary_buffer(_M_buffer); + _M_buffer = 0; + _M_len = 0; + __throw_exception_again; + } } } // namespace std -- 2.30.2