diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 08:24:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 13:42:12 +0200 |
commit | 3dd32863337ea2f6308ebf2f7656795d3fd488c9 (patch) | |
tree | 08a3b35607dee19536ccb5f21b2ede0fdc41cc79 /sources/shiboken2/libshiboken/helper.h | |
parent | 4f4f1be9f46e02e87357aeee613cfd5ea0be8220 (diff) | |
parent | 67d635fe2cc2c89c30486a2e26dea4106a9d9c16 (diff) |
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'sources/shiboken2/libshiboken/helper.h')
-rw-r--r-- | sources/shiboken2/libshiboken/helper.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sources/shiboken2/libshiboken/helper.h b/sources/shiboken2/libshiboken/helper.h index 9b6d8903f..14aae8028 100644 --- a/sources/shiboken2/libshiboken/helper.h +++ b/sources/shiboken2/libshiboken/helper.h @@ -44,7 +44,7 @@ #include "shibokenmacros.h" #include "autodecref.h" -#define SBK_UNUSED(x) (void)x; +#define SBK_UNUSED(x) (void)(x); namespace Shiboken { @@ -60,7 +60,7 @@ namespace Shiboken * \note The argv array is allocated using new operator and each item is allocated using malloc. * \returns True on sucess, false otherwise. */ -LIBSHIBOKEN_API bool listToArgcArgv(PyObject* argList, int* argc, char*** argv, const char* defaultAppName = 0); +LIBSHIBOKEN_API bool listToArgcArgv(PyObject *argList, int *argc, char ***argv, const char *defaultAppName = nullptr); /** * Convert a python sequence into a heap-allocated array of ints. @@ -68,7 +68,7 @@ LIBSHIBOKEN_API bool listToArgcArgv(PyObject* argList, int* argc, char*** argv, * \returns The newly allocated array or NULL in case of error or empty sequence. Check with PyErr_Occurred * if it was successfull. */ -LIBSHIBOKEN_API int* sequenceToIntArray(PyObject* obj, bool zeroTerminated = false); +LIBSHIBOKEN_API int *sequenceToIntArray(PyObject *obj, bool zeroTerminated = false); /** * Creates and automatically deallocates C++ arrays. @@ -77,27 +77,27 @@ template<class T> class AutoArrayPointer { public: - AutoArrayPointer(const AutoArrayPointer&) = delete; - AutoArrayPointer(AutoArrayPointer&&) = delete; - AutoArrayPointer& operator=(const AutoArrayPointer&) = delete; - AutoArrayPointer& operator=(AutoArrayPointer&&) = delete; + AutoArrayPointer(const AutoArrayPointer &) = delete; + AutoArrayPointer(AutoArrayPointer &&) = delete; + AutoArrayPointer &operator=(const AutoArrayPointer &) = delete; + AutoArrayPointer &operator=(AutoArrayPointer &&) = delete; explicit AutoArrayPointer(int size) { data = new T[size]; } - T& operator[](int pos) { return data[pos]; } - operator T*() const { return data; } + T &operator[](int pos) { return data[pos]; } + operator T *() const { return data; } ~AutoArrayPointer() { delete[] data; } private: - T* data; + T *data; }; -typedef unsigned long long ThreadId; +using ThreadId = unsigned long long; LIBSHIBOKEN_API ThreadId currentThreadId(); LIBSHIBOKEN_API ThreadId mainThreadId(); /** * An utility function used to call PyErr_WarnEx with a formatted message. */ -LIBSHIBOKEN_API int warning(PyObject* category, int stacklevel, const char* format, ...); +LIBSHIBOKEN_API int warning(PyObject *category, int stacklevel, const char *format, ...); } // namespace Shiboken |