Fix signed/unsigned warnings when building libc++ in C++14 mode

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188395 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow 2013-08-14 17:53:31 +00:00
parent 811e7130db
commit 3e005bf6b2

View File

@ -156,13 +156,13 @@ strstreambuf::overflow(int_type __c)
{ {
if ((__strmode_ & __dynamic) == 0 || (__strmode_ & __frozen) != 0) if ((__strmode_ & __dynamic) == 0 || (__strmode_ & __frozen) != 0)
return int_type(EOF); return int_type(EOF);
streamsize old_size = (epptr() ? epptr() : egptr()) - eback(); size_t old_size = static_cast<size_t> ((epptr() ? epptr() : egptr()) - eback());
streamsize new_size = max<streamsize>(__alsize_, 2*old_size); size_t new_size = max<size_t>(static_cast<size_t>(__alsize_), 2*old_size);
if (new_size == 0) if (new_size == 0)
new_size = __default_alsize; new_size = __default_alsize;
char* buf = nullptr; char* buf = nullptr;
if (__palloc_) if (__palloc_)
buf = static_cast<char*>(__palloc_(static_cast<size_t>(new_size))); buf = static_cast<char*>(__palloc_(new_size));
else else
buf = new char[new_size]; buf = new char[new_size];
if (buf == nullptr) if (buf == nullptr)