summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CsUtil.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2007-11-12 15:07:04 +1000
committerMichi Henning <michi@zeroc.com>2007-11-12 15:07:04 +1000
commit391c9e30a16f3d75fb337ef437a4cbce47c471e0 (patch)
tree4bae2bf8064a62dcfddf34dbb49878615179d439 /cpp/src/Slice/CsUtil.cpp
parentMerge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff)
downloadice-391c9e30a16f3d75fb337ef437a4cbce47c471e0.tar.bz2
ice-391c9e30a16f3d75fb337ef437a4cbce47c471e0.tar.xz
ice-391c9e30a16f3d75fb337ef437a4cbce47c471e0.zip
But 2534.
Also fixed incorrect allTests.py for Mono, and updated INSTALL.MONO to require Mono version 1.2.5.1 or later.
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rwxr-xr-xcpp/src/Slice/CsUtil.cpp46
1 files changed, 37 insertions, 9 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp
index c5ef9a41d29..2e392648a50 100755
--- a/cpp/src/Slice/CsUtil.cpp
+++ b/cpp/src/Slice/CsUtil.cpp
@@ -1066,21 +1066,49 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
string call;
if(isGeneric && !isList && !isStack)
{
- call = "e__.Current.";
- call += streamingAPI ? "ice_write" : "write__";
- call += "(" + stream + ");";
+ if(isValueType(type))
+ {
+ call = "e__.Current";
+ }
+ else
+ {
+ call = "(e__.Current == null ? new ";
+ call += typeS + "() : e__.Current)";
+ }
}
else
{
- call = param;
- if(isStack)
+ if(isValueType(type))
+ {
+ call = param;
+ if(isStack)
+ {
+ call += "_tmp";
+ }
+ }
+ else
+ {
+ call = "(";
+ call += param;
+ if(isStack)
+ {
+ call += "_tmp";
+ }
+ call += " == null ? new " + typeS + "() : " + param;
+ if(isStack)
+ {
+ call += "_tmp";
+ }
+ }
+ call += "[ix__]";
+ if(!isValueType(type))
{
- call += "_tmp";
+ call += ")";
}
- call += "[ix__].";
- call += streamingAPI ? "ice_write" : "write__";
- call += "(" + stream + ");";
}
+ call += ".";
+ call += streamingAPI ? "ice_write" : "write__";
+ call += "(" + stream + ");";
out << nl << call;
out << eb;
out << eb;