diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-08-01 12:57:44 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:07 -0300 |
commit | 22c7b2e24212b41fc941121f8df83eb238f8e0d3 (patch) | |
tree | 1724ca268678340096ec0111803d588f7314da2d /generator/shibokengenerator.h | |
parent | bb95046f7cb7a06e52bc5e6f3cb9eff4271ecbf0 (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 'generator/shibokengenerator.h')
-rw-r--r-- | generator/shibokengenerator.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/generator/shibokengenerator.h b/generator/shibokengenerator.h index 08586692e..256977690 100644 --- a/generator/shibokengenerator.h +++ b/generator/shibokengenerator.h @@ -25,11 +25,14 @@ #define SHIBOKENGENERATOR_H #define CPP_ARG "cppArg" -#define CPP_ARG0 (CPP_ARG "0") +#define CPP_ARG0 CPP_ARG"0" #define CPP_RETURN_VAR "cppResult" #define CPP_SELF_VAR "cppSelf" +#define PYTHON_ARG "pyArg" +#define PYTHON_ARGS PYTHON_ARG"s" #define PYTHON_OVERRIDE_VAR "pyOverride" #define PYTHON_RETURN_VAR "pyResult" +#define PYTHON_SELF_VAR "self" #define THREAD_STATE_SAVER_VAR "threadStateSaver" #define BEGIN_ALLOW_THREADS "PyThreadState* _save = PyEval_SaveThread(); // Py_BEGIN_ALLOW_THREADS" #define END_ALLOW_THREADS "PyEval_RestoreThread(_save); // Py_END_ALLOW_THREADS" @@ -300,7 +303,7 @@ public: QString cpythonSetattroFunctionName(const AbstractMetaClass* metaClass); QString cpythonGetterFunctionName(const AbstractMetaField* metaField); QString cpythonSetterFunctionName(const AbstractMetaField* metaField); - QString cpythonWrapperCPtr(const AbstractMetaClass* metaClass, QString argName = "self"); + QString cpythonWrapperCPtr(const AbstractMetaClass* metaClass, QString argName = PYTHON_SELF_VAR); QString cpythonWrapperCPtr(const AbstractMetaType* metaType, QString argName); QString cpythonWrapperCPtr(const TypeEntry* type, QString argName); |