Mercurial > hg > CbC > CbC_gcc
diff libstdc++-v3/include/tr1/hashtable.h @ 155:da32f4b04d38
fix __code name conflict
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 17:51:46 +0900 |
parents | 1830386684a0 |
children |
line wrap: on
line diff
--- a/libstdc++-v3/include/tr1/hashtable.h Sat May 23 14:59:38 2020 +0900 +++ b/libstdc++-v3/include/tr1/hashtable.h Mon May 25 17:51:46 2020 +0900 @@ -703,9 +703,9 @@ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: find(const key_type& __k) { - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); - std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); - _Node* __p = _M_find_node(_M_buckets[__n], __k, __code); + typename _Hashtable::_Hash_code_type __code0 = this->_M_hash_code(__k); + std::size_t __n = this->_M_bucket_index(__k, __code0, _M_bucket_count); + _Node* __p = _M_find_node(_M_buckets[__n], __k, __code0); return __p ? iterator(__p, _M_buckets + __n) : this->end(); } @@ -720,9 +720,9 @@ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: find(const key_type& __k) const { - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); - std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); - _Node* __p = _M_find_node(_M_buckets[__n], __k, __code); + typename _Hashtable::_Hash_code_type __code0 = this->_M_hash_code(__k); + std::size_t __n = this->_M_bucket_index(__k, __code0, _M_bucket_count); + _Node* __p = _M_find_node(_M_buckets[__n], __k, __code0); return __p ? const_iterator(__p, _M_buckets + __n) : this->end(); } @@ -737,11 +737,11 @@ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: count(const key_type& __k) const { - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); - std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); + typename _Hashtable::_Hash_code_type __code0 = this->_M_hash_code(__k); + std::size_t __n = this->_M_bucket_index(__k, __code0, _M_bucket_count); std::size_t __result = 0; for (_Node* __p = _M_buckets[__n]; __p; __p = __p->_M_next) - if (this->_M_compare(__k, __code, __p)) + if (this->_M_compare(__k, __code0, __p)) ++__result; return __result; } @@ -762,16 +762,16 @@ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: equal_range(const key_type& __k) { - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); - std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); + typename _Hashtable::_Hash_code_type __code0 = this->_M_hash_code(__k); + std::size_t __n = this->_M_bucket_index(__k, __code0, _M_bucket_count); _Node** __head = _M_buckets + __n; - _Node* __p = _M_find_node(*__head, __k, __code); + _Node* __p = _M_find_node(*__head, __k, __code0); if (__p) { _Node* __p1 = __p->_M_next; for (; __p1; __p1 = __p1->_M_next) - if (!this->_M_compare(__k, __code, __p1)) + if (!this->_M_compare(__k, __code0, __p1)) break; iterator __first(__p, __head); @@ -800,16 +800,16 @@ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: equal_range(const key_type& __k) const { - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); - std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); + typename _Hashtable::_Hash_code_type __code0 = this->_M_hash_code(__k); + std::size_t __n = this->_M_bucket_index(__k, __code0, _M_bucket_count); _Node** __head = _M_buckets + __n; - _Node* __p = _M_find_node(*__head, __k, __code); + _Node* __p = _M_find_node(*__head, __k, __code0); if (__p) { _Node* __p1 = __p->_M_next; for (; __p1; __p1 = __p1->_M_next) - if (!this->_M_compare(__k, __code, __p1)) + if (!this->_M_compare(__k, __code0, __p1)) break; const_iterator __first(__p, __head); @@ -834,10 +834,10 @@ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: _M_find_node(_Node* __p, const key_type& __k, - typename _Hashtable::_Hash_code_type __code) const + typename _Hashtable::_Hash_code_type __code0) const { for (; __p; __p = __p->_M_next) - if (this->_M_compare(__k, __code, __p)) + if (this->_M_compare(__k, __code0, __p)) return __p; return 0; } @@ -853,7 +853,7 @@ _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: _M_insert_bucket(const value_type& __v, size_type __n, - typename _Hashtable::_Hash_code_type __code) + typename _Hashtable::_Hash_code_type __code0) { std::pair<bool, std::size_t> __do_rehash = _M_rehash_policy._M_need_rehash(_M_bucket_count, @@ -868,12 +868,12 @@ if (__do_rehash.first) { const key_type& __k = this->_M_extract(__v); - __n = this->_M_bucket_index(__k, __code, __do_rehash.second); + __n = this->_M_bucket_index(__k, __code0, __do_rehash.second); _M_rehash(__do_rehash.second); } __new_node->_M_next = _M_buckets[__n]; - this->_M_store_code(__new_node, __code); + this->_M_store_code(__new_node, __code0); _M_buckets[__n] = __new_node; ++_M_element_count; return iterator(__new_node, _M_buckets + __n); @@ -899,12 +899,12 @@ _M_insert(const value_type& __v, std::tr1::true_type) { const key_type& __k = this->_M_extract(__v); - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); - size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count); + typename _Hashtable::_Hash_code_type __code0 = this->_M_hash_code(__k); + size_type __n = this->_M_bucket_index(__k, __code0, _M_bucket_count); - if (_Node* __p = _M_find_node(_M_buckets[__n], __k, __code)) + if (_Node* __p = _M_find_node(_M_buckets[__n], __k, __code0)) return std::make_pair(iterator(__p, _M_buckets + __n), false); - return std::make_pair(_M_insert_bucket(__v, __n, __code), true); + return std::make_pair(_M_insert_bucket(__v, __n, __code0), true); } // Insert v unconditionally. @@ -926,11 +926,11 @@ _M_rehash(__do_rehash.second); const key_type& __k = this->_M_extract(__v); - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); - size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count); + typename _Hashtable::_Hash_code_type __code0 = this->_M_hash_code(__k); + size_type __n = this->_M_bucket_index(__k, __code0, _M_bucket_count); // First find the node, avoid leaking new_node if compare throws. - _Node* __prev = _M_find_node(_M_buckets[__n], __k, __code); + _Node* __prev = _M_find_node(_M_buckets[__n], __k, __code0); _Node* __new_node = _M_allocate_node(__v); if (__prev) @@ -943,7 +943,7 @@ __new_node->_M_next = _M_buckets[__n]; _M_buckets[__n] = __new_node; } - this->_M_store_code(__new_node, __code); + this->_M_store_code(__new_node, __code0); ++_M_element_count; return iterator(__new_node, _M_buckets + __n); @@ -1043,16 +1043,16 @@ _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: erase(const key_type& __k) { - typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); - std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); + typename _Hashtable::_Hash_code_type __code0 = this->_M_hash_code(__k); + std::size_t __n = this->_M_bucket_index(__k, __code0, _M_bucket_count); size_type __result = 0; _Node** __slot = _M_buckets + __n; - while (*__slot && !this->_M_compare(__k, __code, *__slot)) + while (*__slot && !this->_M_compare(__k, __code0, *__slot)) __slot = &((*__slot)->_M_next); _Node** __saved_slot = 0; - while (*__slot && this->_M_compare(__k, __code, *__slot)) + while (*__slot && this->_M_compare(__k, __code0, *__slot)) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 526. Is it undefined if a function in the standard changes