From 52def5c06193356bf53537b59a56ca2fa62fab3d Mon Sep 17 00:00:00 2001 From: Lauri Laanmets Date: Thu, 23 Sep 2021 14:16:54 +0300 Subject: replace int by qsizetype For "count" and "at" methods, the parameter or return type int was replaced by qsizetype. This patch adapts the code to this change. Task-number: QTBUG-96795 Change-Id: Id409ab573cce886649a72538584dfa57264e7dac Reviewed-by: Ivan Solovev Reviewed-by: Alex Blasche --- src/location/declarativemaps/qdeclarativegeoroute.cpp | 4 ++-- src/location/declarativemaps/qdeclarativegeoroute_p.h | 4 ++-- src/location/declarativemaps/qdeclarativegeoroutemodel.cpp | 8 ++++---- src/location/declarativemaps/qdeclarativegeoroutemodel_p.h | 8 ++++---- src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp | 4 ++-- src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h | 4 ++-- src/location/declarativemaps/qparameterizableobject.cpp | 4 ++-- src/location/declarativemaps/qparameterizableobject_p.h | 4 ++-- src/location/declarativeplaces/qdeclarativeplace.cpp | 4 ++-- src/location/declarativeplaces/qdeclarativeplace_p.h | 4 ++-- src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp | 4 ++-- src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h | 4 ++-- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/location/declarativemaps/qdeclarativegeoroute.cpp b/src/location/declarativemaps/qdeclarativegeoroute.cpp index 0144ade9..92f6b0b0 100644 --- a/src/location/declarativemaps/qdeclarativegeoroute.cpp +++ b/src/location/declarativemaps/qdeclarativegeoroute.cpp @@ -254,7 +254,7 @@ void QDeclarativeGeoRoute::segments_append(QQmlListProperty *prop) +qsizetype QDeclarativeGeoRoute::segments_count(QQmlListProperty *prop) { QDeclarativeGeoRoute *declRoute = static_cast(prop->object); return declRoute->segmentsCount(); @@ -263,7 +263,7 @@ int QDeclarativeGeoRoute::segments_count(QQmlListProperty *prop, int index) +QDeclarativeGeoRouteSegment *QDeclarativeGeoRoute::segments_at(QQmlListProperty *prop, qsizetype index) { QDeclarativeGeoRoute *declRoute = static_cast(prop->object); declRoute->initSegments(index); // init only what's needed. diff --git a/src/location/declarativemaps/qdeclarativegeoroute_p.h b/src/location/declarativemaps/qdeclarativegeoroute_p.h index 9d89760a..49b2f984 100644 --- a/src/location/declarativemaps/qdeclarativegeoroute_p.h +++ b/src/location/declarativemaps/qdeclarativegeoroute_p.h @@ -103,8 +103,8 @@ Q_SIGNALS: private: static void segments_append(QQmlListProperty *prop, QDeclarativeGeoRouteSegment *segment); - static int segments_count(QQmlListProperty *prop); - static QDeclarativeGeoRouteSegment *segments_at(QQmlListProperty *prop, int index); + static qsizetype segments_count(QQmlListProperty *prop); + static QDeclarativeGeoRouteSegment *segments_at(QQmlListProperty *prop, qsizetype index); static void segments_clear(QQmlListProperty *prop); void initSegments(unsigned int lastIndex = ~0U); diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp index a3a7fe85..5bad5b71 100644 --- a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp @@ -1586,12 +1586,12 @@ void QDeclarativeGeoRouteQuery::append(QQmlListProperty *p, QObject *v) } } -int QDeclarativeGeoRouteQuery::count(QQmlListProperty *p) +qsizetype QDeclarativeGeoRouteQuery::count(QQmlListProperty *p) { return static_cast(p->object)->m_children.count(); } -QObject *QDeclarativeGeoRouteQuery::at(QQmlListProperty *p, int idx) +QObject *QDeclarativeGeoRouteQuery::at(QQmlListProperty *p, qsizetype idx) { return static_cast(p->object)->m_children.at(idx); } @@ -1908,12 +1908,12 @@ void QDeclarativeGeoWaypoint::append(QQmlListProperty *p, QObject *v) } } -int QDeclarativeGeoWaypoint::count(QQmlListProperty *p) +qsizetype QDeclarativeGeoWaypoint::count(QQmlListProperty *p) { return static_cast(p->object)->m_children.count(); } -QObject *QDeclarativeGeoWaypoint::at(QQmlListProperty *p, int idx) +QObject *QDeclarativeGeoWaypoint::at(QQmlListProperty *p, qsizetype idx) { return static_cast(p->object)->m_children.at(idx); } diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h index d5286cf7..b6405b16 100644 --- a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h +++ b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h @@ -256,8 +256,8 @@ protected: // For quickChildren static void append(QQmlListProperty *p, QObject *v); - static int count(QQmlListProperty *p); - static QObject *at(QQmlListProperty *p, int idx); + static qsizetype count(QQmlListProperty *p); + static QObject *at(QQmlListProperty *p, qsizetype idx); static void clear(QQmlListProperty *p); QQmlListProperty declarativeChildren(); QList m_children; @@ -448,8 +448,8 @@ private Q_SLOTS: protected: static void append(QQmlListProperty *p, QObject *v); - static int count(QQmlListProperty *p); - static QObject *at(QQmlListProperty *p, int idx); + static qsizetype count(QQmlListProperty *p); + static QObject *at(QQmlListProperty *p, qsizetype idx); static void clear(QQmlListProperty *p); QQmlListProperty declarativeChildren(); diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp index a455cc09..19810765 100644 --- a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp +++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp @@ -628,7 +628,7 @@ void QDeclarativeGeoServiceProvider::parameter_append(QQmlListProperty *prop) +qsizetype QDeclarativeGeoServiceProvider::parameter_count(QQmlListProperty *prop) { return static_cast(prop->object)->parameters_.count(); } @@ -636,7 +636,7 @@ int QDeclarativeGeoServiceProvider::parameter_count(QQmlListProperty *prop, int index) +QDeclarativePluginParameter *QDeclarativeGeoServiceProvider::parameter_at(QQmlListProperty *prop, qsizetype index) { return static_cast(prop->object)->parameters_[index]; } diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h index 6c1b0f63..dcda55a1 100644 --- a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h +++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h @@ -199,8 +199,8 @@ private: bool parametersReady(); void tryAttach(); static void parameter_append(QQmlListProperty *prop, QDeclarativePluginParameter *mapObject); - static int parameter_count(QQmlListProperty *prop); - static QDeclarativePluginParameter *parameter_at(QQmlListProperty *prop, int index); + static qsizetype parameter_count(QQmlListProperty *prop); + static QDeclarativePluginParameter *parameter_at(QQmlListProperty *prop, qsizetype index); static void parameter_clear(QQmlListProperty *prop); QGeoServiceProvider *sharedProvider_; diff --git a/src/location/declarativemaps/qparameterizableobject.cpp b/src/location/declarativemaps/qparameterizableobject.cpp index b1e588e6..6c87819a 100644 --- a/src/location/declarativemaps/qparameterizableobject.cpp +++ b/src/location/declarativemaps/qparameterizableobject.cpp @@ -66,12 +66,12 @@ void QParameterizableObject::append(QQmlListProperty *p, QObject *v) object->appendChild(v); } -int QParameterizableObject::count(QQmlListProperty *p) +qsizetype QParameterizableObject::count(QQmlListProperty *p) { return static_cast(p->object)->m_children.count(); } -QObject *QParameterizableObject::at(QQmlListProperty *p, int idx) +QObject *QParameterizableObject::at(QQmlListProperty *p, qsizetype idx) { return static_cast(p->object)->m_children.at(idx); } diff --git a/src/location/declarativemaps/qparameterizableobject_p.h b/src/location/declarativemaps/qparameterizableobject_p.h index 21a096e0..b0fd3132 100644 --- a/src/location/declarativemaps/qparameterizableobject_p.h +++ b/src/location/declarativemaps/qparameterizableobject_p.h @@ -87,8 +87,8 @@ protected: virtual void clearChildren(); static void append(QQmlListProperty *p, QObject *v); - static int count(QQmlListProperty *p); - static QObject *at(QQmlListProperty *p, int idx); + static qsizetype count(QQmlListProperty *p); + static QObject *at(QQmlListProperty *p, qsizetype idx); static void clear(QQmlListProperty *p); QQmlListProperty declarativeChildren(); diff --git a/src/location/declarativeplaces/qdeclarativeplace.cpp b/src/location/declarativeplaces/qdeclarativeplace.cpp index 74a8f0c0..fb5543ab 100644 --- a/src/location/declarativeplaces/qdeclarativeplace.cpp +++ b/src/location/declarativeplaces/qdeclarativeplace.cpp @@ -925,7 +925,7 @@ void QDeclarativePlace::category_append(QQmlListProperty * /*! \internal */ -int QDeclarativePlace::category_count(QQmlListProperty *prop) +qsizetype QDeclarativePlace::category_count(QQmlListProperty *prop) { return static_cast(prop->object)->m_categories.count(); } @@ -934,7 +934,7 @@ int QDeclarativePlace::category_count(QQmlListProperty *pr \internal */ QDeclarativeCategory *QDeclarativePlace::category_at(QQmlListProperty *prop, - int index) + qsizetype index) { QDeclarativePlace *object = static_cast(prop->object); QDeclarativeCategory *res = NULL; diff --git a/src/location/declarativeplaces/qdeclarativeplace_p.h b/src/location/declarativeplaces/qdeclarativeplace_p.h index bfe36936..214b10a4 100644 --- a/src/location/declarativeplaces/qdeclarativeplace_p.h +++ b/src/location/declarativeplaces/qdeclarativeplace_p.h @@ -137,8 +137,8 @@ public: QQmlListProperty categories(); static void category_append(QQmlListProperty *prop, QDeclarativeCategory *value); - static int category_count(QQmlListProperty *prop); - static QDeclarativeCategory *category_at(QQmlListProperty *prop, int index); + static qsizetype category_count(QQmlListProperty *prop); + static QDeclarativeCategory *category_at(QQmlListProperty *prop, qsizetype index); static void category_clear(QQmlListProperty *prop); QDeclarativeGeoLocation *location(); diff --git a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp index 9129731b..98fde1c6 100644 --- a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp +++ b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp @@ -412,7 +412,7 @@ void QDeclarativeSearchResultModel::categories_append(QQmlListProperty *list) +qsizetype QDeclarativeSearchResultModel::categories_count(QQmlListProperty *list) { QDeclarativeSearchResultModel *searchModel = qobject_cast(list->object); if (searchModel) @@ -422,7 +422,7 @@ int QDeclarativeSearchResultModel::categories_count(QQmlListProperty *list, - int index) + qsizetype index) { QDeclarativeSearchResultModel *searchModel = qobject_cast(list->object); if (searchModel && (searchModel->m_categories.count() > index) && (index > -1)) diff --git a/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h b/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h index 40c2e47c..3cac8fcb 100644 --- a/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h +++ b/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h @@ -98,8 +98,8 @@ public: QQmlListProperty categories(); static void categories_append(QQmlListProperty *list, QDeclarativeCategory *category); - static int categories_count(QQmlListProperty *list); - static QDeclarativeCategory *category_at(QQmlListProperty *list, int index); + static qsizetype categories_count(QQmlListProperty *list); + static QDeclarativeCategory *category_at(QQmlListProperty *list, qsizetype index); static void categories_clear(QQmlListProperty *list); QString recommendationId() const; -- cgit v1.2.3