patch std::

Marc Glisse marc.glisse@normalesup.org
Tue May 9 15:05:00 GMT 2006


Hello,

I attach a patch that does not break anything on i686-pc-linux-gnu.
(I know I don't have the paperwork done yet, but if this isn't considered 
a minor patch...)

In eh_alloc.cc, I believe it is a typo, since the code looks like:
#if ...
using std::memcpy;
#else
extern "C" void *memset (void *, int, std::size_t);
#endif
and the file uses memset but never memcpy. If it is not a typo, then a 
comment explaining the purpose would be welcome.

The rest are just some missing std:: in include/.

I do not touch the testsuite, there are just too many tests that are not 
supposed to work and only work because of the special way gcc does things. 
(plenty of missing std:: in particular)

-- 
Marc Glisse
-------------- next part --------------
2006-05-05  Marc Glisse  <marc.glisse@normalesup.org>

	* include/ext/pool_allocator.h: Add missing std::.
	* include/ext/mt_allocator.h: Likewise.
	* include/ext/pb_assoc/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp: Likewise.
	* include/ext/pb_assoc/detail/resize_policy/hash_standard_resize_policy_imp.hpp: Likewise.
	* include/ext/pb_assoc/detail/lu_policy/counter_lu_metadata_imp.hpp: Likewise.
	* include/ext/pb_assoc/detail/map_debug_base.hpp: Likewise.
	* libsupc++/eh_alloc.cc: Typo: memcpy -> memset.

Index: include/ext/pool_allocator.h
===================================================================
--- include/ext/pool_allocator.h	(r??vision 113527)
+++ include/ext/pool_allocator.h	(copie de travail)
@@ -204,7 +204,7 @@
 	  // to efficiently support threading found in basic_string.h.
 	  if (_S_force_new == 0)
 	    {
-	      if (getenv("GLIBCXX_FORCE_NEW"))
+	      if (std::getenv("GLIBCXX_FORCE_NEW"))
 		__atomic_add(&_S_force_new, 1);
 	      else
 		__atomic_add(&_S_force_new, -1);
Index: include/ext/pb_assoc/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
===================================================================
--- include/ext/pb_assoc/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp	(r??vision 113527)
+++ include/ext/pb_assoc/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp	(copie de travail)
@@ -336,7 +336,7 @@
 PB_ASSOC_CLASS_C_DEC::
 do_resize(size_type /*new_size*/)
 {
-  abort();
+  std::abort();
 }
 
 #ifdef PB_ASSOC_HT_LOAD_CHECK_RESIZE_TRIGGER_DEBUG
Index: include/ext/pb_assoc/detail/resize_policy/hash_standard_resize_policy_imp.hpp
===================================================================
--- include/ext/pb_assoc/detail/resize_policy/hash_standard_resize_policy_imp.hpp	(r??vision 113527)
+++ include/ext/pb_assoc/detail/resize_policy/hash_standard_resize_policy_imp.hpp	(copie de travail)
@@ -306,7 +306,7 @@
 do_resize(size_type /*new_size*/)
 {
   // Tmp Ami
-  abort();
+  std::abort();
 }
 
 PB_ASSOC_CLASS_T_DEC
Index: include/ext/pb_assoc/detail/lu_policy/counter_lu_metadata_imp.hpp
===================================================================
--- include/ext/pb_assoc/detail/lu_policy/counter_lu_metadata_imp.hpp	(r??vision 113527)
+++ include/ext/pb_assoc/detail/lu_policy/counter_lu_metadata_imp.hpp	(copie de travail)
@@ -48,7 +48,7 @@
 PB_ASSOC_CLASS_C_DEC::
 operator()(size_type m_max_count) const
 {
-  return (counter_lu_metadata<Size_Type>(rand() % m_max_count));
+  return (counter_lu_metadata<Size_Type>(std::rand() % m_max_count));
 }
 
 PB_ASSOC_CLASS_T_DEC
Index: include/ext/pb_assoc/detail/map_debug_base.hpp
===================================================================
--- include/ext/pb_assoc/detail/map_debug_base.hpp	(r??vision 113527)
+++ include/ext/pb_assoc/detail/map_debug_base.hpp	(copie de travail)
@@ -154,7 +154,7 @@
 	set_throw_prob(0);
 
       if (m_key_set.find(r_key) != m_key_set.end())
-	abort();
+	std::abort();
 
       try
 	{
@@ -178,12 +178,12 @@
     erase_existing(const_key_reference r_key)
     {
       if (m_key_set.find(r_key) == m_key_set.end())
-	abort();
+	std::abort();
 
       m_key_set.erase(r_key);
 
       if (m_key_set.find(r_key) != m_key_set.end())
-	abort();
+	std::abort();
     }
 
     PB_ASSOC_CLASS_T_DEC
@@ -200,7 +200,7 @@
     check_key_exists(const_key_reference r_key) const
     {
       if (m_key_set.find(r_key) == m_key_set.end())
-	abort();
+	std::abort();
     }
 
     PB_ASSOC_CLASS_T_DEC
@@ -209,7 +209,7 @@
     check_key_does_not_exist(const_key_reference r_key) const
     {
       if (m_key_set.find(r_key) != m_key_set.end())
-	abort();
+	std::abort();
     }
 
     PB_ASSOC_CLASS_T_DEC
@@ -220,7 +220,7 @@
       const size_type key_set_size = m_key_set.size();
 
       if (size != key_set_size)
-	abort();
+	std::abort();
     }
 
     PB_ASSOC_CLASS_T_DEC
Index: include/ext/mt_allocator.h
===================================================================
--- include/ext/mt_allocator.h	(r??vision 113527)
+++ include/ext/mt_allocator.h	(copie de travail)
@@ -111,7 +111,7 @@
       : _M_align(_S_align), _M_max_bytes(_S_max_bytes), _M_min_bin(_S_min_bin),
       _M_chunk_size(_S_chunk_size), _M_max_threads(_S_max_threads), 
       _M_freelist_headroom(_S_freelist_headroom), 
-      _M_force_new(getenv("GLIBCXX_FORCE_NEW") ? true : false)
+      _M_force_new(std::getenv("GLIBCXX_FORCE_NEW") ? true : false)
       { }
 
       explicit
@@ -480,7 +480,7 @@
 			     sizeof(_Tp) * size_t(_Tune::_S_chunk_size),
 			     _Tune::_S_max_threads,
 			     _Tune::_S_freelist_headroom,
-			     getenv("GLIBCXX_FORCE_NEW") ? true : false);
+			     std::getenv("GLIBCXX_FORCE_NEW") ? true : false);
 	static pool_type _S_pool(_S_tune);
 	return _S_pool;
       }
Index: libsupc++/eh_alloc.cc
===================================================================
--- libsupc++/eh_alloc.cc	(r??vision 113527)
+++ libsupc++/eh_alloc.cc	(copie de travail)
@@ -44,7 +44,7 @@
 #if _GLIBCXX_HOSTED
 using std::free;
 using std::malloc;
-using std::memcpy;
+using std::memset;
 #else
 // In a freestanding environment, these functions may not be available
 // -- but for now, we assume that they are.


More information about the Libstdc++ mailing list