summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/InputStream.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2016-02-05 16:25:26 +0100
committerBenoit Foucher <benoit@zeroc.com>2016-02-05 16:25:26 +0100
commit3cfb37df79a86ff279bee8e57bbe8105ec7edd5e (patch)
treede6e4384041940a162d2bf6711359186bc4240dd /cpp/src/Ice/InputStream.cpp
parentFix for java8 compilation failure (diff)
downloadice-3cfb37df79a86ff279bee8e57bbe8105ec7edd5e.tar.bz2
ice-3cfb37df79a86ff279bee8e57bbe8105ec7edd5e.tar.xz
ice-3cfb37df79a86ff279bee8e57bbe8105ec7edd5e.zip
Updated Objective-C mapping to use new stream classes
Diffstat (limited to 'cpp/src/Ice/InputStream.cpp')
-rw-r--r--cpp/src/Ice/InputStream.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/cpp/src/Ice/InputStream.cpp b/cpp/src/Ice/InputStream.cpp
index b89ce6e0177..5c73c51d6f1 100644
--- a/cpp/src/Ice/InputStream.cpp
+++ b/cpp/src/Ice/InputStream.cpp
@@ -179,12 +179,6 @@ Ice::InputStream::initialize(const EncodingVersion& encoding)
_sliceObjects = true;
_startSeq = -1;
_minSeqSize = 0;
-
- //
- // Initialize the encoding members of our pre-allocated encapsulation, in case
- // this stream is used without an explicit encapsulation.
- //
- _preAllocatedEncaps.encoding = encoding;
}
void
@@ -267,20 +261,15 @@ Ice::InputStream::setClosure(void* p)
void
Ice::InputStream::swap(InputStream& other)
{
- assert(_instance == other._instance);
-
swapBuffer(other);
+ std::swap(_instance, other._instance);
std::swap(_encoding, other._encoding);
-
#ifndef ICE_CPP11_MAPPING
std::swap(_collectObjects, other._collectObjects);
#endif
-
std::swap(_traceSlicing, other._traceSlicing);
-
std::swap(_closure, other._closure);
-
std::swap(_sliceObjects, other._sliceObjects);
//
@@ -1278,6 +1267,10 @@ Ice::InputStream::skipOpt(OptionalFormat type)
{
Int sz;
read(sz);
+ if(sz < 0)
+ {
+ throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
skip(sz);
break;
}
@@ -1321,7 +1314,6 @@ Ice::InputStream::skipOpts()
void
Ice::InputStream::throwUnmarshalOutOfBoundsException(const char* file, int line)
{
- assert(false);
throw UnmarshalOutOfBoundsException(file, line);
}
@@ -1487,6 +1479,7 @@ Ice::InputStream::initEncaps()
if(!_currentEncaps) // Lazy initialization.
{
_currentEncaps = &_preAllocatedEncaps;
+ _currentEncaps->encoding = _encoding;
_currentEncaps->sz = static_cast<Ice::Int>(b.size());
}