From 9aa32e472c61a43ca42b85cc185a5a394e9d678c Mon Sep 17 00:00:00 2001 From: Dwayne Boone Date: Wed, 25 Jan 2006 12:00:33 +0000 Subject: Fixed stl error wityh empty sequences --- cpp/src/Ice/StreamI.cpp | 63 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 7 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp index 54fd4cfc47c..9821f9cd99a 100644 --- a/cpp/src/Ice/StreamI.cpp +++ b/cpp/src/Ice/StreamI.cpp @@ -304,7 +304,14 @@ Ice::OutputStreamI::writeByte(Byte v) void Ice::OutputStreamI::writeByteSeq(const vector& v) { - _os.write(&v[0], &v[0] + v.size()); + if(v.size() == 0) + { + _os.writeSize(0); + } + else + { + _os.write(&v[0], &v[0] + v.size()); + } } void @@ -316,7 +323,14 @@ Ice::OutputStreamI::writeShort(Short v) void Ice::OutputStreamI::writeShortSeq(const vector& v) { - _os.write(&v[0], &v[0] + v.size()); + if(v.size() == 0) + { + _os.writeSize(0); + } + else + { + _os.write(&v[0], &v[0] + v.size()); + } } void @@ -328,7 +342,14 @@ Ice::OutputStreamI::writeInt(Int v) void Ice::OutputStreamI::writeIntSeq(const vector& v) { - _os.write(&v[0], &v[0] + v.size()); + if(v.size() == 0) + { + _os.writeSize(0); + } + else + { + _os.write(&v[0], &v[0] + v.size()); + } } void @@ -340,7 +361,14 @@ Ice::OutputStreamI::writeLong(Long v) void Ice::OutputStreamI::writeLongSeq(const vector& v) { - _os.write(&v[0], &v[0] + v.size()); + if(v.size() == 0) + { + _os.writeSize(0); + } + else + { + _os.write(&v[0], &v[0] + v.size()); + } } void @@ -352,7 +380,14 @@ Ice::OutputStreamI::writeFloat(Float v) void Ice::OutputStreamI::writeFloatSeq(const vector& v) { - _os.write(&v[0], &v[0] + v.size()); + if(v.size() == 0) + { + _os.writeSize(0); + } + else + { + _os.write(&v[0], &v[0] + v.size()); + } } void @@ -364,7 +399,14 @@ Ice::OutputStreamI::writeDouble(Double v) void Ice::OutputStreamI::writeDoubleSeq(const vector& v) { - _os.write(&v[0], &v[0] + v.size()); + if(v.size() == 0) + { + _os.writeSize(0); + } + else + { + _os.write(&v[0], &v[0] + v.size()); + } } void @@ -376,7 +418,14 @@ Ice::OutputStreamI::writeString(const string& v) void Ice::OutputStreamI::writeStringSeq(const vector& v) { - _os.write(&v[0], &v[0] + v.size()); + if(v.size() == 0) + { + _os.writeSize(0); + } + else + { + _os.write(&v[0], &v[0] + v.size()); + } } void -- cgit v1.2.3