diff options
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index b8d889059b3..76c5167f616 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1527,11 +1527,12 @@ Slice::Gen::TypesVisitor::emitUpcall(const ExceptionPtr& base, const string& cal C.zeroIndent(); C << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERBUG C.restoreIndent(); - C << nl << (base ? fixKwd(base->name()) : (isLocal ? "LocalException" : "UserException")) << call; + C << nl << (base ? fixKwd(base->name()) : string(isLocal ? "LocalException" : "UserException")) << call; C.zeroIndent(); C << nl << "#else"; C.restoreIndent(); - C << nl << (base ? fixKwd(base->scoped()) : (isLocal ? "::Ice::LocalException" : "::Ice::UserException")) << call; + C << nl << (base ? fixKwd(base->scoped()) : string(isLocal ? "::Ice::LocalException" : "::Ice::UserException")) + << call; C.zeroIndent(); C << nl << "#endif"; C.restoreIndent(); @@ -3698,8 +3699,9 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref } C << eb; } - else if(StructPtr s = StructPtr::dynamicCast(p)) + else if(StructPtr::dynamicCast(p)) { + StructPtr s = StructPtr::dynamicCast(p); DataMemberList dml = s->dataMembers(); for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i) { @@ -3709,8 +3711,9 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref } } } - else if(DictionaryPtr d = DictionaryPtr::dynamicCast(p)) + else if(DictionaryPtr::dynamicCast(p)) { + DictionaryPtr d = DictionaryPtr::dynamicCast(p); string scoped = fixKwd(d->scoped()); ostringstream tmp; tmp << "_i" << level; @@ -3723,8 +3726,9 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref C << eb; C << eb; } - else if(SequencePtr s = SequencePtr::dynamicCast(p)) + else if(SequencePtr::dynamicCast(p)) { + SequencePtr s = SequencePtr::dynamicCast(p); string scoped = fixKwd(s->scoped()); ostringstream tmp; tmp << "_i" << level; @@ -3769,8 +3773,9 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi C << eb; C << eb; } - else if(StructPtr s = StructPtr::dynamicCast(p)) + else if(StructPtr::dynamicCast(p)) { + StructPtr s = StructPtr::dynamicCast(p); DataMemberList dml = s->dataMembers(); for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i) { @@ -3780,8 +3785,9 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi } } } - else if(DictionaryPtr d = DictionaryPtr::dynamicCast(p)) + else if(DictionaryPtr::dynamicCast(p)) { + DictionaryPtr d = DictionaryPtr::dynamicCast(p); string scoped = fixKwd(d->scoped()); ostringstream tmp; tmp << "_i" << level; @@ -3794,8 +3800,9 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi C << eb; C << eb; } - else if(SequencePtr s = SequencePtr::dynamicCast(p)) + else if(SequencePtr::dynamicCast(p)) { + SequencePtr s = SequencePtr::dynamicCast(p); string scoped = fixKwd(s->scoped()); ostringstream tmp; tmp << "_i" << level; @@ -3916,11 +3923,11 @@ Slice::Gen::ObjectVisitor::emitUpcall(const ClassDefPtr& base, const string& cal C.zeroIndent(); C << nl << "#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug"; // COMPILERBUG C.restoreIndent(); - C << nl << (base ? fixKwd(base->name()) : "Object") << call; + C << nl << (base ? fixKwd(base->name()) : string("Object")) << call; C.zeroIndent(); C << nl << "#else"; C.restoreIndent(); - C << nl << (base ? fixKwd(base->scoped()) : "::Ice::Object") << call; + C << nl << (base ? fixKwd(base->scoped()) : string("::Ice::Object")) << call; C.zeroIndent(); C << nl << "#endif"; C.restoreIndent(); @@ -4974,7 +4981,7 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p) C << sp << nl << "IceAsync" << classScopedAMD << '_' << name << "::" << classNameAMD << '_' << name << "(::IceInternal::Incoming& in) :"; C.inc(); - C << nl << "IncomingAsync(in)"; + C << nl << "::IceInternal::IncomingAsync(in)"; C.dec(); C << sb; C << eb; |