summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-07-23 03:30:26 +0000
committerMichi Henning <michi@zeroc.com>2002-07-23 03:30:26 +0000
commitdf8e6d92d39f60fdec3a40ec78028e7b68389eb7 (patch)
treeb69be355d24f225c3cc4b5b2a49b75ddd886ba9f /cpp/src
parentFix (diff)
downloadice-df8e6d92d39f60fdec3a40ec78028e7b68389eb7.tar.bz2
ice-df8e6d92d39f60fdec3a40ec78028e7b68389eb7.tar.xz
ice-df8e6d92d39f60fdec3a40ec78028e7b68389eb7.zip
Fixed remaining bugs for escaped keywords in C++ code generation. The
torture test IDL compiles correctly now. Removed a few commented-out sections of code that I left behind earlier.
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp8
-rw-r--r--cpp/src/slice2cpp/Gen.cpp42
2 files changed, 5 insertions, 45 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 5d1c95ec4a9..aab278a1bbc 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -464,7 +464,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
{
string scope = fixKwd(seq->scope());
out << nl << scope << "__" << func << (pointer ? "" : "&") << stream << ", "
- << fixedParam << ", " << scope << "__U__" << seq->name() << "());";
+ << fixedParam << ", " << scope << "__U__" << fixKwd(seq->name()) << "());";
}
return;
}
@@ -474,7 +474,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
{
string scope = fixKwd(dict->scope());
out << nl << scope << "__" << func << (pointer ? "" : "&") << stream << ", "
- << fixedParam << ", " << scope << "__U__" << dict->name() << "());";
+ << fixedParam << ", " << scope << "__U__" << fixKwd(dict->name()) << "());";
return;
}
@@ -693,7 +693,7 @@ Slice::writeGenericMarshalUnmarshalCode(Output& out, const TypePtr& type, const
{
string scope = fixKwd(seq->scope());
out << nl << scope << genFunc << tagName << ", " << (pointer ? "" : "&") << stream
- << ", " << fixedParam << ", " << scope << "__U__" << seq->name() << "());";
+ << ", " << fixedParam << ", " << scope << "__U__" << fixKwd(seq->name()) << "());";
}
return;
}
@@ -703,7 +703,7 @@ Slice::writeGenericMarshalUnmarshalCode(Output& out, const TypePtr& type, const
{
string scope = fixKwd(dict->scope());
out << nl << scope << genFunc << tagName << ", " << (pointer ? "" : "&") << stream
- << ", " << fixedParam << ", " << scope << "__U__" << dict->name() << "());";
+ << ", " << fixedParam << ", " << scope << "__U__" << fixKwd(dict->name()) << "());";
return;
}
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 611ced9f818..1f0a42d7bc6 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1224,10 +1224,6 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
TypePtr ret = p->returnType();
string retS = returnTypeToString(ret);
- //TypeStringList inParams = p->inputParameters();
- //TypeStringList outParams = p->outputParameters();
- //TypeStringList::const_iterator q;
-
string params = "(";
string paramsDecl = "("; // With declarators
string args = "(";
@@ -1247,34 +1243,6 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
args += ", ";
}
-#if 0
- for(q = inParams.begin(); q != inParams.end(); ++q)
- {
- string typeString = inputTypeToString(q->first);
- params += typeString;
- paramsDecl += typeString;
- paramsDecl += ' ';
- paramsDecl += fixKwd(q->second);
- args += fixKwd(q->second);
- params += ", ";
- paramsDecl += ", ";
- args += ", ";
- }
-
- for(q = outParams.begin(); q != outParams.end(); ++q)
- {
- string typeString = outputTypeToString(q->first);
- params += typeString;
- paramsDecl += typeString;
- paramsDecl += ' ';
- paramsDecl += fixKwd(q->second);
- args += fixKwd(q->second);
- params += ", ";
- paramsDecl += ", ";
- args += ", ";
- }
-#endif
-
params += "const ::Ice::Context& = ::Ice::Context())";
paramsDecl += "const ::Ice::Context& __context)";
args += "__context)";
@@ -1423,10 +1391,6 @@ Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p)
TypePtr ret = p->returnType();
string retS = returnTypeToString(ret);
- //TypeStringList inParams = p->inputParameters();
- //TypeStringList outParams = p->outputParameters();
- //TypeStringList::const_iterator q;
-
string params = "(";
ParamDeclList paramList = p->parameters();
@@ -2091,7 +2055,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
{
C << nl << "case " << i++ << ':';
C << sb;
- C << nl << "return ___" << *q << "(in, current);";
+ C << nl << "return ___" << fixKwd(*q) << "(in, current);";
C << eb;
}
C << eb;
@@ -2847,10 +2811,6 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p)
TypePtr ret = op->returnType();
string retS = returnTypeToString(ret);
- //TypeStringList inParams = op->inputParameters();
- //TypeStringList outParams = op->outputParameters();
- //TypeStringList::const_iterator q;
-
H << sp << nl << "virtual " << retS << ' ' << opName << '(';
H.useCurrentPosAsIndent();
ParamDeclList paramList = op->parameters();