From 3e005bf6b2649da693d6c3109b5947890a0ffec3 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 14 Aug 2013 17:53:31 +0000 Subject: [PATCH] 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 --- src/strstream.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/strstream.cpp b/src/strstream.cpp index 518422bd..08a78a74 100644 --- a/src/strstream.cpp +++ b/src/strstream.cpp @@ -156,13 +156,13 @@ strstreambuf::overflow(int_type __c) { if ((__strmode_ & __dynamic) == 0 || (__strmode_ & __frozen) != 0) return int_type(EOF); - streamsize old_size = (epptr() ? epptr() : egptr()) - eback(); - streamsize new_size = max(__alsize_, 2*old_size); + size_t old_size = static_cast ((epptr() ? epptr() : egptr()) - eback()); + size_t new_size = max(static_cast(__alsize_), 2*old_size); if (new_size == 0) new_size = __default_alsize; char* buf = nullptr; if (__palloc_) - buf = static_cast(__palloc_(static_cast(new_size))); + buf = static_cast(__palloc_(new_size)); else buf = new char[new_size]; if (buf == nullptr)