diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-24 14:32:21 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-24 14:32:21 +0000 |
commit | 1e939a2b52c97be79dd3ea4fdadb2ff8cdca0042 (patch) | |
tree | c5ede4b98170a2831fb15e797760ac3107d73366 /libstdc++-v3 | |
parent | 41819b5f8f2df6a3a1d2d07b379aeda026484670 (diff) | |
download | ppe42-gcc-1e939a2b52c97be79dd3ea4fdadb2ff8cdca0042.tar.gz ppe42-gcc-1e939a2b52c97be79dd3ea4fdadb2ff8cdca0042.zip |
2007-12-24 Paolo Carlini <pcarlini@suse.de>
* include/tr1_impl/hashtable_policy.h (_Prime_rehash_policy::
_M_next_bkt, _M_bkt_for_elements, _M_need_rehash): Use __builtin_ceil.
* include/std/unordered_map: Do not include <cmath>; prefer
<bits/stringfwd.h> to <string>.
* include/std/unordered_set: Likewise.
* include/tr1/unordered_map: Likewise.
* include/tr1/unordered_set: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131157 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/std/unordered_map | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/std/unordered_set | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1/unordered_map | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1/unordered_set | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1_impl/hashtable_policy.h | 17 |
6 files changed, 24 insertions, 19 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c058ac73a85..99da8b58815 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,15 @@ 2007-12-24 Paolo Carlini <pcarlini@suse.de> + * include/tr1_impl/hashtable_policy.h (_Prime_rehash_policy:: + _M_next_bkt, _M_bkt_for_elements, _M_need_rehash): Use __builtin_ceil. + * include/std/unordered_map: Do not include <cmath>; prefer + <bits/stringfwd.h> to <string>. + * include/std/unordered_set: Likewise. + * include/tr1/unordered_map: Likewise. + * include/tr1/unordered_set: Likewise. + +2007-12-24 Paolo Carlini <pcarlini@suse.de> + * include/std/complex (complex<float>::complex(float, float)): Uglify parameters. diff --git a/libstdc++-v3/include/std/unordered_map b/libstdc++-v3/include/std/unordered_map index 226fea8b106..4ce80514d68 100644 --- a/libstdc++-v3/include/std/unordered_map +++ b/libstdc++-v3/include/std/unordered_map @@ -44,13 +44,12 @@ # error C++0x header cannot be included from TR1 header #endif -#include <cmath> -#include <string> #include <utility> #include <algorithm> // lower_bound +#include <type_traits> #include <bits/allocator.h> #include <bits/stl_function.h> // equal_to, _Identity, _Select1st -#include <type_traits> +#include <bits/stringfwd.h> #include <bits/functional_hash.h> #include <bits/hashtable.h> diff --git a/libstdc++-v3/include/std/unordered_set b/libstdc++-v3/include/std/unordered_set index 3b0f22c3418..3cc69372b6f 100644 --- a/libstdc++-v3/include/std/unordered_set +++ b/libstdc++-v3/include/std/unordered_set @@ -44,13 +44,12 @@ # error C++0x header cannot be included from TR1 header #endif -#include <cmath> -#include <string> #include <utility> #include <algorithm> // lower_bound +#include <type_traits> #include <bits/allocator.h> #include <bits/stl_function.h> // equal_to, _Identity, _Select1st -#include <type_traits> +#include <bits/stringfwd.h> #include <bits/functional_hash.h> #include <bits/hashtable.h> diff --git a/libstdc++-v3/include/tr1/unordered_map b/libstdc++-v3/include/tr1/unordered_map index 85e8f0015c4..041eb9443cf 100644 --- a/libstdc++-v3/include/tr1/unordered_map +++ b/libstdc++-v3/include/tr1/unordered_map @@ -40,12 +40,11 @@ # error TR1 header cannot be included from C++0x header #endif -#include <cmath> -#include <string> #include <utility> #include <algorithm> // lower_bound #include <bits/allocator.h> #include <bits/stl_function.h> // equal_to, _Identity, _Select1st +#include <bits/stringfwd.h> #include <tr1/type_traits> #include <tr1/functional_hash.h> #include <tr1/hashtable.h> diff --git a/libstdc++-v3/include/tr1/unordered_set b/libstdc++-v3/include/tr1/unordered_set index 35c605ff681..16181681f55 100644 --- a/libstdc++-v3/include/tr1/unordered_set +++ b/libstdc++-v3/include/tr1/unordered_set @@ -40,12 +40,11 @@ # error TR1 header cannot be included from C++0x header #endif -#include <cmath> -#include <string> #include <utility> #include <algorithm> // lower_bound #include <bits/allocator.h> #include <bits/stl_function.h> // equal_to, _Identity, _Select1st +#include <bits/stringfwd.h> #include <tr1/type_traits> #include <tr1/functional_hash.h> #include <tr1/hashtable.h> diff --git a/libstdc++-v3/include/tr1_impl/hashtable_policy.h b/libstdc++-v3/include/tr1_impl/hashtable_policy.h index 514d444420e..b74531c2ddf 100644 --- a/libstdc++-v3/include/tr1_impl/hashtable_policy.h +++ b/libstdc++-v3/include/tr1_impl/hashtable_policy.h @@ -425,8 +425,8 @@ namespace __detail { const unsigned long* __p = std::lower_bound(__prime_list, __prime_list + _S_n_primes, __n); - _M_next_resize = static_cast<std::size_t>(std::ceil(*__p - * _M_max_load_factor)); + _M_next_resize = + static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor)); return *__p; } @@ -439,8 +439,8 @@ namespace __detail const float __min_bkts = __n / _M_max_load_factor; const unsigned long* __p = std::lower_bound(__prime_list, __prime_list + _S_n_primes, __min_bkts); - _M_next_resize = static_cast<std::size_t>(std::ceil(*__p - * _M_max_load_factor)); + _M_next_resize = + static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor)); return *__p; } @@ -468,15 +468,14 @@ namespace __detail const unsigned long* __p = std::lower_bound(__prime_list, __prime_list + _S_n_primes, __min_bkts); - _M_next_resize = - static_cast<std::size_t>(std::ceil(*__p * _M_max_load_factor)); + _M_next_resize = static_cast<std::size_t> + (__builtin_ceil(*__p * _M_max_load_factor)); return std::make_pair(true, *__p); } else { - _M_next_resize = - static_cast<std::size_t>(std::ceil(__n_bkt - * _M_max_load_factor)); + _M_next_resize = static_cast<std::size_t> + (__builtin_ceil(__n_bkt * _M_max_load_factor)); return std::make_pair(false, 0); } } |