diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-05 14:22:05 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-08-03 06:21:14 +0000 |
commit | 1578d14d1693122d4bcacede0d77527d8e898629 (patch) | |
tree | cb758cad0ab46f1884ecb44dc463a9f482be73dd /sources/shiboken2/tests/libsample | |
parent | da3afed804d47d25b5078103d400b5889e67915b (diff) |
Add new <array> argument modification indicating array usage
The modification can be used to indicate that for example
int* is meant to be used as int[].
This is reflected in the NativePointerAsArrayPattern
usage pattern of AbstractMetaType.
Task-number: PYSIDE-354
Task-number: PYSIDE-516
Change-Id: Icaeb3cce4be9ce06caa2cab628d4e8fc1b684819
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/tests/libsample')
-rw-r--r-- | sources/shiboken2/tests/libsample/functions.cpp | 9 | ||||
-rw-r--r-- | sources/shiboken2/tests/libsample/functions.h | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sources/shiboken2/tests/libsample/functions.cpp b/sources/shiboken2/tests/libsample/functions.cpp index 7a91a7b62..9fa4efc37 100644 --- a/sources/shiboken2/tests/libsample/functions.cpp +++ b/sources/shiboken2/tests/libsample/functions.cpp @@ -209,6 +209,15 @@ double sumDoubleArray(double array[4]) return std::accumulate(array, array + 4, double(0)); } +ArrayModifyTest::ArrayModifyTest() +{ +} + +int ArrayModifyTest::sumIntArray(int n, int *array) +{ + return std::accumulate(array, array + n, 0); +} + ClassWithFunctionPointer::ClassWithFunctionPointer() { callFunctionPointer(0, &ClassWithFunctionPointer::doNothing); diff --git a/sources/shiboken2/tests/libsample/functions.h b/sources/shiboken2/tests/libsample/functions.h index 69d4cdceb..5289d7ce0 100644 --- a/sources/shiboken2/tests/libsample/functions.h +++ b/sources/shiboken2/tests/libsample/functions.h @@ -84,6 +84,13 @@ LIBSAMPLE_API OddBool acceptOddBoolReference(OddBool& x); LIBSAMPLE_API int sumIntArray(int array[4]); LIBSAMPLE_API double sumDoubleArray(double array[4]); +class LIBSAMPLE_API ArrayModifyTest +{ +public: + ArrayModifyTest(); + int sumIntArray(int n, int *array); +}; + class LIBSAMPLE_API ClassWithFunctionPointer { public: |