From 4e7a241da748f7f9f0a30b7af0b86588a1e76426 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Sat, 12 Apr 2014 18:04:06 +0200
Subject: [PATCH 1/4] ptr_container: fix GCC -Wshadow warnings
Signed-off-by: Michael Stahl <mstahl@redhat.com>
---
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
|
b
|
namespace move_ptrs {
|
20 | 20 | template<typename Ptr> |
21 | 21 | class move_source { |
22 | 22 | public: |
23 | | move_source(Ptr& ptr) : ptr_(ptr) {} |
| 23 | move_source(Ptr& _ptr) : ptr_(_ptr) {} |
24 | 24 | Ptr& ptr() const { return ptr_; } |
25 | 25 | private: |
26 | 26 | 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
|
b
|
namespace ptr_container_detail
|
278 | 278 | |
279 | 279 | private: |
280 | 280 | template< class ForwardIterator > |
281 | | ForwardIterator advance( ForwardIterator begin, size_type n ) |
| 281 | ForwardIterator advance( ForwardIterator begin_, size_type n ) |
282 | 282 | { |
283 | | ForwardIterator iter = begin; |
| 283 | ForwardIterator iter = begin_; |
284 | 284 | std::advance( iter, n ); |
285 | 285 | return iter; |
286 | 286 | } |
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
|
b
|
public:
|
151 | 151 | deleter_const_reference get_deleter() const { return impl_.second(); } |
152 | 152 | private: |
153 | 153 | template<typename TT, typename DD> |
154 | | void check(const static_move_ptr<TT, DD>& ptr) |
| 154 | void check(const static_move_ptr<TT, DD>&) |
155 | 155 | { |
156 | 156 | typedef move_ptrs::is_smart_ptr_convertible<TT, T> convertible; |
157 | 157 | 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
|
b
|
namespace boost
|
24 | 24 | { |
25 | 25 | const char* what_; |
26 | 26 | public: |
27 | | bad_ptr_container_operation( const char* what ) : what_( what ) |
| 27 | bad_ptr_container_operation( const char* _what ) : what_( _what ) |
28 | 28 | { } |
29 | 29 | |
30 | 30 | virtual const char* what() const throw() |
… |
… |
namespace boost
|
38 | 38 | class bad_index : public bad_ptr_container_operation |
39 | 39 | { |
40 | 40 | public: |
41 | | bad_index( const char* what ) : bad_ptr_container_operation( what ) |
| 41 | bad_index( const char* _what ) : bad_ptr_container_operation( _what ) |
42 | 42 | { } |
43 | 43 | }; |
44 | 44 | |
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
|
b
|
namespace ptr_container_detail
|
476 | 476 | public: // C-array support |
477 | 477 | |
478 | 478 | void transfer( iterator before, value_type* from, |
479 | | size_type size, bool delete_from = true ) // strong |
| 479 | size_type size_, bool delete_from = true ) // strong |
480 | 480 | { |
481 | 481 | BOOST_ASSERT( from != 0 ); |
482 | 482 | if( delete_from ) |
483 | 483 | { |
484 | 484 | BOOST_DEDUCED_TYPENAME base_type::scoped_deleter |
485 | | deleter( from, size ); // nothrow |
486 | | this->base().insert( before.base(), from, from + size ); // strong |
| 485 | deleter( from, size_ ); // nothrow |
| 486 | this->base().insert( before.base(), from, from + size_ ); // strong |
487 | 487 | deleter.release(); // nothrow |
488 | 488 | } |
489 | 489 | else |
490 | 490 | { |
491 | | this->base().insert( before.base(), from, from + size ); // strong |
| 491 | this->base().insert( before.base(), from, from + size_ ); // strong |
492 | 492 | } |
493 | 493 | } |
494 | 494 | |
… |
… |
namespace ptr_container_detail
|
510 | 510 | |
511 | 511 | public: // resize |
512 | 512 | |
513 | | void resize( size_type size ) // basic |
| 513 | void resize( size_type size_ ) // basic |
514 | 514 | { |
515 | 515 | size_type old_size = this->size(); |
516 | | if( old_size > size ) |
| 516 | if( old_size > size_ ) |
517 | 517 | { |
518 | | this->erase( boost::next( this->begin(), size ), this->end() ); |
| 518 | this->erase( boost::next( this->begin(), size_ ), this->end() ); |
519 | 519 | } |
520 | | else if( size > old_size ) |
| 520 | else if( size_ > old_size ) |
521 | 521 | { |
522 | | for( ; old_size != size; ++old_size ) |
| 522 | for( ; old_size != size_; ++old_size ) |
523 | 523 | this->push_back( new BOOST_DEDUCED_TYPENAME |
524 | 524 | boost::remove_pointer<value_type>::type() ); |
525 | 525 | } |
526 | 526 | |
527 | | BOOST_ASSERT( this->size() == size ); |
| 527 | BOOST_ASSERT( this->size() == size_ ); |
528 | 528 | } |
529 | 529 | |
530 | | void resize( size_type size, value_type to_clone ) // basic |
| 530 | void resize( size_type size_, value_type to_clone ) // basic |
531 | 531 | { |
532 | 532 | size_type old_size = this->size(); |
533 | | if( old_size > size ) |
| 533 | if( old_size > size_ ) |
534 | 534 | { |
535 | | this->erase( boost::next( this->begin(), size ), this->end() ); |
| 535 | this->erase( boost::next( this->begin(), size_ ), this->end() ); |
536 | 536 | } |
537 | | else if( size > old_size ) |
| 537 | else if( size_ > old_size ) |
538 | 538 | { |
539 | | for( ; old_size != size; ++old_size ) |
| 539 | for( ; old_size != size_; ++old_size ) |
540 | 540 | this->push_back( this->null_policy_allocate_clone( to_clone ) ); |
541 | 541 | } |
542 | 542 | |
543 | | BOOST_ASSERT( this->size() == size ); |
| 543 | BOOST_ASSERT( this->size() == size_ ); |
544 | 544 | } |
545 | 545 | |
546 | | void rresize( size_type size ) // basic |
| 546 | void rresize( size_type size_ ) // basic |
547 | 547 | { |
548 | 548 | size_type old_size = this->size(); |
549 | | if( old_size > size ) |
| 549 | if( old_size > size_ ) |
550 | 550 | { |
551 | 551 | this->erase( this->begin(), |
552 | | boost::next( this->begin(), old_size - size ) ); |
| 552 | boost::next( this->begin(), old_size - size_ ) ); |
553 | 553 | } |
554 | | else if( size > old_size ) |
| 554 | else if( size_ > old_size ) |
555 | 555 | { |
556 | | for( ; old_size != size; ++old_size ) |
| 556 | for( ; old_size != size_; ++old_size ) |
557 | 557 | this->push_front( new BOOST_DEDUCED_TYPENAME |
558 | 558 | boost::remove_pointer<value_type>::type() ); |
559 | 559 | } |
560 | 560 | |
561 | | BOOST_ASSERT( this->size() == size ); |
| 561 | BOOST_ASSERT( this->size() == size_ ); |
562 | 562 | } |
563 | 563 | |
564 | | void rresize( size_type size, value_type to_clone ) // basic |
| 564 | void rresize( size_type size_, value_type to_clone ) // basic |
565 | 565 | { |
566 | 566 | size_type old_size = this->size(); |
567 | | if( old_size > size ) |
| 567 | if( old_size > size_ ) |
568 | 568 | { |
569 | 569 | this->erase( this->begin(), |
570 | | boost::next( this->begin(), old_size - size ) ); |
| 570 | boost::next( this->begin(), old_size - size_ ) ); |
571 | 571 | } |
572 | | else if( size > old_size ) |
| 572 | else if( size_ > old_size ) |
573 | 573 | { |
574 | | for( ; old_size != size; ++old_size ) |
| 574 | for( ; old_size != size_; ++old_size ) |
575 | 575 | this->push_front( this->null_policy_allocate_clone( to_clone ) ); |
576 | 576 | } |
577 | 577 | |
578 | | BOOST_ASSERT( this->size() == size ); |
| 578 | BOOST_ASSERT( this->size() == size_ ); |
579 | 579 | } |
580 | 580 | |
581 | 581 | public: // algorithms |