From 113008b54b1405325b472e7eef9811c1340560f3 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Wed, 11 Apr 2007 01:11:56 +0000 Subject: [PATCH] cc_hash_max_collision_check_resize_trigger_imp.hpp: Qualify namespace std members. 2007-04-10 Benjamin Kosnik * include/ext/pb_ds/detail/resize_policy/ cc_hash_max_collision_check_resize_trigger_imp.hpp: Qualify namespace std members. * include/ext/pb_ds/detail/list_update_policy/ counter_lu_metadata.hpp: Same. * include/ext/throw_allocator.h: Same. * include/ext/pod_char_traits.h: Same. * include/ext/malloc_allocator.h: Same. * libsupc++/del_op.cc: Same, simplify. * include/bits/c++config: Adjust macro name. * include/c_global/cstring: Alphabetize. * include/c_global/cwctype: Same. From-SVN: r123710 --- libstdc++-v3/ChangeLog | 17 ++++++++ libstdc++-v3/include/bits/c++config | 2 +- libstdc++-v3/include/c_global/cstring | 43 +++++++++---------- libstdc++-v3/include/c_global/cwctype | 5 +-- libstdc++-v3/include/ext/malloc_allocator.h | 7 +-- .../counter_lu_metadata.hpp | 4 +- ...max_collision_check_resize_trigger_imp.hpp | 4 +- libstdc++-v3/include/ext/pod_char_traits.h | 4 +- libstdc++-v3/include/ext/throw_allocator.h | 4 +- libstdc++-v3/libsupc++/del_op.cc | 22 +++++----- 10 files changed, 64 insertions(+), 48 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7df035d03d06..68f0447bb710 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,20 @@ +2007-04-10 Benjamin Kosnik + + * include/ext/pb_ds/detail/resize_policy/ + cc_hash_max_collision_check_resize_trigger_imp.hpp: Qualify + namespace std members. + * include/ext/pb_ds/detail/list_update_policy/ + counter_lu_metadata.hpp: Same. + * include/ext/throw_allocator.h: Same. + * include/ext/pod_char_traits.h: Same. + * include/ext/malloc_allocator.h: Same. + * libsupc++/del_op.cc: Same, simplify. + + * include/bits/c++config: Adjust macro name. + + * include/c_global/cstring: Alphabetize. + * include/c_global/cwctype: Same. + 2007-04-10 Paolo Carlini * include/tr1/cmath: Include instead of diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index b11d27a1640d..f4e951c50ab6 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -51,7 +51,7 @@ // includes that inject C90/C99 names into the global namespace. // XXX May not be necessary #if __cplusplus == 199711L -# define _GLIBCXX_NAMESPACE_C 1 +# define _GLIBCXX_NAMESPACE_GLOBAL_INJECTION 1 #endif // Macros for visibility. diff --git a/libstdc++-v3/include/c_global/cstring b/libstdc++-v3/include/c_global/cstring index c797aca16b45..c41df692cdf1 100644 --- a/libstdc++-v3/include/c_global/cstring +++ b/libstdc++-v3/include/c_global/cstring @@ -52,50 +52,49 @@ #define _GLIBCXX_CSTRING 1 // Get rid of those macros defined in in lieu of real functions. +#undef memchr +#undef memcmp #undef memcpy #undef memmove -#undef strcpy -#undef strncpy +#undef memset #undef strcat -#undef strncat -#undef memcmp +#undef strchr #undef strcmp #undef strcoll -#undef strncmp -#undef strxfrm -#undef memchr -#undef strchr +#undef strcpy #undef strcspn +#undef strerror +#undef strlen +#undef strncat +#undef strncmp +#undef strncpy #undef strpbrk #undef strrchr #undef strspn #undef strstr #undef strtok -#undef memset -#undef strerror -#undef strlen +#undef strxfrm _GLIBCXX_BEGIN_NAMESPACE(std) + using ::memchr; + using ::memcmp; using ::memcpy; using ::memmove; - using ::strcpy; - using ::strncpy; + using ::memset; using ::strcat; - using ::strncat; - using ::memcmp; using ::strcmp; using ::strcoll; - using ::strncmp; - using ::strxfrm; + using ::strcpy; using ::strcspn; - using ::strspn; - using ::strtok; - using ::memset; using ::strerror; using ::strlen; - - using ::memchr; + using ::strncat; + using ::strncmp; + using ::strncpy; + using ::strspn; + using ::strtok; + using ::strxfrm; inline void* memchr(void* __p, int __c, size_t __n) diff --git a/libstdc++-v3/include/c_global/cwctype b/libstdc++-v3/include/c_global/cwctype index ab97b8dc9b5a..5c8d59846b3b 100644 --- a/libstdc++-v3/include/c_global/cwctype +++ b/libstdc++-v3/include/c_global/cwctype @@ -79,10 +79,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std) - using ::wint_t; // cwchar - - using ::wctype_t; using ::wctrans_t; + using ::wctype_t; + using ::wint_t; using ::iswalnum; using ::iswalpha; diff --git a/libstdc++-v3/include/ext/malloc_allocator.h b/libstdc++-v3/include/ext/malloc_allocator.h index 0f23e06c8e8a..531045b63253 100644 --- a/libstdc++-v3/include/ext/malloc_allocator.h +++ b/libstdc++-v3/include/ext/malloc_allocator.h @@ -1,6 +1,7 @@ // Allocator that wraps "C" malloc -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 +// 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 @@ -89,7 +90,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) if (__builtin_expect(__n > this->max_size(), false)) std::__throw_bad_alloc(); - pointer __ret = static_cast<_Tp*>(malloc(__n * sizeof(_Tp))); + pointer __ret = static_cast<_Tp*>(std::malloc(__n * sizeof(_Tp))); if (!__ret) std::__throw_bad_alloc(); return __ret; @@ -98,7 +99,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // __p is not permitted to be a null pointer. void deallocate(pointer __p, size_type) - { free(static_cast(__p)); } + { std::free(static_cast(__p)); } size_type max_size() const throw() diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp index d8cd28916831..e02c6fbfe49f 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007 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 terms @@ -76,7 +76,7 @@ namespace pb_ds counter_lu_metadata operator()(size_type max_size) const - { return counter_lu_metadata(rand() % max_size); } + { return counter_lu_metadata(std::rand() % max_size); } template bool diff --git a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp index 3ade0c7e16cb..fa3a056f1fc3 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp @@ -161,8 +161,8 @@ PB_DS_CLASS_C_DEC:: calc_max_num_coll() { // max_col <-- \sqrt{2 load \ln( 2 m \ln( m ) ) } - const double ln_arg = 2 * m_size * ::log(double(m_size)); - m_max_col = size_type(::ceil(::sqrt(2 * m_load * ::log(ln_arg)))); + const double ln_arg = 2 * m_size * std::log(double(m_size)); + m_max_col = size_type(std::ceil(std::sqrt(2 * m_load * std::log(ln_arg)))); #ifdef PB_DS_HT_MAP_RESIZE_TRACE_ std::cerr << "chmccrt::calc_max_num_coll " diff --git a/libstdc++-v3/include/ext/pod_char_traits.h b/libstdc++-v3/include/ext/pod_char_traits.h index 236e349cd44e..ab3d99e12efe 100644 --- a/libstdc++-v3/include/ext/pod_char_traits.h +++ b/libstdc++-v3/include/ext/pod_char_traits.h @@ -1,6 +1,6 @@ // POD character, std::char_traits specialization -*- C++ -*- -// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2002, 2003, 2004, 2005, 2007 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 @@ -46,7 +46,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // int_type to properly hold the full range of char_type values as // well as EOF. /// @brief A POD class that serves as a character abstraction class. - template + template struct character { typedef V value_type; diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h index 112fb739d705..869aa4245ec5 100644 --- a/libstdc++-v3/include/ext/throw_allocator.h +++ b/libstdc++-v3/include/ext/throw_allocator.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007 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 terms @@ -109,7 +109,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) : _M_throw_prob_orig(_S_throw_prob) { _S_throw_prob = - 1 - ::pow(double(1 - _S_throw_prob), double(0.5 / (size + 1))); + 1 - std::pow(double(1 - _S_throw_prob), double(0.5 / (size + 1))); } ~group_throw_prob_adjustor() diff --git a/libstdc++-v3/libsupc++/del_op.cc b/libstdc++-v3/libsupc++/del_op.cc index 93f4aa8373cb..e4bbffaba305 100644 --- a/libstdc++-v3/libsupc++/del_op.cc +++ b/libstdc++-v3/libsupc++/del_op.cc @@ -1,6 +1,6 @@ // Boilerplate support routines for -*- C++ -*- dynamic memory management. -// Copyright (C) 1997, 1998, 1999, 2000, 2004 Free Software Foundation +// Copyright (C) 1997, 1998, 1999, 2000, 2004, 2007 Free Software Foundation // // This file is part of GCC. // @@ -29,22 +29,22 @@ // the GNU General Public License. #include -#include "new" -#if _GLIBCXX_HOSTED -#include -#endif -#if _GLIBCXX_HOSTED -using std::free; -#else +#if !_GLIBCXX_HOSTED // A freestanding C runtime may not provide "free" -- but there is no // other reasonable way to implement "operator delete". -extern "C" void free(void *); +_GLIBCXX_BEGIN_NAMESPACE(std) + extern "C" void free(void*); +_GLIBCXX_END_NAMESPACE +#else +# include #endif +#include "new" + _GLIBCXX_WEAK_DEFINITION void -operator delete (void *ptr) throw () +operator delete(void* ptr) throw () { if (ptr) - free (ptr); + std::free(ptr); }