diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-01-14 14:45:31 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-01-15 20:12:25 -0300 |
commit | 992e7170d4254257e4341d82c82aeec981396e2e (patch) | |
tree | 55c5c1ebfdb79a84f7b4a52cb5a1f80a1a44021d /shibokengenerator.cpp | |
parent | d7a8026ba537a8db0fe217f5b52bcfaadaaa0265 (diff) |
Values returned from C++ are now stored in a C++ variable.
The previous behaviour was to pass the result, if any, straight to
the to-Python-converter method. Separating the C++ from the Python
part allows us to release the thread lock when calling C++ and taking
it back before calling the converter filled with Python calls.
Also renamed "retvalVariableName()" to the more meaninful name
"pythonReturnVariableName()" and added "cppReturnVariableName()".
Also updated the type system variable replacement to recognize "%0" as
"cppReturnVariableName()".
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r-- | shibokengenerator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp index d5fa3e90b..de879fd56 100644 --- a/shibokengenerator.cpp +++ b/shibokengenerator.cpp @@ -858,7 +858,7 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s, if (func) { // replace %PYARG_# variables - code.replace("%PYARG_0", retvalVariableName()); + code.replace("%PYARG_0", pythonReturnVariableName()); if (snip.language == TypeSystem::TargetLangCode) { if (numArgs > 1) { code.replace(pyArgsRegex, "pyargs[\\1-1]"); @@ -897,7 +897,7 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s, code.replace("%0.", QString("%1->").arg("cptr")); code.replace("%0", "cptr"); } else if (func->type()) { - QString pyRetVal = cpythonWrapperCPtr(func->type(), retvalVariableName()); + QString pyRetVal = cpythonWrapperCPtr(func->type(), pythonReturnVariableName()); if (func->type()->typeEntry()->isValue() || func->type()->typeEntry()->isObject()) code.replace("%0.", QString("%1->").arg(pyRetVal)); code.replace("%0", pyRetVal); |