From d1882c79f2e2366a2a77e64ef9d7a5a918a776a8 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 14 Nov 2019 17:27:43 +0100 Subject: Get rid of some QT_STRICT_ITERATORS leftover Amends 06456873fceddcd340431fc5999c50ff6d3c2371. Fixes: QTBUG-82611 Change-Id: I8b1e01549f3e910b85a571833237e38a7c2b49a9 Reviewed-by: Simon Hausmann --- mkspecs/features/qt_module_headers.prf | 1 - src/corelib/tools/qarraydata.h | 73 ---------------------- .../qtconcurrentfilter/.prev_CMakeLists.txt | 2 - .../concurrent/qtconcurrentfilter/CMakeLists.txt | 5 +- .../auto/concurrent/qtconcurrentmap/CMakeLists.txt | 5 +- tests/auto/corelib/thread/qfuture/CMakeLists.txt | 7 +-- 6 files changed, 5 insertions(+), 88 deletions(-) diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 7ee1a956f4..0c8e4ff2a6 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -192,7 +192,6 @@ headersclean:!internal_module { hcleanDEFS = -DQT_NO_CAST_TO_ASCII=1 \ -DQT_NO_CAST_FROM_ASCII=1 \ -UQT_RESTRICTED_CAST_FROM_ASCII \ - -DQT_STRICT_ITERATORS \ -DQT_NO_URL_CAST_FROM_STRING=1 \ -DQT_NO_CAST_FROM_BYTEARRAY=1 \ -DQT_NO_KEYWORDS=1 \ diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index 483f6d5edb..d996b9c56b 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -198,81 +198,8 @@ template struct QTypedArrayData : QArrayData { -#ifdef QT_STRICT_ITERATORS - class iterator { - public: - T *i; - typedef std::random_access_iterator_tag iterator_category; - typedef int difference_type; - typedef T value_type; - typedef T *pointer; - typedef T &reference; - - inline iterator() : i(nullptr) {} - inline iterator(T *n) : i(n) {} - inline iterator(const iterator &o): i(o.i){} // #### Qt 6: remove, the implicit version is fine - inline T &operator*() const { return *i; } - inline T *operator->() const { return i; } - inline T &operator[](int j) const { return *(i + j); } - inline bool operator==(const iterator &o) const { return i == o.i; } - inline bool operator!=(const iterator &o) const { return i != o.i; } - inline bool operator<(const iterator& other) const { return i < other.i; } - inline bool operator<=(const iterator& other) const { return i <= other.i; } - inline bool operator>(const iterator& other) const { return i > other.i; } - inline bool operator>=(const iterator& other) const { return i >= other.i; } - inline iterator &operator++() { ++i; return *this; } - inline iterator operator++(int) { T *n = i; ++i; return n; } - inline iterator &operator--() { i--; return *this; } - inline iterator operator--(int) { T *n = i; i--; return n; } - inline iterator &operator+=(int j) { i+=j; return *this; } - inline iterator &operator-=(int j) { i-=j; return *this; } - inline iterator operator+(int j) const { return iterator(i+j); } - inline iterator operator-(int j) const { return iterator(i-j); } - friend inline iterator operator+(int j, iterator k) { return k + j; } - inline int operator-(iterator j) const { return i - j.i; } - inline operator T*() const { return i; } - }; - friend class iterator; - - class const_iterator { - public: - const T *i; - typedef std::random_access_iterator_tag iterator_category; - typedef int difference_type; - typedef T value_type; - typedef const T *pointer; - typedef const T &reference; - - inline const_iterator() : i(nullptr) {} - inline const_iterator(const T *n) : i(n) {} - inline const_iterator(const const_iterator &o): i(o.i) {} // #### Qt 6: remove, the default version is fine - inline explicit const_iterator(const iterator &o): i(o.i) {} - inline const T &operator*() const { return *i; } - inline const T *operator->() const { return i; } - inline const T &operator[](int j) const { return *(i + j); } - inline bool operator==(const const_iterator &o) const { return i == o.i; } - inline bool operator!=(const const_iterator &o) const { return i != o.i; } - inline bool operator<(const const_iterator& other) const { return i < other.i; } - inline bool operator<=(const const_iterator& other) const { return i <= other.i; } - inline bool operator>(const const_iterator& other) const { return i > other.i; } - inline bool operator>=(const const_iterator& other) const { return i >= other.i; } - inline const_iterator &operator++() { ++i; return *this; } - inline const_iterator operator++(int) { const T *n = i; ++i; return n; } - inline const_iterator &operator--() { i--; return *this; } - inline const_iterator operator--(int) { const T *n = i; i--; return n; } - inline const_iterator &operator+=(int j) { i+=j; return *this; } - inline const_iterator &operator-=(int j) { i-=j; return *this; } - inline const_iterator operator+(int j) const { return const_iterator(i+j); } - inline const_iterator operator-(int j) const { return const_iterator(i-j); } - friend inline const_iterator operator+(int j, const_iterator k) { return k + j; } - inline int operator-(const_iterator j) const { return i - j.i; } - inline operator const T*() const { return i; } - }; - friend class const_iterator; -#else typedef T* iterator; typedef const T* const_iterator; -#endif class AlignmentDummy { QArrayData header; T data; }; diff --git a/tests/auto/concurrent/qtconcurrentfilter/.prev_CMakeLists.txt b/tests/auto/concurrent/qtconcurrentfilter/.prev_CMakeLists.txt index 62b0308851..be8c936c48 100644 --- a/tests/auto/concurrent/qtconcurrentfilter/.prev_CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentfilter/.prev_CMakeLists.txt @@ -7,8 +7,6 @@ add_qt_test(tst_qtconcurrentfilter SOURCES tst_qtconcurrentfilter.cpp - DEFINES - -QT_NO_LINKED_LIST PUBLIC_LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt index 9da443a3f9..7868906178 100644 --- a/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt @@ -4,12 +4,9 @@ ## tst_qtconcurrentfilter Test: ##################################################################### -add_qt_test(tst_qtconcurrentfilter +qt_add_test(tst_qtconcurrentfilter SOURCES tst_qtconcurrentfilter.cpp - DEFINES - # -QT_NO_LINKED_LIST # special case remove until figured out how to deal with this - QT_STRICT_ITERATORS PUBLIC_LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt index 8ae79db0cf..c14780e0de 100644 --- a/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt @@ -4,12 +4,9 @@ ## tst_qtconcurrentmap Test: ##################################################################### -add_qt_test(tst_qtconcurrentmap +qt_add_test(tst_qtconcurrentmap SOURCES tst_qtconcurrentmap.cpp - DEFINES - # -QT_NO_LINKED_LIST # special case remove until we figure this out - QT_STRICT_ITERATORS PUBLIC_LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/corelib/thread/qfuture/CMakeLists.txt b/tests/auto/corelib/thread/qfuture/CMakeLists.txt index db1afabc0d..6fdfc977e9 100644 --- a/tests/auto/corelib/thread/qfuture/CMakeLists.txt +++ b/tests/auto/corelib/thread/qfuture/CMakeLists.txt @@ -4,12 +4,11 @@ ## tst_qfuture Test: ##################################################################### -add_qt_test(tst_qfuture +qt_add_test(tst_qfuture SOURCES tst_qfuture.cpp - DEFINES - # -QT_NO_JAVA_STYLE_ITERATORS # special case - QT_STRICT_ITERATORS +# DEFINES +# -QT_NO_JAVA_STYLE_ITERATORS PUBLIC_LIBRARIES Qt::CorePrivate ) -- cgit v1.2.3