summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CPlusPlusUtil.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-10-08 23:45:26 +0000
committerMarc Laukien <marc@zeroc.com>2001-10-08 23:45:26 +0000
commitfcb2b81983728459877c28b208685889e9c6e481 (patch)
tree8189f6d935030a218b58d5aee344987c396e9b5c /cpp/src/Slice/CPlusPlusUtil.cpp
parentmoved generic C++ stuff to Slice library (diff)
downloadice-fcb2b81983728459877c28b208685889e9c6e481.tar.bz2
ice-fcb2b81983728459877c28b208685889e9c6e481.tar.xz
ice-fcb2b81983728459877c28b208685889e9c6e481.zip
fixes
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 6a1b4176062..1f7ec9f9df8 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -360,10 +360,6 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
}
string func = marshal ? "write(" : "read(";
- if (!pointer)
- {
- func += '&';
- }
if (BuiltinPtr::dynamicCast(type))
{
@@ -377,20 +373,20 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
out << sb;
if (marshal)
{
- out << nl << "::Ice::ObjectPtr " << obj << ' ' << param << ';';
+ out << nl << "::Ice::ObjectPtr " << obj << " = " << param << ';';
out << nl << stream << deref << "write(" << obj << ");";
}
else
{
out << nl << "::Ice::ObjectPtr " << obj << ';';
- out << nl << stream << deref << func << obj << ", " << cl->scoped() << "::__classIds[0]);";
+ out << nl << stream << deref << "read(" << obj << ", " << cl->scoped() << "::__classIds[0]);";
out << nl << "if (!" << obj << ')';
out << sb;
ClassDefPtr def = cl->definition();
if (def && !def->isAbstract())
{
- out << nl << obj << " = new " << cl->scoped() << ";";
- out << nl << obj << "->" << func << stream << ");";
+ out << nl << obj << " = new " << cl->scoped() << ';';
+ out << nl << obj << "->__read(" << (pointer ? "" : "&") << stream << ");";
}
else
{
@@ -411,7 +407,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
StructPtr st = StructPtr::dynamicCast(type);
if (st)
{
- out << nl << param << ".__" << func << stream << ");";
+ out << nl << param << ".__" << func << (pointer ? "" : "&") << stream << ");";
return;
}
@@ -424,8 +420,8 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
}
else
{
- out << nl << seq->scope() << "__" << func << stream << ", " << param << ", " << seq->scope()
- << "__U__" << seq->name() << "());";
+ out << nl << seq->scope() << "__" << func << (pointer ? "" : "&") << stream << ", " << param << ", "
+ << seq->scope() << "__U__" << seq->name() << "());";
}
return;
}
@@ -433,8 +429,8 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
DictionaryPtr dict = DictionaryPtr::dynamicCast(type);
if (dict)
{
- out << nl << dict->scope() << "__" << func << stream << ", " << param << ", " << dict->scope()
- << "__U__" << dict->name() << "());";
+ out << nl << dict->scope() << "__" << func << (pointer ? "" : "&") << stream << ", " << param << ", "
+ << dict->scope() << "__U__" << dict->name() << "());";
return;
}
@@ -449,7 +445,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
constructed = proxy->_class();
}
- out << nl << constructed->scope() << "__" << func << stream << ", " << param << ");";
+ out << nl << constructed->scope() << "__" << func << (pointer ? "" : "&") << stream << ", " << param << ");";
}
void