diff options
author | Howard Hinnant <hhinnant@apple.com> | 2011-12-01 20:21:04 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2011-12-01 20:21:04 +0000 |
commit | c206366fd7774aff222578c2680b931a4c2c35ba (patch) | |
tree | 754a1c9a558a9c1e4e1774aec8ac5268ba3d2afe /libcxx/include/algorithm | |
parent | ab0ad4ed1eea577056d76a4b76734dae881955d3 (diff) | |
download | bcm5719-llvm-c206366fd7774aff222578c2680b931a4c2c35ba.tar.gz bcm5719-llvm-c206366fd7774aff222578c2680b931a4c2c35ba.zip |
Quash a whole bunch of warnings
llvm-svn: 145624
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r-- | libcxx/include/algorithm | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 7c250a9beb8..4679845e132 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -697,14 +697,48 @@ struct __debug_less #endif // _LIBCPP_DEBUG2 // Precondition: __x != 0 -inline _LIBCPP_INLINE_VISIBILITY unsigned __ctz(unsigned __x) {return __builtin_ctz (__x);} -inline _LIBCPP_INLINE_VISIBILITY unsigned long __ctz(unsigned long __x) {return __builtin_ctzl (__x);} -inline _LIBCPP_INLINE_VISIBILITY unsigned long long __ctz(unsigned long long __x) {return __builtin_ctzll(__x);} +inline _LIBCPP_INLINE_VISIBILITY +unsigned +__ctz(unsigned __x) +{ + return static_cast<unsigned>(__builtin_ctz(__x)); +} + +inline _LIBCPP_INLINE_VISIBILITY +unsigned long +__ctz(unsigned long __x) +{ + return static_cast<unsigned long>(__builtin_ctzl(__x)); +} + +inline _LIBCPP_INLINE_VISIBILITY +unsigned long long +__ctz(unsigned long long __x) +{ + return static_cast<unsigned long long>(__builtin_ctzll(__x)); +} // Precondition: __x != 0 -inline _LIBCPP_INLINE_VISIBILITY unsigned __clz(unsigned __x) {return __builtin_clz (__x);} -inline _LIBCPP_INLINE_VISIBILITY unsigned long __clz(unsigned long __x) {return __builtin_clzl (__x);} -inline _LIBCPP_INLINE_VISIBILITY unsigned long long __clz(unsigned long long __x) {return __builtin_clzll(__x);} +inline _LIBCPP_INLINE_VISIBILITY +unsigned +__clz(unsigned __x) +{ + return static_cast<unsigned>(__builtin_clz(__x)); +} + +inline _LIBCPP_INLINE_VISIBILITY +unsigned long +__clz(unsigned long __x) +{ + return static_cast<unsigned long>(__builtin_clzl (__x)); +} + +inline _LIBCPP_INLINE_VISIBILITY +unsigned long long +__clz(unsigned long long __x) +{ + return static_cast<unsigned long long>(__builtin_clzll(__x)); +} inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned __x) {return __builtin_popcount (__x);} inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long __x) {return __builtin_popcountl (__x);} @@ -2678,8 +2712,8 @@ public: result_type operator()(); - static const/*expr*/ result_type min() {return _Min;} - static const/*expr*/ result_type max() {return _Max;} + static constexpr result_type min() {return _Min;} + static constexpr result_type max() {return _Max;} friend __rs_default __rs_get(); }; @@ -3721,7 +3755,7 @@ extern template bool __insertion_sort_incomplete<__less<long double>&, long doub extern template unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&); #ifdef _MSC_VER #pragma warning( pop ) -#endif _MSC_VER +#endif // _MSC_VER // lower_bound |