hashtable.h: -Wshadow fixes.
2006-11-21 Benjamin Kosnik <bkoz@redhat.com> * include/ext/hashtable.h: -Wshadow fixes. * include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/ constructors_destructor_fn_imps.hpp: Same. * src/mt_allocator.cc: Same. * src/debug.cc: Same. * config/locale/gnu/codecvt_members.cc: Same. From-SVN: r119061
This commit is contained in:
parent
7ddd83802b
commit
1ab7948178
@ -1,3 +1,18 @@
|
||||
2006-11-21 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* include/ext/hashtable.h: -Wshadow fixes.
|
||||
* include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp: Same.
|
||||
* include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp: Same.
|
||||
* include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Same.
|
||||
* include/ext/pb_ds/detail/gp_hash_table_map_/
|
||||
constructor_destructor_fn_imps.hpp: Same.
|
||||
* include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp: Same.
|
||||
* include/ext/pb_ds/detail/ov_tree_map_/
|
||||
constructors_destructor_fn_imps.hpp: Same.
|
||||
* src/mt_allocator.cc: Same.
|
||||
* src/debug.cc: Same.
|
||||
* config/locale/gnu/codecvt_members.cc: Same.
|
||||
|
||||
2006-11-21 Benjamin Kosnik <bkoz@redhat.com>
|
||||
Howard Hinnant <hhinnant@apple.com>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// std::codecvt implementation details, GNU version -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
@ -95,14 +95,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
{
|
||||
extern_type __buf[MB_LEN_MAX];
|
||||
__tmp_state = __state;
|
||||
const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
|
||||
if (__conv > static_cast<size_t>(__to_end - __to_next))
|
||||
const size_t __conv2 = wcrtomb(__buf, *__from_next, &__tmp_state);
|
||||
if (__conv2 > static_cast<size_t>(__to_end - __to_next))
|
||||
__ret = partial;
|
||||
else
|
||||
{
|
||||
memcpy(__to_next, __buf, __conv);
|
||||
memcpy(__to_next, __buf, __conv2);
|
||||
__state = __tmp_state;
|
||||
__to_next += __conv;
|
||||
__to_next += __conv2;
|
||||
++__from_next;
|
||||
}
|
||||
}
|
||||
|
@ -713,7 +713,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
__cur1 = __cur1->_M_next)
|
||||
{
|
||||
bool _found__cur1 = false;
|
||||
for (_Node* __cur2 = __ht2._M_buckets[__n];
|
||||
for (__cur2 = __ht2._M_buckets[__n];
|
||||
__cur2; __cur2 = __cur2->_M_next)
|
||||
{
|
||||
if (__cur1->_M_val == __cur2->_M_val)
|
||||
|
@ -131,8 +131,8 @@ join(PB_DS_CLASS_C_DEC& other)
|
||||
_GLIBCXX_DEBUG_ONLY(assert_valid();)
|
||||
_GLIBCXX_DEBUG_ONLY(other.assert_valid();)
|
||||
|
||||
const size_type size = m_size + other.m_size;
|
||||
const size_type actual_size = resize_policy::get_new_size_for_arbitrary(size);
|
||||
const size_type len = m_size + other.m_size;
|
||||
const size_type actual_size = resize_policy::get_new_size_for_arbitrary(len);
|
||||
|
||||
entry_pointer a_entries = NULL;
|
||||
entry_pointer a_other_entries = NULL;
|
||||
@ -158,7 +158,7 @@ join(PB_DS_CLASS_C_DEC& other)
|
||||
|
||||
s_entry_allocator.deallocate(m_a_entries, m_actual_size);
|
||||
m_a_entries = a_entries;
|
||||
m_size = size;
|
||||
m_size = len;
|
||||
m_actual_size = actual_size;
|
||||
|
||||
resize_policy::notify_arbitrary(actual_size);
|
||||
|
@ -64,7 +64,6 @@ inline typename PB_DS_CLASS_C_DEC::size_type
|
||||
PB_DS_CLASS_C_DEC::
|
||||
erase_if(Pred pred)
|
||||
{
|
||||
typedef typename PB_DS_TYPES_TRAITS_C_DEC::const_reference const_reference;
|
||||
size_type num_ersd = 0;
|
||||
for (size_type pos = 0; pos < m_num_e; ++pos)
|
||||
{
|
||||
|
@ -58,8 +58,8 @@ do_resize_if_needed()
|
||||
PB_DS_CLASS_T_DEC
|
||||
void
|
||||
PB_DS_CLASS_C_DEC::
|
||||
do_resize(size_type size)
|
||||
{ resize_imp(resize_base::get_nearest_larger_size(size)); }
|
||||
do_resize(size_type len)
|
||||
{ resize_imp(resize_base::get_nearest_larger_size(len)); }
|
||||
|
||||
PB_DS_CLASS_T_DEC
|
||||
inline void
|
||||
|
@ -110,10 +110,10 @@ PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
|
||||
PB_DS_CLASS_T_DEC
|
||||
PB_DS_CLASS_C_DEC::
|
||||
PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
|
||||
const Comb_Probe_Fn& comb_hash_fn, const Probe_Fn& probe_fn)
|
||||
const Comb_Probe_Fn& comb_hash_fn, const Probe_Fn& prober)
|
||||
: hash_eq_fn_base(r_eq_fn),
|
||||
ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
|
||||
r_hash_fn, comb_hash_fn, probe_fn),
|
||||
r_hash_fn, comb_hash_fn, prober),
|
||||
m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
|
||||
m_entries(s_entry_allocator.allocate(m_num_e))
|
||||
{
|
||||
@ -124,11 +124,11 @@ PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
|
||||
PB_DS_CLASS_T_DEC
|
||||
PB_DS_CLASS_C_DEC::
|
||||
PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn,
|
||||
const Comb_Probe_Fn& comb_hash_fn, const Probe_Fn& probe_fn,
|
||||
const Comb_Probe_Fn& comb_hash_fn, const Probe_Fn& prober,
|
||||
const Resize_Policy& r_resize_policy)
|
||||
: hash_eq_fn_base(r_eq_fn), resize_base(r_resize_policy),
|
||||
ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
|
||||
r_hash_fn, comb_hash_fn, probe_fn),
|
||||
r_hash_fn, comb_hash_fn, prober),
|
||||
m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
|
||||
m_entries(s_entry_allocator.allocate(m_num_e))
|
||||
{
|
||||
@ -205,9 +205,9 @@ deallocate_all()
|
||||
PB_DS_CLASS_T_DEC
|
||||
void
|
||||
PB_DS_CLASS_C_DEC::
|
||||
erase_all_valid_entries(entry_array a_entries_resized, size_type size)
|
||||
erase_all_valid_entries(entry_array a_entries_resized, size_type len)
|
||||
{
|
||||
for (size_type pos = 0; pos < size; ++pos)
|
||||
for (size_type pos = 0; pos < len; ++pos)
|
||||
{
|
||||
entry_pointer p_e = &a_entries_resized[pos];
|
||||
if (p_e->m_stat == valid_entry_status)
|
||||
|
@ -137,16 +137,16 @@ void
|
||||
PB_DS_CLASS_C_DEC::
|
||||
copy_from_ordered_range(It first_it, It last_it)
|
||||
{
|
||||
const size_type size = std::distance(first_it, last_it);
|
||||
if (size == 0)
|
||||
const size_type len = std::distance(first_it, last_it);
|
||||
if (len == 0)
|
||||
return;
|
||||
|
||||
value_vector a_values = s_value_alloc.allocate(size);
|
||||
value_vector a_values = s_value_alloc.allocate(len);
|
||||
iterator target_it = a_values;
|
||||
It source_it = first_it;
|
||||
It source_end_it = last_it;
|
||||
|
||||
cond_dtor<size_type> cd(a_values, target_it, size);
|
||||
cond_dtor<size_type> cd(a_values, target_it, len);
|
||||
while (source_it != source_end_it)
|
||||
{
|
||||
new (const_cast<void* >(static_cast<const void* >(target_it)))
|
||||
@ -155,10 +155,10 @@ copy_from_ordered_range(It first_it, It last_it)
|
||||
++target_it;
|
||||
}
|
||||
|
||||
reallocate_metadata((node_update* )this, size);
|
||||
reallocate_metadata((node_update* )this, len);
|
||||
cd.set_no_action();
|
||||
m_a_values = a_values;
|
||||
m_size = size;
|
||||
m_size = len;
|
||||
m_end_it = m_a_values + m_size;
|
||||
update(PB_DS_node_begin_imp(), (node_update* )this);
|
||||
|
||||
@ -181,16 +181,16 @@ copy_from_ordered_range(It first_it, It last_it, It other_first_it,
|
||||
It other_last_it)
|
||||
{
|
||||
clear();
|
||||
const size_type size = std::distance(first_it, last_it)
|
||||
const size_type len = std::distance(first_it, last_it)
|
||||
+ std::distance(other_first_it, other_last_it);
|
||||
|
||||
value_vector a_values = s_value_alloc.allocate(size);
|
||||
value_vector a_values = s_value_alloc.allocate(len);
|
||||
|
||||
iterator target_it = a_values;
|
||||
It source_it = first_it;
|
||||
It source_end_it = last_it;
|
||||
|
||||
cond_dtor<size_type> cd(a_values, target_it, size);
|
||||
cond_dtor<size_type> cd(a_values, target_it, len);
|
||||
while (source_it != source_end_it)
|
||||
{
|
||||
new (const_cast<void* >(static_cast<const void* >(target_it)))
|
||||
@ -208,10 +208,10 @@ copy_from_ordered_range(It first_it, It last_it, It other_first_it,
|
||||
++target_it;
|
||||
}
|
||||
|
||||
reallocate_metadata((node_update* )this, size);
|
||||
reallocate_metadata((node_update* )this, len);
|
||||
cd.set_no_action();
|
||||
m_a_values = a_values;
|
||||
m_size = size;
|
||||
m_size = len;
|
||||
m_end_it = m_a_values + m_size;
|
||||
update(PB_DS_node_begin_imp(), (node_update* )this);
|
||||
|
||||
|
@ -243,9 +243,9 @@ namespace pb_ds
|
||||
|
||||
PB_DS_CLASS_T_DEC
|
||||
PB_DS_CLASS_C_DEC::
|
||||
pat_trie_internal_node(size_type e_ind, const const_e_iterator pref_b_it) :
|
||||
pat_trie_internal_node(size_type len, const const_e_iterator it) :
|
||||
PB_DS_BASE_C_DEC(pat_trie_internal_node_type),
|
||||
m_e_ind(e_ind), m_pref_b_it(pref_b_it), m_pref_e_it(pref_b_it)
|
||||
m_e_ind(len), m_pref_b_it(it), m_pref_e_it(it)
|
||||
{
|
||||
std::advance(m_pref_e_it, m_e_ind);
|
||||
std::fill(m_a_p_children, m_a_p_children + arr_size,
|
||||
|
@ -587,7 +587,7 @@ namespace __gnu_debug
|
||||
_M_print_string(const char* __string) const
|
||||
{
|
||||
const char* __start = __string;
|
||||
const char* __end = __start;
|
||||
const char* __finish = __start;
|
||||
const int __bufsize = 128;
|
||||
char __buf[__bufsize];
|
||||
|
||||
@ -595,21 +595,21 @@ namespace __gnu_debug
|
||||
{
|
||||
if (*__start != '%')
|
||||
{
|
||||
// [__start, __end) denotes the next word
|
||||
__end = __start;
|
||||
while (isalnum(*__end))
|
||||
++__end;
|
||||
if (__start == __end)
|
||||
++__end;
|
||||
if (isspace(*__end))
|
||||
++__end;
|
||||
// [__start, __finish) denotes the next word
|
||||
__finish = __start;
|
||||
while (isalnum(*__finish))
|
||||
++__finish;
|
||||
if (__start == __finish)
|
||||
++__finish;
|
||||
if (isspace(*__finish))
|
||||
++__finish;
|
||||
|
||||
const ptrdiff_t __len = __end - __start;
|
||||
const ptrdiff_t __len = __finish - __start;
|
||||
assert(__len < __bufsize);
|
||||
memcpy(__buf, __start, __len);
|
||||
__buf[__len] = '\0';
|
||||
_M_print_word(__buf);
|
||||
__start = __end;
|
||||
__start = __finish;
|
||||
|
||||
// Skip extra whitespace
|
||||
while (*__start == ' ')
|
||||
|
@ -423,7 +423,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
__bin._M_address = __address;
|
||||
|
||||
char* __c = static_cast<char*>(__v) + sizeof(_Block_address);
|
||||
_Block_record* __block = reinterpret_cast<_Block_record*>(__c);
|
||||
__block = reinterpret_cast<_Block_record*>(__c);
|
||||
__bin._M_first[0] = __block;
|
||||
while (--__block_count > 0)
|
||||
{
|
||||
@ -505,8 +505,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
const size_t __k = sizeof(_Thread_record)
|
||||
* _M_options._M_max_threads;
|
||||
__v = ::operator new(__k);
|
||||
_Thread_record* _M_thread_freelist
|
||||
= static_cast<_Thread_record*>(__v);
|
||||
_M_thread_freelist = static_cast<_Thread_record*>(__v);
|
||||
|
||||
// NOTE! The first assignable thread id is 1 since the
|
||||
// global pool uses id 0
|
||||
@ -528,8 +527,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
// _M_thread_freelist.
|
||||
__gthread_key_create(&freelist._M_key,
|
||||
::_M_destroy_thread_key);
|
||||
freelist._M_thread_freelist
|
||||
= _M_thread_freelist;
|
||||
freelist._M_thread_freelist = _M_thread_freelist;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -552,10 +550,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
}
|
||||
::operator delete(static_cast<void*>(_M_old_array));
|
||||
}
|
||||
freelist._M_thread_freelist_array
|
||||
= _M_thread_freelist;
|
||||
freelist._M_max_threads
|
||||
= _M_options._M_max_threads;
|
||||
freelist._M_thread_freelist_array = _M_thread_freelist;
|
||||
freelist._M_max_threads = _M_options._M_max_threads;
|
||||
}
|
||||
}
|
||||
|
||||
@ -570,7 +566,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
__bin._M_address = NULL;
|
||||
|
||||
__v = ::operator new(sizeof(size_t) * __max_threads);
|
||||
std::memset(__v, 0, sizeof(size_t) * __max_threads);
|
||||
std::memset(__v, 0, sizeof(size_t) * __max_threads);
|
||||
|
||||
__bin._M_free = static_cast<size_t*>(__v);
|
||||
|
||||
__v = ::operator new(sizeof(size_t) * __max_threads
|
||||
@ -630,8 +627,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
}
|
||||
}
|
||||
|
||||
__gthread_setspecific(freelist._M_key,
|
||||
(void*)_M_id);
|
||||
__gthread_setspecific(freelist._M_key, (void*)_M_id);
|
||||
}
|
||||
return _M_id >= _M_options._M_max_threads ? 0 : _M_id;
|
||||
}
|
||||
@ -697,14 +693,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
__gnu_cxx::__scoped_lock sentry(freelist_mutex);
|
||||
|
||||
if (!freelist._M_thread_freelist_array
|
||||
|| freelist._M_max_threads
|
||||
< _M_options._M_max_threads)
|
||||
|| freelist._M_max_threads < _M_options._M_max_threads)
|
||||
{
|
||||
const size_t __k = sizeof(_Thread_record)
|
||||
* _M_options._M_max_threads;
|
||||
__v = ::operator new(__k);
|
||||
_Thread_record* _M_thread_freelist
|
||||
= static_cast<_Thread_record*>(__v);
|
||||
_M_thread_freelist = static_cast<_Thread_record*>(__v);
|
||||
|
||||
// NOTE! The first assignable thread id is 1 since the
|
||||
// global pool uses id 0
|
||||
|
Loading…
Reference in New Issue
Block a user