summaryrefslogtreecommitdiff
path: root/cpp/src/slice2java/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2001-11-10 03:05:41 +0000
committerMark Spruiell <mes@zeroc.com>2001-11-10 03:05:41 +0000
commitc096684b5fa0d473400406a5a512e4aab3957670 (patch)
tree68c403ed176a73488f5e2f78c8aaa97a8a0d08e1 /cpp/src/slice2java/Gen.cpp
parentinitial check-in (diff)
downloadice-c096684b5fa0d473400406a5a512e4aab3957670.tar.bz2
ice-c096684b5fa0d473400406a5a512e4aab3957670.tar.xz
ice-c096684b5fa0d473400406a5a512e4aab3957670.zip
scoping fixes
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r--cpp/src/slice2java/Gen.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index fd96e8f4e25..9d886db4d98 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -202,17 +202,17 @@ Slice::JavaVisitor::getAbsolute(const string& scoped,
// scope=::A, scoped=::A::B, result=B
// scope=::A, scoped=::A::B::C, result=::A::B::C
//
- if (scoped.compare(0, scope.size(), scope) == 0)
+ string::size_type scopeSize = scope.size();
+ if (scoped.compare(0, scopeSize, scope) == 0)
{
- start = scoped.find(':', scope.size());
+ start = scoped.find(':', scopeSize);
if (start == string::npos)
{
- start = 0;
+ start = scopeSize;
}
else
{
- assert(scoped[start + 1] == ':');
- start += 2;
+ start = 0;
}
}
}
@@ -537,11 +537,10 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p)
void
Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p)
{
+ string name = fixKwd(p->name());
ContainerPtr container = p->container();
ClassDefPtr cl = ClassDefPtr::dynamicCast(container);
- string name = fixKwd(p->name());
- string scoped = p->scoped();
- string scope = p->scope();
+ string scope = cl->scope();
TypePtr ret = p->returnType();
string retS = typeToString(ret, TypeModeReturn, scope);