summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qlocale_p.h')
-rw-r--r--src/corelib/text/qlocale_p.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h
index 061e566d68..121e6123a2 100644
--- a/src/corelib/text/qlocale_p.h
+++ b/src/corelib/text/qlocale_p.h
@@ -31,7 +31,6 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_SYSTEMLOCALE
struct QLocaleData;
// Subclassed by Android platform plugin:
class Q_CORE_EXPORT QSystemLocale
@@ -101,14 +100,13 @@ public:
virtual QVariant query(QueryType type, QVariant in = QVariant()) const;
virtual QLocale fallbackLocale() const;
- inline uint fallbackLocaleIndex() const;
+ inline qsizetype fallbackLocaleIndex() const;
private:
QSystemLocale(bool);
friend class QSystemLocaleSingleton;
};
Q_DECLARE_TYPEINFO(QSystemLocale::QueryType, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QSystemLocale::CurrencyToStringArgument, Q_RELOCATABLE_TYPE);
-#endif
#if QT_CONFIG(icu)
namespace QIcu {
@@ -161,7 +159,7 @@ struct QLocaleData
public:
// Having an index for each locale enables us to have diverse sources of
// data, e.g. calendar locales, as well as the main CLDR-derived data.
- [[nodiscard]] static int findLocaleIndex(QLocaleId localeId);
+ [[nodiscard]] static qsizetype findLocaleIndex(QLocaleId localeId);
[[nodiscard]] static const QLocaleData *c();
enum DoubleForm {
@@ -292,11 +290,11 @@ public:
{
return { reinterpret_cast<const QChar *>(table + offset), size };
}
- [[nodiscard]] QString getListEntry(const char16_t *table, int index) const
+ [[nodiscard]] QString getListEntry(const char16_t *table, qsizetype index) const
{
return listEntry(table, index).getData(table);
}
- [[nodiscard]] QStringView viewListEntry(const char16_t *table, int index) const
+ [[nodiscard]] QStringView viewListEntry(const char16_t *table, qsizetype index) const
{
return listEntry(table, index).viewData(table);
}
@@ -309,7 +307,7 @@ public:
return 0;
}
private:
- [[nodiscard]] DataRange listEntry(const char16_t *table, int index) const
+ [[nodiscard]] DataRange listEntry(const char16_t *table, qsizetype index) const
{
const char16_t separator = ';';
quint16 i = 0;
@@ -372,7 +370,7 @@ public:
class QLocalePrivate
{
public:
- constexpr QLocalePrivate(const QLocaleData *data, const uint index,
+ constexpr QLocalePrivate(const QLocaleData *data, qsizetype index,
QLocale::NumberOptions numberOptions = QLocale::DefaultNumberOptions,
int refs = 0)
: m_data(data), ref Q_BASIC_ATOMIC_INITIALIZER(refs),
@@ -410,14 +408,14 @@ public:
// System locale has an m_data all its own; all others have m_data = locale_data + m_index
const QLocaleData *const m_data;
QBasicAtomicInt ref;
- const uint m_index;
+ const qsizetype m_index;
QLocale::NumberOptions m_numberOptions;
static QBasicAtomicInt s_generation;
};
#ifndef QT_NO_SYSTEMLOCALE
-uint QSystemLocale::fallbackLocaleIndex() const { return fallbackLocale().d->m_index; }
+qsizetype QSystemLocale::fallbackLocaleIndex() const { return fallbackLocale().d->m_index; }
#endif
template <>
@@ -476,7 +474,7 @@ inline char QLocaleData::numericToCLocale(QStringView in) const
// Also used to merely skip over an escape in a format string, advancint idx to
// point after it (so not [[nodiscard]]):
-QString qt_readEscapedFormatString(QStringView format, int *idx);
+QString qt_readEscapedFormatString(QStringView format, qsizetype *idx);
[[nodiscard]] bool qt_splitLocaleName(QStringView name, QStringView *lang = nullptr,
QStringView *script = nullptr, QStringView *cntry = nullptr);
[[nodiscard]] qsizetype qt_repeatCount(QStringView s);