Unordered: Avoid -Wshadow warnings. Refs #6190.

[SVN r78364]
This commit is contained in:
Daniel James
2012-05-07 10:57:35 +00:00
parent 995ef1efdb
commit 275b03e76b
26 changed files with 105 additions and 101 deletions

View File

@@ -253,12 +253,12 @@ namespace boost { namespace unordered { namespace detail {
template <class Key, class Pred>
iterator find_node_impl(
std::size_t hash,
std::size_t key_hash,
Key const& k,
Pred const& eq) const
{
std::size_t bucket_index =
policy::to_bucket(this->bucket_count_, hash);
policy::to_bucket(this->bucket_count_, key_hash);
iterator n = this->get_start(bucket_index);
for (;;)
@@ -266,7 +266,7 @@ namespace boost { namespace unordered { namespace detail {
if (!n.node_) return n;
std::size_t node_hash = n.node_->hash_;
if (hash == node_hash)
if (key_hash == node_hash)
{
if (eq(k, this->get_key(*n)))
return n;
@@ -334,13 +334,13 @@ namespace boost { namespace unordered { namespace detail {
inline iterator add_node(
node_constructor& a,
std::size_t hash)
std::size_t key_hash)
{
node_pointer n = a.release();
n->hash_ = hash;
n->hash_ = key_hash;
bucket_pointer b = this->get_bucket(
policy::to_bucket(this->bucket_count_, hash));
policy::to_bucket(this->bucket_count_, key_hash));
if (!b->next_)
{
@@ -370,8 +370,8 @@ namespace boost { namespace unordered { namespace detail {
{
typedef typename value_type::second_type mapped_type;
std::size_t hash = this->hash(k);
iterator pos = this->find_node(hash, k);
std::size_t key_hash = this->hash(k);
iterator pos = this->find_node(key_hash, k);
if (pos.node_) return *pos;
@@ -391,7 +391,7 @@ namespace boost { namespace unordered { namespace detail {
#endif
this->reserve_for_insert(this->size_ + 1);
return *add_node(a, hash);
return *add_node(a, key_hash);
}
#if defined(BOOST_NO_RVALUE_REFERENCES)
@@ -431,8 +431,8 @@ namespace boost { namespace unordered { namespace detail {
emplace_return emplace_impl(key_type const& k,
BOOST_UNORDERED_EMPLACE_ARGS)
{
std::size_t hash = this->hash(k);
iterator pos = this->find_node(hash, k);
std::size_t key_hash = this->hash(k);
iterator pos = this->find_node(key_hash, k);
if (pos.node_) return emplace_return(pos, false);
@@ -445,21 +445,21 @@ namespace boost { namespace unordered { namespace detail {
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
this->reserve_for_insert(this->size_ + 1);
return emplace_return(this->add_node(a, hash), true);
return emplace_return(this->add_node(a, key_hash), true);
}
emplace_return emplace_impl_with_node(node_constructor& a)
{
key_type const& k = this->get_key(a.value());
std::size_t hash = this->hash(k);
iterator pos = this->find_node(hash, k);
std::size_t key_hash = this->hash(k);
iterator pos = this->find_node(key_hash, k);
if (pos.node_) return emplace_return(pos, false);
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
this->reserve_for_insert(this->size_ + 1);
return emplace_return(this->add_node(a, hash), true);
return emplace_return(this->add_node(a, key_hash), true);
}
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
@@ -515,12 +515,12 @@ namespace boost { namespace unordered { namespace detail {
void insert_range_empty(node_constructor& a, key_type const& k,
InputIt i, InputIt j)
{
std::size_t hash = this->hash(k);
std::size_t key_hash = this->hash(k);
a.construct_node();
a.construct_value2(*i);
this->reserve_for_insert(this->size_ +
boost::unordered::detail::insert_size(i, j));
this->add_node(a, hash);
this->add_node(a, key_hash);
}
template <class InputIt>
@@ -528,8 +528,8 @@ namespace boost { namespace unordered { namespace detail {
InputIt i, InputIt j)
{
// No side effects in this initial code
std::size_t hash = this->hash(k);
iterator pos = this->find_node(hash, k);
std::size_t key_hash = this->hash(k);
iterator pos = this->find_node(key_hash, k);
if (!pos.node_) {
a.construct_node();
@@ -540,7 +540,7 @@ namespace boost { namespace unordered { namespace detail {
boost::unordered::detail::insert_size(i, j));
// Nothing after this point can throw.
this->add_node(a, hash);
this->add_node(a, key_hash);
}
}
@@ -565,12 +565,12 @@ namespace boost { namespace unordered { namespace detail {
{
if(!this->size_) return 0;
std::size_t hash = this->hash(k);
std::size_t key_hash = this->hash(k);
std::size_t bucket_index =
policy::to_bucket(this->bucket_count_, hash);
bucket_pointer bucket = this->get_bucket(bucket_index);
policy::to_bucket(this->bucket_count_, key_hash);
bucket_pointer this_bucket = this->get_bucket(bucket_index);
previous_pointer prev = bucket->next_;
previous_pointer prev = this_bucket->next_;
if (!prev) return 0;
for (;;)
@@ -581,7 +581,7 @@ namespace boost { namespace unordered { namespace detail {
if (policy::to_bucket(this->bucket_count_, node_hash)
!= bucket_index)
return 0;
if (node_hash == hash &&
if (node_hash == key_hash &&
this->key_eq()(k, this->get_key(
static_cast<node_pointer>(prev->next_)->value())))
break;
@@ -591,7 +591,7 @@ namespace boost { namespace unordered { namespace detail {
node_pointer pos = static_cast<node_pointer>(prev->next_);
node_pointer end = static_cast<node_pointer>(pos->next_);
prev->next_ = pos->next_;
this->fix_buckets(bucket, prev, end);
this->fix_buckets(this_bucket, prev, end);
return this->delete_nodes(c_iterator(pos), c_iterator(end));
}
@@ -601,11 +601,11 @@ namespace boost { namespace unordered { namespace detail {
iterator next(r.node_);
++next;
bucket_pointer bucket = this->get_bucket(
bucket_pointer this_bucket = this->get_bucket(
policy::to_bucket(this->bucket_count_, r.node_->hash_));
previous_pointer prev = unlink_node(*bucket, r.node_);
previous_pointer prev = unlink_node(*this_bucket, r.node_);
this->fix_buckets(bucket, prev, next.node_);
this->fix_buckets(this_bucket, prev, next.node_);
this->delete_node(r);