From 4e7a241da748f7f9f0a30b7af0b86588a1e76426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 12 Apr 2014 18:04:06 +0200 Subject: [PATCH 1/4] ptr_container: fix GCC -Wshadow warnings Signed-off-by: Michael Stahl --- include/boost/ptr_container/detail/move.hpp | 2 +- .../detail/reversible_ptr_container.hpp | 4 +- .../boost/ptr_container/detail/static_move_ptr.hpp | 2 +- include/boost/ptr_container/exception.hpp | 4 +- .../boost/ptr_container/ptr_sequence_adapter.hpp | 56 +++++++++++----------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/include/boost/ptr_container/detail/move.hpp b/include/boost/ptr_container/detail/move.hpp index bf07d5f..6b082a7 100755 --- a/include/boost/ptr_container/detail/move.hpp +++ b/include/boost/ptr_container/detail/move.hpp @@ -20,7 +20,7 @@ namespace move_ptrs { template class move_source { public: - move_source(Ptr& ptr) : ptr_(ptr) {} + move_source(Ptr& _ptr) : ptr_(_ptr) {} Ptr& ptr() const { return ptr_; } private: Ptr& ptr_; diff --git a/include/boost/ptr_container/detail/reversible_ptr_container.hpp b/include/boost/ptr_container/detail/reversible_ptr_container.hpp index 47c3903..bb0eb0e 100644 --- a/include/boost/ptr_container/detail/reversible_ptr_container.hpp +++ b/include/boost/ptr_container/detail/reversible_ptr_container.hpp @@ -278,9 +278,9 @@ namespace ptr_container_detail private: template< class ForwardIterator > - ForwardIterator advance( ForwardIterator begin, size_type n ) + ForwardIterator advance( ForwardIterator begin_, size_type n ) { - ForwardIterator iter = begin; + ForwardIterator iter = begin_; std::advance( iter, n ); return iter; } diff --git a/include/boost/ptr_container/detail/static_move_ptr.hpp b/include/boost/ptr_container/detail/static_move_ptr.hpp index 6af3461..e9515ff 100644 --- a/include/boost/ptr_container/detail/static_move_ptr.hpp +++ b/include/boost/ptr_container/detail/static_move_ptr.hpp @@ -151,7 +151,7 @@ public: deleter_const_reference get_deleter() const { return impl_.second(); } private: template - void check(const static_move_ptr& ptr) + void check(const static_move_ptr&) { typedef move_ptrs::is_smart_ptr_convertible convertible; BOOST_STATIC_ASSERT(convertible::value); diff --git a/include/boost/ptr_container/exception.hpp b/include/boost/ptr_container/exception.hpp index d9a5ffe..d85f771 100755 --- a/include/boost/ptr_container/exception.hpp +++ b/include/boost/ptr_container/exception.hpp @@ -24,7 +24,7 @@ namespace boost { const char* what_; public: - bad_ptr_container_operation( const char* what ) : what_( what ) + bad_ptr_container_operation( const char* _what ) : what_( _what ) { } virtual const char* what() const throw() @@ -38,7 +38,7 @@ namespace boost class bad_index : public bad_ptr_container_operation { public: - bad_index( const char* what ) : bad_ptr_container_operation( what ) + bad_index( const char* _what ) : bad_ptr_container_operation( _what ) { } }; diff --git a/include/boost/ptr_container/ptr_sequence_adapter.hpp b/include/boost/ptr_container/ptr_sequence_adapter.hpp index a7717ed..1d44ae5 100644 --- a/include/boost/ptr_container/ptr_sequence_adapter.hpp +++ b/include/boost/ptr_container/ptr_sequence_adapter.hpp @@ -476,19 +476,19 @@ namespace ptr_container_detail public: // C-array support void transfer( iterator before, value_type* from, - size_type size, bool delete_from = true ) // strong + size_type size_, bool delete_from = true ) // strong { BOOST_ASSERT( from != 0 ); if( delete_from ) { BOOST_DEDUCED_TYPENAME base_type::scoped_deleter - deleter( from, size ); // nothrow - this->base().insert( before.base(), from, from + size ); // strong + deleter( from, size_ ); // nothrow + this->base().insert( before.base(), from, from + size_ ); // strong deleter.release(); // nothrow } else { - this->base().insert( before.base(), from, from + size ); // strong + this->base().insert( before.base(), from, from + size_ ); // strong } } @@ -510,72 +510,72 @@ namespace ptr_container_detail public: // resize - void resize( size_type size ) // basic + void resize( size_type size_ ) // basic { size_type old_size = this->size(); - if( old_size > size ) + if( old_size > size_ ) { - this->erase( boost::next( this->begin(), size ), this->end() ); + this->erase( boost::next( this->begin(), size_ ), this->end() ); } - else if( size > old_size ) + else if( size_ > old_size ) { - for( ; old_size != size; ++old_size ) + for( ; old_size != size_; ++old_size ) this->push_back( new BOOST_DEDUCED_TYPENAME boost::remove_pointer::type() ); } - BOOST_ASSERT( this->size() == size ); + BOOST_ASSERT( this->size() == size_ ); } - void resize( size_type size, value_type to_clone ) // basic + void resize( size_type size_, value_type to_clone ) // basic { size_type old_size = this->size(); - if( old_size > size ) + if( old_size > size_ ) { - this->erase( boost::next( this->begin(), size ), this->end() ); + this->erase( boost::next( this->begin(), size_ ), this->end() ); } - else if( size > old_size ) + else if( size_ > old_size ) { - for( ; old_size != size; ++old_size ) + for( ; old_size != size_; ++old_size ) this->push_back( this->null_policy_allocate_clone( to_clone ) ); } - BOOST_ASSERT( this->size() == size ); + BOOST_ASSERT( this->size() == size_ ); } - void rresize( size_type size ) // basic + void rresize( size_type size_ ) // basic { size_type old_size = this->size(); - if( old_size > size ) + if( old_size > size_ ) { this->erase( this->begin(), - boost::next( this->begin(), old_size - size ) ); + boost::next( this->begin(), old_size - size_ ) ); } - else if( size > old_size ) + else if( size_ > old_size ) { - for( ; old_size != size; ++old_size ) + for( ; old_size != size_; ++old_size ) this->push_front( new BOOST_DEDUCED_TYPENAME boost::remove_pointer::type() ); } - BOOST_ASSERT( this->size() == size ); + BOOST_ASSERT( this->size() == size_ ); } - void rresize( size_type size, value_type to_clone ) // basic + void rresize( size_type size_, value_type to_clone ) // basic { size_type old_size = this->size(); - if( old_size > size ) + if( old_size > size_ ) { this->erase( this->begin(), - boost::next( this->begin(), old_size - size ) ); + boost::next( this->begin(), old_size - size_ ) ); } - else if( size > old_size ) + else if( size_ > old_size ) { - for( ; old_size != size; ++old_size ) + for( ; old_size != size_; ++old_size ) this->push_front( this->null_policy_allocate_clone( to_clone ) ); } - BOOST_ASSERT( this->size() == size ); + BOOST_ASSERT( this->size() == size_ ); } public: // algorithms -- 1.8.3.1