aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 0f136c45b..182e3a112 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -4769,17 +4769,15 @@ void CppGenerator::writeSetterFunction(TextStream &s,
if (fieldType.isCppIntegralPrimitive() || fieldType.typeEntry()->isEnum()
|| fieldType.typeEntry()->isFlags()) {
- s << getFullTypeNameWithoutModifiers(fieldType) << " cppOut_local = "
- << cppField << ";\n"
+ s << "auto cppOut_local = " << cppField << ";\n"
<< PYTHON_TO_CPP_VAR << "(pyIn, &cppOut_local);\n"
<< cppField << " = cppOut_local";
} else {
if (fieldType.isPointerToConst())
s << "const ";
- s << getFullTypeNameWithoutModifiers(fieldType)
- << QString::fromLatin1(" *").repeated(fieldType.indirections()) << "& cppOut_ptr = "
- << cppField << ";\n"
- << PYTHON_TO_CPP_VAR << "(pyIn, &cppOut_ptr)";
+ s << "auto " << QByteArray(fieldType.indirections(), '*')
+ << "&cppOut_ptr = " << cppField << ";\n"
+ << PYTHON_TO_CPP_VAR << "(pyIn, &cppOut_ptr)";
}
s << ";\n\n";