From b14891e3d29e7c19717aaa77bb63aad94e358f4d Mon Sep 17 00:00:00 2001 From: Sami Shalayel Date: Mon, 16 Sep 2024 11:53:17 +0200 Subject: SourceLocation: make begin() and end() qsizetype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change begin() and end() to return a qsizetype, as now we only process QML files where quint32 can safely be casted to qsizetype. This allows to change all users of begin() and end() to use qsizetype, and to silence all MSVC compile warnings about comparison of ints with different signedness. Fixes: QTBUG-127833 Change-Id: I251435aa598386effe0259549dbe94d17b0d806b Reviewed-by: Olivier De Cannière --- src/qmlcompiler/qqmlsasourcelocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qmlcompiler/qqmlsasourcelocation.cpp') diff --git a/src/qmlcompiler/qqmlsasourcelocation.cpp b/src/qmlcompiler/qqmlsasourcelocation.cpp index 63b61cce5b..bc22d1b93a 100644 --- a/src/qmlcompiler/qqmlsasourcelocation.cpp +++ b/src/qmlcompiler/qqmlsasourcelocation.cpp @@ -38,7 +38,7 @@ bool QQmlSA::SourceLocation::isValid() const */ quint32 QQmlSA::SourceLocation::begin() const { - return QQmlSA::SourceLocationPrivate::sourceLocation(*this).begin(); + return offset(); } /*! @@ -46,7 +46,7 @@ quint32 QQmlSA::SourceLocation::begin() const */ quint32 QQmlSA::SourceLocation::end() const { - return QQmlSA::SourceLocationPrivate::sourceLocation(*this).end(); + return offset() + length(); } /*! -- cgit v1.2.3