diff options
author | Michi Henning <michi@zeroc.com> | 2004-07-28 01:40:19 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-07-28 01:40:19 +0000 |
commit | 30b676626596561f5595b2f3ddcead9db8b2aa41 (patch) | |
tree | ba30f999ab23624083ba929a3fb7deafb3799554 /cpp/src | |
parent | fixing DB version (diff) | |
download | ice-30b676626596561f5595b2f3ddcead9db8b2aa41.tar.bz2 ice-30b676626596561f5595b2f3ddcead9db8b2aa41.tar.xz ice-30b676626596561f5595b2f3ddcead9db8b2aa41.zip |
Multiple sequence members in a class caused slice2cs to generate incorrect
code.
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/Slice/CsUtil.cpp | 9 | ||||
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index 063f91883d2..ae4575cfe7a 100755 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -597,12 +597,12 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { + out << sb; out << nl << "int sz = " << stream << ".readSize();"; out << nl << stream << ".startSeq(sz, " << static_cast<unsigned>(type->minWireSize()) << ");"; - out << nl << param << " = new "; if(isArray) { - out << nl << param << " = new " << typeS << "[sz];"; + out << nl << param << " = new " << typeS << "[sz]"; } else { @@ -617,6 +617,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << stream << ".checkSeq();"; out << nl << stream << ".endElement();"; out << eb; + out << eb; } return; } @@ -634,6 +635,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { + out << sb; out << nl << "int sz = " << stream << ".readSize();"; out << nl << stream << ".startSeq(sz, " << static_cast<unsigned>(type->minWireSize()) << ");"; out << nl << param << " = new "; @@ -655,6 +657,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << stream << ".endElement();"; } out << eb; + out << eb; } return; } @@ -673,6 +676,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { + out << sb; out << nl << "int sz = " << stream << ".readSize();"; out << nl << stream << ".startSeq(sz, " << static_cast<unsigned>(type->minWireSize()) << ");"; out << nl << param << " = new "; @@ -696,6 +700,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << param << ".Add((" << typeS << ')' << stream << ".readByte());"; } out << eb; + out << eb; } return; } diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index abfe1de6d59..4640b491018 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -1211,7 +1211,9 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) patchParams << ", " << classMemberCount++; } } + _out << sb; writeMarshalUnmarshalCode(_out, (*d)->type(), fixId((*d)->name()), false, false, patchParams.str()); + _out << eb; } _out << nl << "__is.endReadSlice();"; _out << nl << "base.__read(__is, true);"; |