summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CsUtil.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2004-07-28 01:40:19 +0000
committerMichi Henning <michi@zeroc.com>2004-07-28 01:40:19 +0000
commit30b676626596561f5595b2f3ddcead9db8b2aa41 (patch)
treeba30f999ab23624083ba929a3fb7deafb3799554 /cpp/src/Slice/CsUtil.cpp
parentfixing DB version (diff)
downloadice-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/Slice/CsUtil.cpp')
-rwxr-xr-xcpp/src/Slice/CsUtil.cpp9
1 files changed, 7 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;
}