From 087db1d000980d7b1beab9dfe88104eb885d62f2 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 8 Jan 2025 12:15:31 +0100 Subject: [PATCH] JNI: fix declaration of QJniArray(Mutable)Iterator postfix operators As per the standard at [1], the second parameter has to be int, while difference_type is jint (which is also int, so no difference in practice, esp for the already released QJniArrayIterator). https://eel.is/c++draft/over.oper#over.inc-1.sentence-3 Addresses API review comment. Change-Id: Idea11f83048b9b65548ec1ac8abc2586c6e61a27 Reviewed-by: Assam Boudjelthia (cherry picked from commit 291c5ec433131d43921e77f3b6565e89cc0b3420) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qjniarray.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qjniarray.h b/src/corelib/kernel/qjniarray.h index d93353964ca..bfee8c1acd9 100644 --- a/src/corelib/kernel/qjniarray.h +++ b/src/corelib/kernel/qjniarray.h @@ -86,7 +86,7 @@ public: ++that.m_index; return that; } - friend QJniArrayIterator operator++(QJniArrayIterator &that, difference_type) noexcept + friend QJniArrayIterator operator++(QJniArrayIterator &that, int) noexcept { auto copy = that; ++that; @@ -110,7 +110,7 @@ public: --that.m_index; return that; } - friend QJniArrayIterator operator--(QJniArrayIterator &that, difference_type) noexcept + friend QJniArrayIterator operator--(QJniArrayIterator &that, int) noexcept { auto copy = that; --that; @@ -228,7 +228,7 @@ public: ++that.m_index; return that; } - friend QJniArrayMutableIterator operator++(QJniArrayMutableIterator &that, difference_type) noexcept + friend QJniArrayMutableIterator operator++(QJniArrayMutableIterator &that, int) noexcept { auto copy = that; ++that; @@ -252,7 +252,7 @@ public: --that.m_index; return that; } - friend QJniArrayMutableIterator operator--(QJniArrayMutableIterator &that, difference_type) noexcept + friend QJniArrayMutableIterator operator--(QJniArrayMutableIterator &that, int) noexcept { auto copy = that; --that;