diff options
Diffstat (limited to 'system/lib/libcxx/strstream.cpp')
-rw-r--r-- | system/lib/libcxx/strstream.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/system/lib/libcxx/strstream.cpp b/system/lib/libcxx/strstream.cpp index 518422bd..c1965ea3 100644 --- a/system/lib/libcxx/strstream.cpp +++ b/system/lib/libcxx/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))) |