diff options
author | no-author <no-author@gcc.gnu.org> | 2001-01-25 14:25:44 +0000 |
---|---|---|
committer | no-author <no-author@gcc.gnu.org> | 2001-01-25 14:25:44 +0000 |
commit | 18fbeb97c8e79755d6166aeb1519d14a3f5e35f7 (patch) | |
tree | bad3a8048027062f0279ef6a8828718d5dfab547 /libstdc++/stl | |
parent | f9555ee958bd43d88e090dd8d971cbc8ac9e78a1 (diff) |
This commit was manufactured by cvs2svn to create taggcc-2_95_3-test3
'gcc-2_95_3-test3'.
git-svn-id: https://gcc.gnu.org/svn/gcc/tags/gcc-2_95_3-test3@39266 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++/stl')
-rw-r--r-- | libstdc++/stl/ChangeLog | 42 | ||||
-rw-r--r-- | libstdc++/stl/bitset | 3 | ||||
-rw-r--r-- | libstdc++/stl/pthread_alloc | 18 | ||||
-rw-r--r-- | libstdc++/stl/stl_algo.h | 4 | ||||
-rw-r--r-- | libstdc++/stl/stl_deque.h | 14 | ||||
-rw-r--r-- | libstdc++/stl/stl_function.h | 8 | ||||
-rw-r--r-- | libstdc++/stl/stl_numeric.h | 14 | ||||
-rw-r--r-- | libstdc++/stl/stl_queue.h | 82 | ||||
-rw-r--r-- | libstdc++/stl/stl_rope.h | 28 |
9 files changed, 129 insertions, 84 deletions
diff --git a/libstdc++/stl/ChangeLog b/libstdc++/stl/ChangeLog index f23f4fb1937..785fb587e82 100644 --- a/libstdc++/stl/ChangeLog +++ b/libstdc++/stl/ChangeLog @@ -1,3 +1,45 @@ +1999-11-06 Martin v. Löwis <loewis@informatik.hu-berlin.de> + + * bitset (class bitset): Declare reference as our friend. + * bitset: Include limits.h. + +Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com) + + * gcc-2.95.2 Released. + +Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com) + + * gcc-2.95.1 Released. + +Sun Aug 8 21:06:16 1999 Alexandre Oliva <oliva@dcc.unicamp.br> + + * pthread_alloc: Solaris' ctype.h defines _U to 01; use _Up as + template parameter instead. + +Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com) + + * gcc-2.95 Released. + +Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com) + + * gcc-2.95 Released. + +1999-07-11 Martin v. Löwis (loewis@informatik.hu-berlin.de) + + * stl_function.h (bind1st, bind2nd): Rename __opr to __oper, + as __opr is used internally by egcs. + * stl_numeric.h (__power, power): Likewise. + +1999-06-18 Martin von Löwis <loewis@informatik.hu-berlin.de> + + * stl_queue.h: Rename _M_c to c, and _M_comp to comp. + +1999-06-17 Alexandre Oliva <oliva@dcc.unicamp.br> + + * stl_algo.h (transform): Rename __opr to __oper, as __opr is used + internally by egcs. + Reported by Harri Porten <porten@tu-harburg.de> + 1999-05-17 Mark Kettenis <kettenis@gnu.org> * stl_config.h: Only define __STL_PTHREADS with GLIBC >= 2 for diff --git a/libstdc++/stl/bitset b/libstdc++/stl/bitset index e26845ed045..8b4f8b1a0f8 100644 --- a/libstdc++/stl/bitset +++ b/libstdc++/stl/bitset @@ -36,6 +36,7 @@ #include <stddef.h> // for size_t +#include <limits.h> // for CHAR_BIT #include <string> #include <stdexcept> // for invalid_argument, out_of_range, overflow_error #include <iostream.h> // for istream, ostream @@ -568,6 +569,8 @@ private: public: // bit reference: + class reference; + friend class reference; class reference { friend class bitset; diff --git a/libstdc++/stl/pthread_alloc b/libstdc++/stl/pthread_alloc index 887d8e8a154..1852908095b 100644 --- a/libstdc++/stl/pthread_alloc +++ b/libstdc++/stl/pthread_alloc @@ -376,13 +376,13 @@ public: typedef const _Tp& const_reference; typedef _Tp value_type; - template <class _U> struct rebind { - typedef pthread_allocator<_U> other; + template <class _Up> struct rebind { + typedef pthread_allocator<_Up> other; }; pthread_allocator() __STL_NOTHROW {} pthread_allocator(const pthread_allocator& a) __STL_NOTHROW {} - template <class _U> pthread_allocator(const pthread_allocator<_U>&) + template <class _Up> pthread_allocator(const pthread_allocator<_Up>&) __STL_NOTHROW {} ~pthread_allocator() __STL_NOTHROW {} @@ -416,8 +416,8 @@ public: typedef const void* const_pointer; typedef void value_type; - template <class _U> struct rebind { - typedef pthread_allocator<_U> other; + template <class _Up> struct rebind { + typedef pthread_allocator<_Up> other; }; }; @@ -451,16 +451,16 @@ struct _Alloc_traits<_Tp, _Pthread_alloc_template<_Max_size> > allocator_type; }; -template <class _Tp, class _U, size_t _Max> -struct _Alloc_traits<_Tp, __allocator<_U, _Pthread_alloc_template<_Max> > > +template <class _Tp, class _Up, size_t _Max> +struct _Alloc_traits<_Tp, __allocator<_Up, _Pthread_alloc_template<_Max> > > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, _Pthread_alloc_template<_Max> > _Alloc_type; typedef __allocator<_Tp, _Pthread_alloc_template<_Max> > allocator_type; }; -template <class _Tp, class _U> -struct _Alloc_traits<_Tp, pthread_allocator<_U> > +template <class _Tp, class _Up> +struct _Alloc_traits<_Tp, pthread_allocator<_Up> > { static const bool _S_instanceless = true; typedef simple_alloc<_Tp, _Pthread_alloc_template<> > _Alloc_type; diff --git a/libstdc++/stl/stl_algo.h b/libstdc++/stl/stl_algo.h index 57607ba5d49..e9beaee15f1 100644 --- a/libstdc++/stl/stl_algo.h +++ b/libstdc++/stl/stl_algo.h @@ -446,9 +446,9 @@ _ForwardIter2 swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1, template <class _InputIter, class _OutputIter, class _UnaryOperation> _OutputIter transform(_InputIter __first, _InputIter __last, - _OutputIter __result, _UnaryOperation __opr) { + _OutputIter __result, _UnaryOperation __oper) { for ( ; __first != __last; ++__first, ++__result) - *__result = __opr(*__first); + *__result = __oper(*__first); return __result; } diff --git a/libstdc++/stl/stl_deque.h b/libstdc++/stl/stl_deque.h index 48a4c76d55a..24a8bfb1bc8 100644 --- a/libstdc++/stl/stl_deque.h +++ b/libstdc++/stl/stl_deque.h @@ -342,7 +342,7 @@ public: _Base; typedef typename _Base::allocator_type allocator_type; typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz> iterator; - typedef _Deque_iterator<_Tp,const _Tp&,const _Tp&, __bufsiz> const_iterator; + typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*, __bufsiz> const_iterator; _Deque_base(const allocator_type& __a, size_t __num_elements) : _Base(__a), _M_start(), _M_finish() @@ -815,7 +815,7 @@ public: // Erase iterator __next = __pos; ++__next; difference_type __index = __pos - _M_start; - if (__index < (size() >> 1)) { + if (static_cast<size_type>(__index) < (size() >> 1)) { copy_backward(_M_start, __pos, __next); pop_front(); } @@ -1048,7 +1048,7 @@ deque<_Tp,_Alloc,__bufsize>::erase(iterator __first, iterator __last) else { difference_type __n = __last - __first; difference_type __elems_before = __first - _M_start; - if (__elems_before < (size() - __n) / 2) { + if (static_cast<size_type>(__elems_before) < (size() - __n) / 2) { copy_backward(_M_start, __first, __last); iterator __new_start = _M_start + __n; destroy(_M_start, __new_start); @@ -1282,7 +1282,7 @@ deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos, { difference_type __index = __pos - _M_start; value_type __x_copy = __x; - if (__index < size() / 2) { + if (static_cast<size_type>(__index) < size() / 2) { push_front(front()); iterator __front1 = _M_start; ++__front1; @@ -1311,7 +1311,7 @@ typename deque<_Tp,_Alloc,__bufsize>::iterator deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos) { difference_type __index = __pos - _M_start; - if (__index < size() / 2) { + if (static_cast<size_type>(__index) < size() / 2) { push_front(front()); iterator __front1 = _M_start; ++__front1; @@ -1344,7 +1344,7 @@ deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos, const difference_type __elems_before = __pos - _M_start; size_type __length = size(); value_type __x_copy = __x; - if (__elems_before < __length / 2) { + if (static_cast<size_type>(__elems_before) < __length / 2) { iterator __new_start = _M_reserve_elements_at_front(__n); iterator __old_start = _M_start; __pos = _M_start + __elems_before; @@ -1403,7 +1403,7 @@ deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos, { const difference_type __elemsbefore = __pos - _M_start; size_type __length = size(); - if (__elemsbefore < __length / 2) { + if (static_cast<size_type>(__elemsbefore) < __length / 2) { iterator __new_start = _M_reserve_elements_at_front(__n); iterator __old_start = _M_start; __pos = _M_start + __elemsbefore; diff --git a/libstdc++/stl/stl_function.h b/libstdc++/stl/stl_function.h index cd07c1c6730..a5a8486576e 100644 --- a/libstdc++/stl/stl_function.h +++ b/libstdc++/stl/stl_function.h @@ -202,10 +202,10 @@ public: template <class _Operation, class _Tp> inline binder1st<_Operation> -bind1st(const _Operation& __opr, const _Tp& __x) +bind1st(const _Operation& __oper, const _Tp& __x) { typedef typename _Operation::first_argument_type _Arg1_type; - return binder1st<_Operation>(__opr, _Arg1_type(__x)); + return binder1st<_Operation>(__oper, _Arg1_type(__x)); } template <class _Operation> @@ -227,10 +227,10 @@ public: template <class _Operation, class _Tp> inline binder2nd<_Operation> -bind2nd(const _Operation& __opr, const _Tp& __x) +bind2nd(const _Operation& __oper, const _Tp& __x) { typedef typename _Operation::second_argument_type _Arg2_type; - return binder2nd<_Operation>(__opr, _Arg2_type(__x)); + return binder2nd<_Operation>(__oper, _Arg2_type(__x)); } // unary_compose and binary_compose (extensions, not part of the standard). diff --git a/libstdc++/stl/stl_numeric.h b/libstdc++/stl/stl_numeric.h index da7865498ca..392515a3d87 100644 --- a/libstdc++/stl/stl_numeric.h +++ b/libstdc++/stl/stl_numeric.h @@ -177,22 +177,22 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, template <class _Tp, class _Integer, class _MonoidOperation> -_Tp __power(_Tp __x, _Integer __n, _MonoidOperation __opr) +_Tp __power(_Tp __x, _Integer __n, _MonoidOperation __oper) { if (__n == 0) - return identity_element(__opr); + return identity_element(__oper); else { while ((__n & 1) == 0) { __n >>= 1; - __x = __opr(__x, __x); + __x = __oper(__x, __x); } _Tp __result = __x; __n >>= 1; while (__n != 0) { - __x = __opr(__x, __x); + __x = __oper(__x, __x); if ((__n & 1) != 0) - __result = __opr(__result, __x); + __result = __oper(__result, __x); __n >>= 1; } return __result; @@ -209,9 +209,9 @@ inline _Tp __power(_Tp __x, _Integer __n) // not part of the C++ standard. template <class _Tp, class _Integer, class _MonoidOperation> -inline _Tp power(_Tp __x, _Integer __n, _MonoidOperation __opr) +inline _Tp power(_Tp __x, _Integer __n, _MonoidOperation __oper) { - return __power(__x, __n, __opr); + return __power(__x, __n, __oper); } template <class _Tp, class _Integer> diff --git a/libstdc++/stl/stl_queue.h b/libstdc++/stl/stl_queue.h index 489cc4ac442..c1e2b698440 100644 --- a/libstdc++/stl/stl_queue.h +++ b/libstdc++/stl/stl_queue.h @@ -49,33 +49,33 @@ public: typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; protected: - _Sequence _M_c; + _Sequence c; public: - queue() : _M_c() {} - explicit queue(const _Sequence& __c) : _M_c(__c) {} - - bool empty() const { return _M_c.empty(); } - size_type size() const { return _M_c.size(); } - reference front() { return _M_c.front(); } - const_reference front() const { return _M_c.front(); } - reference back() { return _M_c.back(); } - const_reference back() const { return _M_c.back(); } - void push(const value_type& __x) { _M_c.push_back(__x); } - void pop() { _M_c.pop_front(); } + queue() : c() {} + explicit queue(const _Sequence& __c) : c(__c) {} + + bool empty() const { return c.empty(); } + size_type size() const { return c.size(); } + reference front() { return c.front(); } + const_reference front() const { return c.front(); } + reference back() { return c.back(); } + const_reference back() const { return c.back(); } + void push(const value_type& __x) { c.push_back(__x); } + void pop() { c.pop_front(); } }; template <class _Tp, class _Sequence> bool operator==(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y) { - return __x._M_c == __y._M_c; + return __x.c == __y.c; } template <class _Tp, class _Sequence> bool operator<(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y) { - return __x._M_c < __y._M_c; + return __x.c < __y.c; } #ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER @@ -125,69 +125,69 @@ public: typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; protected: - _Sequence _M_c; - _Compare _M_comp; + _Sequence c; + _Compare comp; public: - priority_queue() : _M_c() {} - explicit priority_queue(const _Compare& __x) : _M_c(), _M_comp(__x) {} + priority_queue() : c() {} + explicit priority_queue(const _Compare& __x) : c(), comp(__x) {} priority_queue(const _Compare& __x, const _Sequence& __s) - : _M_c(__s), _M_comp(__x) - { make_heap(_M_c.begin(), _M_c.end(), _M_comp); } + : c(__s), comp(__x) + { make_heap(c.begin(), c.end(), comp); } #ifdef __STL_MEMBER_TEMPLATES template <class _InputIterator> priority_queue(_InputIterator __first, _InputIterator __last) - : _M_c(__first, __last) { make_heap(_M_c.begin(), _M_c.end(), _M_comp); } + : c(__first, __last) { make_heap(c.begin(), c.end(), comp); } template <class _InputIterator> priority_queue(_InputIterator __first, _InputIterator __last, const _Compare& __x) - : _M_c(__first, __last), _M_comp(__x) - { make_heap(_M_c.begin(), _M_c.end(), _M_comp); } + : c(__first, __last), comp(__x) + { make_heap(c.begin(), c.end(), comp); } template <class _InputIterator> priority_queue(_InputIterator __first, _InputIterator __last, const _Compare& __x, const _Sequence& __s) - : _M_c(__s), _M_comp(__x) + : c(__s), comp(__x) { - _M_c.insert(_M_c.end(), __first, __last); - make_heap(_M_c.begin(), _M_c.end(), _M_comp); + c.insert(c.end(), __first, __last); + make_heap(c.begin(), c.end(), comp); } #else /* __STL_MEMBER_TEMPLATES */ priority_queue(const value_type* __first, const value_type* __last) - : _M_c(__first, __last) { make_heap(_M_c.begin(), _M_c.end(), _M_comp); } + : c(__first, __last) { make_heap(c.begin(), c.end(), comp); } priority_queue(const value_type* __first, const value_type* __last, const _Compare& __x) - : _M_c(__first, __last), _M_comp(__x) - { make_heap(_M_c.begin(), _M_c.end(), _M_comp); } + : c(__first, __last), comp(__x) + { make_heap(c.begin(), c.end(), comp); } priority_queue(const value_type* __first, const value_type* __last, const _Compare& __x, const _Sequence& __c) - : _M_c(__c), _M_comp(__x) + : c(__c), comp(__x) { - _M_c.insert(_M_c.end(), __first, __last); - make_heap(_M_c.begin(), _M_c.end(), _M_comp); + c.insert(c.end(), __first, __last); + make_heap(c.begin(), c.end(), comp); } #endif /* __STL_MEMBER_TEMPLATES */ - bool empty() const { return _M_c.empty(); } - size_type size() const { return _M_c.size(); } - const_reference top() const { return _M_c.front(); } + bool empty() const { return c.empty(); } + size_type size() const { return c.size(); } + const_reference top() const { return c.front(); } void push(const value_type& __x) { __STL_TRY { - _M_c.push_back(__x); - push_heap(_M_c.begin(), _M_c.end(), _M_comp); + c.push_back(__x); + push_heap(c.begin(), c.end(), comp); } - __STL_UNWIND(_M_c.clear()); + __STL_UNWIND(c.clear()); } void pop() { __STL_TRY { - pop_heap(_M_c.begin(), _M_c.end(), _M_comp); - _M_c.pop_back(); + pop_heap(c.begin(), c.end(), comp); + c.pop_back(); } - __STL_UNWIND(_M_c.clear()); + __STL_UNWIND(c.clear()); } }; diff --git a/libstdc++/stl/stl_rope.h b/libstdc++/stl/stl_rope.h index 44f51aed1ae..fa1e848c065 100644 --- a/libstdc++/stl/stl_rope.h +++ b/libstdc++/stl/stl_rope.h @@ -386,8 +386,8 @@ struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc> { typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; _Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size, allocator_type __a) - : _M_tag(__t), _M_depth(__d), _M_is_balanced(__b), _M_c_string(0), - _Rope_rep_base<_CharT,_Alloc>(__size, __a) + : _Rope_rep_base<_CharT,_Alloc>(__size, __a), + _M_tag(__t), _M_depth(__d), _M_is_balanced(__b), _M_c_string(0) { # ifndef __GC _M_refcount = 1; @@ -562,8 +562,8 @@ struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> { /* doesn't matter. */ typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; _Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a) - : _M_data(__d) - , _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a) + : _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a), + _M_data(__d) { __stl_assert(__size > 0); if (_S_is_basic_char_type((_CharT *)0)) { @@ -593,10 +593,10 @@ struct _Rope_RopeConcatenation : public _Rope_RopeRep<_CharT,_Alloc> { _Rope_RopeConcatenation(_Rope_RopeRep<_CharT,_Alloc>* __l, _Rope_RopeRep<_CharT,_Alloc>* __r, allocator_type __a) - : _M_left(__l), _M_right(__r) - , _Rope_RopeRep<_CharT,_Alloc>( + : _Rope_RopeRep<_CharT,_Alloc>( _S_concat, max(__l->_M_depth, __r->_M_depth) + 1, false, - __l->_M_size + __r->_M_size, __a) + __l->_M_size + __r->_M_size, __a), + _M_left(__l), _M_right(__r) {} # ifndef __GC ~_Rope_RopeConcatenation() { @@ -629,11 +629,12 @@ struct _Rope_RopeFunction : public _Rope_RopeRep<_CharT,_Alloc> { typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; _Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size, bool __d, allocator_type __a) - : _M_fn(__f) + :_Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a), + _M_fn(__f) # ifndef __GC , _M_delete_when_done(__d) # endif - , _Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a) { + { __stl_assert(__size > 0); # ifdef __GC if (__d) { @@ -693,9 +694,8 @@ struct _Rope_RopeSubstring : public _Rope_RopeFunction<_CharT,_Alloc>, typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; _Rope_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s, size_t __l, allocator_type __a) - : _M_base(__b) + : _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a), _M_base(__b) , _M_start(__s) - , _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a) { __stl_assert(__l > 0); __stl_assert(__s + __l <= __b->_M_size); @@ -766,16 +766,16 @@ class _Rope_char_ref_proxy { _My_rope* _M_root; // The whole rope. public: _Rope_char_ref_proxy(_My_rope* __r, size_t __p) : - _M_pos(__p), _M_root(__r), _M_current_valid(false) {} + _M_pos(__p), _M_current_valid(false), _M_root(__r) {} _Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x) : - _M_pos(__x._M_pos), _M_root(__x._M_root), _M_current_valid(false) {} + _M_pos(__x._M_pos), _M_current_valid(false), _M_root(__x._M_root) {} // Don't preserve cache if the reference can outlive the // expression. We claim that's not possible without calling // a copy constructor or generating reference to a proxy // reference. We declare the latter to have undefined semantics. _Rope_char_ref_proxy(_My_rope* __r, size_t __p, _CharT __c) : - _M_pos(__p), _M_root(__r), _M_current(__c), _M_current_valid(true) {} + _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) {} inline operator _CharT () const; _Rope_char_ref_proxy& operator= (_CharT __c); _Rope_char_ptr_proxy<_CharT,_Alloc> operator& () const; |