diff options
author | Christian Tismer <tismer@stackless.com> | 2023-03-15 18:55:50 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2023-03-20 16:38:23 +0100 |
commit | 18812159a8cd5295ac8d51e37f9021ad21434b90 (patch) | |
tree | 6939bf411c9bdf316231a081ed1d44d28ca7af8d /sources/shiboken6/libshiboken/basewrapper.h | |
parent | 5468617478c93951de7744b6bad8608911a78880 (diff) |
cppgenerator: get rid of all goto constructs
[ChangeLog][shiboken6] The generated code no longer contains `goto`.
Change-Id: I3b90abafd8dbe2c19b4fffb7880322451d1ed068
Fixes: PYSIDE-2256
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken6/libshiboken/basewrapper.h')
-rw-r--r-- | sources/shiboken6/libshiboken/basewrapper.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sources/shiboken6/libshiboken/basewrapper.h b/sources/shiboken6/libshiboken/basewrapper.h index 86806c917..1d1127b8e 100644 --- a/sources/shiboken6/libshiboken/basewrapper.h +++ b/sources/shiboken6/libshiboken/basewrapper.h @@ -130,11 +130,28 @@ void callCppDestructor(void *cptr) delete reinterpret_cast<T *>(cptr); } -// setErrorAboutWrongArguments now gets overload information from the signature module. -// The extra info argument can contain additional data about the error. +/// setErrorAboutWrongArguments now gets overload information from the signature module. +/// The extra info argument can contain additional data about the error. LIBSHIBOKEN_API void setErrorAboutWrongArguments(PyObject *args, const char *funcName, PyObject *info); +/// Return values for the different retun variants. +/// This is used instead of goto. +LIBSHIBOKEN_API PyObject *returnWrongArguments(PyObject *args, const char *funcName, + PyObject *info); + +LIBSHIBOKEN_API int returnWrongArguments_Zero(PyObject *args, const char *funcName, + PyObject *info); + +LIBSHIBOKEN_API int returnWrongArguments_MinusOne(PyObject *args, const char *funcName, + PyObject *info); + +LIBSHIBOKEN_API void returnWrongArguments_Void(PyObject *args, const char *funcName, + PyObject *info); + +/// A simple special version for the end of rich comparison. +LIBSHIBOKEN_API PyObject *returnFromRichCompare(PyObject *result); + // Return error information object if the argument count is wrong LIBSHIBOKEN_API PyObject *checkInvalidArgumentCount(Py_ssize_t numArgs, Py_ssize_t minArgs, |