aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-02 19:50:35 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-10 08:46:23 +0100
commit7fa7236b0f2d015b5917b93f7eed533f094a8ebc (patch)
treeacd528cc1eac52ee62ce20848b62dde8e62331a3 /sources/shiboken6
parent4abc6794b6040fd8d66d40072d41cdfdc418fba1 (diff)
shiboken6/AutoArrayPointer: Change to use ssize_t
This fits better with Python's Py_ssize_t and Qt's qsizetype, otherwise, warnings appear: PySide6/QtWidgets/PySide6/QtWidgets/qgraphicsview_wrapper.cpp:2757:199: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: T &operator[](int pos) { return data[pos]; } ‘operator[](QGraphicsItem**, Py_ssize_t {aka long int})’ <built-in> Change-Id: I19264dadfb729d0c4c9604db7973d4a415f45499 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken6')
-rw-r--r--sources/shiboken6/libshiboken/helper.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/shiboken6/libshiboken/helper.h b/sources/shiboken6/libshiboken/helper.h
index 7e46f3d93..1a2c2e29d 100644
--- a/sources/shiboken6/libshiboken/helper.h
+++ b/sources/shiboken6/libshiboken/helper.h
@@ -84,8 +84,8 @@ class AutoArrayPointer
AutoArrayPointer &operator=(const AutoArrayPointer &) = delete;
AutoArrayPointer &operator=(AutoArrayPointer &&) = delete;
- explicit AutoArrayPointer(int size) { data = new T[size]; }
- T &operator[](int pos) { return data[pos]; }
+ explicit AutoArrayPointer(ssize_t size) { data = new T[size]; }
+ T &operator[](ssize_t pos) { return data[pos]; }
operator T *() const { return data; }
~AutoArrayPointer() { delete[] data; }
private: