From c7d3f0869b708ea831a468bafc24c35dcaeb48b1 Mon Sep 17 00:00:00 2001 From: dim Date: Fri, 11 Mar 2016 20:30:06 +0000 Subject: Pull in r246280 from upstream libc++ trunk (by Eric Fiselier): Fix most GCC warnings during build. Only -Wattribute left. This helps to fix a number of -Werror warnings when building world with recent versions of gcc (e.g. the devel/*-xtoolchain-gcc ports). --- contrib/libc++/include/string | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'contrib/libc++/include/string') diff --git a/contrib/libc++/include/string b/contrib/libc++/include/string index 5777ee2..6e63ab1 100644 --- a/contrib/libc++/include/string +++ b/contrib/libc++/include/string @@ -1445,7 +1445,8 @@ public: _LIBCPP_INLINE_VISIBILITY size_type length() const _NOEXCEPT {return size();} _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type capacity() const _NOEXCEPT - {return (__is_long() ? __get_long_cap() : __min_cap) - 1;} + {return (__is_long() ? __get_long_cap() + : static_cast(__min_cap)) - 1;} void resize(size_type __n, value_type __c); _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());} @@ -1785,11 +1786,11 @@ private: template static _LIBCPP_INLINE_VISIBILITY size_type __align_it(size_type __s) _NOEXCEPT - {return __s + (__a-1) & ~(__a-1);} + {return (__s + (__a-1)) & ~(__a-1);} enum {__alignment = 16}; static _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __s) _NOEXCEPT - {return (__s < __min_cap ? __min_cap : + {return (__s < __min_cap ? static_cast(__min_cap) : __align_it (__s+1)) - 1;} -- cgit v1.1