diff --git a/src/corelib/text/qlocale_mac.mm b/src/corelib/text/qlocale_mac.mm index 7ed7c34f3b..9a9cc4d158 100644 --- a/src/corelib/text/qlocale_mac.mm +++ b/src/corelib/text/qlocale_mac.mm @@ -128,13 +128,13 @@ static QString macZeroDigit() return QString::fromCFString(value); } -static QString zeroPad(QString &&number, int minDigits, const QString &zero) +static QString zeroPad(QString &&number, qsizetype minDigits, const QString &zero) { // Need to pad with zeros, possibly after a sign. - int insert = -1, digits = 0; + qsizetype insert = -1, digits = 0; auto it = QStringIterator(number); while (it.hasNext()) { - int here = it.index(); + qsizetype here = it.index(); if (QChar::isDigit(it.next())) { if (insert < 0) insert = here; @@ -154,10 +154,10 @@ static QString trimTwoDigits(QString &&number) // Retain any sign, but remove all but the last two digits. // We know number has at least four digits - it came from fourDigitYear(). // Note that each digit might be a surrogate pair. - int first = -1, prev = -1, last = -1; + qsizetype first = -1, prev = -1, last = -1; auto it = QStringIterator(number); while (it.hasNext()) { - int here = it.index(); + qsizetype here = it.index(); if (QChar::isDigit(it.next())) { if (first == -1) last = first = here; diff --git a/src/corelib/text/qstringiterator_p.h b/src/corelib/text/qstringiterator_p.h index 4665d73895..8d13778186 100644 --- a/src/corelib/text/qstringiterator_p.h +++ b/src/corelib/text/qstringiterator_p.h @@ -40,7 +40,7 @@ public: { } - inline explicit QStringIterator(const QChar *begin, int idx, const QChar *end) + explicit QStringIterator(const QChar *begin, qsizetype idx, const QChar *end) : i(begin), pos(begin + idx), e(end) @@ -52,9 +52,9 @@ public: return pos; } - inline int index() const + qsizetype index() const { - return int(pos - i); + return pos - i; } inline void setPosition(QString::const_iterator position)