summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-21 18:10:45 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-21 18:10:45 +0000
commit4aa6630bbd7abadd3f184afa9d13c5f0fcbfd8b5 (patch)
tree1bd095d1f392dffccea7ff12e58fbb48ac9c17e5 /libstdc++-v3
parent74301837842e62270719ee2e5fa3abca6f497792 (diff)
downloadgcc-4aa6630bbd7abadd3f184afa9d13c5f0fcbfd8b5.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119061 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog15
-rw-r--r--libstdc++-v3/config/locale/gnu/codecvt_members.cc10
-rw-r--r--libstdc++-v3/include/ext/hashtable.h2
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp6
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp1
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp4
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp12
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp22
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp4
-rw-r--r--libstdc++-v3/src/debug.cc22
-rw-r--r--libstdc++-v3/src/mt_allocator.cc26
11 files changed, 66 insertions, 58 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 77fde781027..e8a4a3fc8f5 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,4 +1,19 @@
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>
* src/iostream-inst.cc: Remove iostream include.
diff --git a/libstdc++-v3/config/locale/gnu/codecvt_members.cc b/libstdc++-v3/config/locale/gnu/codecvt_members.cc
index bc454228d67..ac1fe9267c8 100644
--- a/libstdc++-v3/config/locale/gnu/codecvt_members.cc
+++ b/libstdc++-v3/config/locale/gnu/codecvt_members.cc
@@ -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;
}
}
diff --git a/libstdc++-v3/include/ext/hashtable.h b/libstdc++-v3/include/ext/hashtable.h
index 9c274bf829a..233806fb745 100644
--- a/libstdc++-v3/include/ext/hashtable.h
+++ b/libstdc++-v3/include/ext/hashtable.h
@@ -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)
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
index 936d825e324..679efa5c475 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
@@ -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);
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
index 80e06e94b8f..265a7052780 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
@@ -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)
{
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
index 57f8b970d52..eda2c48da52 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
@@ -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
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
index 1491a91671e..30b8d3e7b73 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
@@ -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)
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
index ecd6aeab386..83a47250f83 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
@@ -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);
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp
index 41329e2715b..1061988c327 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp
@@ -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,
diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc
index d3935842be9..be5ba01b7ea 100644
--- a/libstdc++-v3/src/debug.cc
+++ b/libstdc++-v3/src/debug.cc
@@ -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 == ' ')
diff --git a/libstdc++-v3/src/mt_allocator.cc b/libstdc++-v3/src/mt_allocator.cc
index 4385fbc84bf..da0b09cef21 100644
--- a/libstdc++-v3/src/mt_allocator.cc
+++ b/libstdc++-v3/src/mt_allocator.cc
@@ -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