summaryrefslogtreecommitdiff
path: root/cpp/src/slice2objc/Gen.cpp
diff options
context:
space:
mode:
authorJose <pepone@users.noreply.github.com>2023-08-09 09:27:00 +0200
committerGitHub <noreply@github.com>2023-08-09 09:27:00 +0200
commitbadafe8b848181a720ab96b48da6abc170fd918c (patch)
tree4b24dbf02f578cb6c68a43fa45a71b4cb8f2405b /cpp/src/slice2objc/Gen.cpp
parentFix GCC13 build failure - #1489 (#1490) (diff)
downloadice-badafe8b848181a720ab96b48da6abc170fd918c.tar.bz2
ice-badafe8b848181a720ab96b48da6abc170fd918c.tar.xz
ice-badafe8b848181a720ab96b48da6abc170fd918c.zip
Fix Objective-C build failures (#1496)
Diffstat (limited to 'cpp/src/slice2objc/Gen.cpp')
-rw-r--r--cpp/src/slice2objc/Gen.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp
index c52ea9bbf17..3923e3fabaf 100644
--- a/cpp/src/slice2objc/Gen.cpp
+++ b/cpp/src/slice2objc/Gen.cpp
@@ -3106,23 +3106,14 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p)
if(returnType)
{
_M << nl << outTypeToString(returnType, p->returnIsOptional(), true) << " ret";
- if(!isValueType(returnType))
- {
- _M << " = nil;";
- }
- else
- {
- _M << ";";
- }
+ _M << " = " << defaultValue(returnType, p->returnIsOptional()) << ";";
}
if(p->returnsData())
{
for(ParamDeclList::const_iterator op = outParams.begin(); op != outParams.end(); ++op)
{
- if(!isValueType((*op)->type()))
- {
- _M << nl << "*" << getParamName(*op, true) << " = nil;";
- }
+ _M << nl << "*" << getParamName(*op, true) << " = " << defaultValue((*op)->type(), (*op)->optional())
+ << ";";
}
}
_M << nl << "if(!ok)";