changeset 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 2eca1fb48fa2
children a4a7bdaf5ae6
files libstdc++-v3/include/bits/hashtable_policy.h libstdc++-v3/include/tr1/hashtable.h libstdc++-v3/include/tr1/hashtable_policy.h
diffstat 3 files changed, 52 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/libstdc++-v3/include/bits/hashtable_policy.h	Sat May 23 14:59:38 2020 +0900
+++ b/libstdc++-v3/include/bits/hashtable_policy.h	Mon May 25 17:51:46 2020 +0900
@@ -705,9 +705,9 @@
     -> mapped_type&
     {
       __hashtable* __h = static_cast<__hashtable*>(this);
-      __hash_code __code = __h->_M_hash_code(__k);
-      std::size_t __bkt = __h->_M_bucket_index(__k, __code);
-      if (__node_type* __node = __h->_M_find_node(__bkt, __k, __code))
+      __hash_code __code0 = __h->_M_hash_code(__k);
+      std::size_t __bkt = __h->_M_bucket_index(__k, __code0);
+      if (__node_type* __node = __h->_M_find_node(__bkt, __k, __code0))
 	return __node->_M_v().second;
 
       typename __hashtable::_Scoped_node __node {
@@ -717,7 +717,7 @@
 	std::tuple<>()
       };
       auto __pos
-	= __h->_M_insert_unique_node(__k, __bkt, __code, __node._M_node);
+	= __h->_M_insert_unique_node(__k, __bkt, __code0, __node._M_node);
       __node._M_node = nullptr;
       return __pos->second;
     }
@@ -732,9 +732,9 @@
     -> mapped_type&
     {
       __hashtable* __h = static_cast<__hashtable*>(this);
-      __hash_code __code = __h->_M_hash_code(__k);
-      std::size_t __bkt = __h->_M_bucket_index(__k, __code);
-      if (__node_type* __node = __h->_M_find_node(__bkt, __k, __code))
+      __hash_code __code0 = __h->_M_hash_code(__k);
+      std::size_t __bkt = __h->_M_bucket_index(__k, __code0);
+      if (__node_type* __node = __h->_M_find_node(__bkt, __k, __code0))
 	return __node->_M_v().second;
 
       typename __hashtable::_Scoped_node __node {
@@ -744,7 +744,7 @@
 	std::tuple<>()
       };
       auto __pos
-	= __h->_M_insert_unique_node(__k, __bkt, __code, __node._M_node);
+	= __h->_M_insert_unique_node(__k, __bkt, __code0, __node._M_node);
       __node._M_node = nullptr;
       return __pos->second;
     }
@@ -759,9 +759,9 @@
     -> mapped_type&
     {
       __hashtable* __h = static_cast<__hashtable*>(this);
-      __hash_code __code = __h->_M_hash_code(__k);
-      std::size_t __bkt = __h->_M_bucket_index(__k, __code);
-      __node_type* __p = __h->_M_find_node(__bkt, __k, __code);
+      __hash_code __code0 = __h->_M_hash_code(__k);
+      std::size_t __bkt = __h->_M_bucket_index(__k, __code0);
+      __node_type* __p = __h->_M_find_node(__bkt, __k, __code0);
 
       if (!__p)
 	__throw_out_of_range(__N("_Map_base::at"));
@@ -778,9 +778,9 @@
     -> const mapped_type&
     {
       const __hashtable* __h = static_cast<const __hashtable*>(this);
-      __hash_code __code = __h->_M_hash_code(__k);
-      std::size_t __bkt = __h->_M_bucket_index(__k, __code);
-      __node_type* __p = __h->_M_find_node(__bkt, __k, __code);
+      __hash_code __code0 = __h->_M_hash_code(__k);
+      std::size_t __bkt = __h->_M_bucket_index(__k, __code0);
+      __node_type* __p = __h->_M_find_node(__bkt, __k, __code0);
 
       if (!__p)
 	__throw_out_of_range(__N("_Map_base::at"));
--- 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
--- a/libstdc++-v3/include/tr1/hashtable_policy.h	Sat May 23 14:59:38 2020 +0900
+++ b/libstdc++-v3/include/tr1/hashtable_policy.h	Mon May 25 17:51:46 2020 +0900
@@ -515,15 +515,15 @@
     operator[](const _Key& __k)
     {
       _Hashtable* __h = static_cast<_Hashtable*>(this);
-      typename _Hashtable::_Hash_code_type __code = __h->_M_hash_code(__k);
-      std::size_t __n = __h->_M_bucket_index(__k, __code,
+      typename _Hashtable::_Hash_code_type __code0 = __h->_M_hash_code(__k);
+      std::size_t __n = __h->_M_bucket_index(__k, __code0,
 					     __h->_M_bucket_count);
 
       typename _Hashtable::_Node* __p =
-	__h->_M_find_node(__h->_M_buckets[__n], __k, __code);
+	__h->_M_find_node(__h->_M_buckets[__n], __k, __code0);
       if (!__p)
 	return __h->_M_insert_bucket(std::make_pair(__k, mapped_type()),
-				     __n, __code)->second;
+				     __n, __code0)->second;
       return (__p->_M_v).second;
     }