summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/src/strstream.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-01-30 07:44:22 +0000
committerdim <dim@FreeBSD.org>2014-01-30 07:44:22 +0000
commit0b319638e352dd16f2e5a243bd3826d37eef1680 (patch)
treeadd3759d4df7ee10d814c3b2561c3c28fcd9cef2 /contrib/libc++/src/strstream.cpp
parent9cecf9778c1472e916ad20086c11e4bf332ba6ad (diff)
parentc3e10da3dc0f616b78ccf85206fdcf4c92f8ac85 (diff)
downloadFreeBSD-src-0b319638e352dd16f2e5a243bd3826d37eef1680.zip
FreeBSD-src-0b319638e352dd16f2e5a243bd3826d37eef1680.tar.gz
Import libc++ 3.4 release. This contains a lot of bugfixes, and some
preliminary support for C++1y. MFC after: 3 weeks
Diffstat (limited to 'contrib/libc++/src/strstream.cpp')
-rw-r--r--contrib/libc++/src/strstream.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/libc++/src/strstream.cpp b/contrib/libc++/src/strstream.cpp
index 518422b..c1965ea 100644
--- a/contrib/libc++/src/strstream.cpp
+++ b/contrib/libc++/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)))
OpenPOWER on IntegriCloud