diff options
author | dim <dim@FreeBSD.org> | 2014-01-29 19:30:27 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-01-29 19:30:27 +0000 |
commit | c3e10da3dc0f616b78ccf85206fdcf4c92f8ac85 (patch) | |
tree | 5812a629bd48b0968dee7411809c6a6a19680390 /src/strstream.cpp | |
parent | 30a0ccc9e6a2233c7d9f03028880be3e205fd7d1 (diff) | |
download | FreeBSD-src-c3e10da3dc0f616b78ccf85206fdcf4c92f8ac85.zip FreeBSD-src-c3e10da3dc0f616b78ccf85206fdcf4c92f8ac85.tar.gz |
Vendor import of libc++ tags/RELEASE_34/final r197960:
https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_34/final@197960
Diffstat (limited to 'src/strstream.cpp')
-rw-r--r-- | src/strstream.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/strstream.cpp b/src/strstream.cpp index 518422b..c1965ea 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<streamsize>(__alsize_, 2*old_size); + size_t old_size = static_cast<size_t> ((epptr() ? epptr() : egptr()) - eback()); + size_t new_size = max<size_t>(static_cast<size_t>(__alsize_), 2*old_size); if (new_size == 0) new_size = __default_alsize; char* buf = nullptr; if (__palloc_) - buf = static_cast<char*>(__palloc_(static_cast<size_t>(new_size))); + buf = static_cast<char*>(__palloc_(new_size)); else buf = new char[new_size]; if (buf == nullptr) @@ -229,8 +229,8 @@ strstreambuf::pos_type strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __which) { off_type __p(-1); - bool pos_in = __which & ios::in; - bool pos_out = __which & ios::out; + bool pos_in = (__which & ios::in) != 0; + bool pos_out = (__which & ios::out) != 0; bool legal = false; switch (__way) { @@ -287,8 +287,8 @@ strstreambuf::pos_type strstreambuf::seekpos(pos_type __sp, ios_base::openmode __which) { off_type __p(-1); - bool pos_in = __which & ios::in; - bool pos_out = __which & ios::out; + bool pos_in = (__which & ios::in) != 0; + bool pos_out = (__which & ios::out) != 0; if (pos_in || pos_out) { if (!((pos_in && gptr() == nullptr) || (pos_out && pptr() == nullptr))) |