aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-01 12:57:44 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:17:07 -0300
commit22c7b2e24212b41fc941121f8df83eb238f8e0d3 (patch)
tree1724ca268678340096ec0111803d588f7314da2d /tests/samplebinding
parentbb95046f7cb7a06e52bc5e6f3cb9eff4271ecbf0 (diff)
Moved many variables names used in generated code to macros.
Also fixed ShibokenGenerator::pythonFunctionWrapperUsesListOfArguments() method to consider call operators. Fixed code snippet variable replacement for when there's only one Python argument in the function. And CppGenerator::writeArgumentsInitializer() was sanitized, with never used code erased. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'tests/samplebinding')
-rw-r--r--tests/samplebinding/typesystem_sample.xml14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index aa5ca9885..25301973e 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -1127,25 +1127,27 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
- PyObject *type = PyObject_Type(%PYSELF);
- PyObject *args = NULL;
+ PyObject* type = PyObject_Type(%PYSELF);
+ PyObject* args = NULL;
args = Py_BuildValue("(dd)", %CPPSELF.x(), %CPPSELF.y());
%PYARG_0 = Py_BuildValue("(OO)", type, args);
</inject-code>
</add-function>
+ <template name="return_self">
+ %PYARG_0 = %PYARG_1;
+ Py_INCREF(%PYARG_1);
+ </template>
<add-function signature="operator-(PyUnicode)">
<inject-code>
- %PYARG_0 = arg;
- Py_INCREF(arg);
+ <insert-template name="return_self" />
</inject-code>
</add-function>
<!-- A reverse operator -->
<add-function signature="operator-(PyUnicode, Point)">
<inject-code>
- %PYARG_0 = arg;
- Py_INCREF(arg);
+ <insert-template name="return_self" />
</inject-code>
</add-function>
</value-type>