summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2022-05-24 12:32:02 +0800
committerYuhang Zhao <2546789017@qq.com>2022-05-27 09:33:28 +0800
commit42fe677584dc672f63c2efc812005e3a49f82d10 (patch)
tree765a83adc500b5df69ec23f1895a0cf8824df481 /src/corelib/text
parentfda8eb17417e92f8f80587937463be77899c7bed (diff)
Core: make CLDR data constexpr
Task-number: QTBUG-100485 Pick-to: 6.3 6.2 Change-Id: Ib8c5160ca0994662a5fdc2293dc734c1bdcac4f2 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qlocale_data_p.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/corelib/text/qlocale_data_p.h b/src/corelib/text/qlocale_data_p.h
index 37f63bac93..ceed2589c4 100644
--- a/src/corelib/text/qlocale_data_p.h
+++ b/src/corelib/text/qlocale_data_p.h
@@ -30,14 +30,14 @@ struct TerritoryLanguage
quint16 territoryId;
QLocale::MeasurementSystem system;
};
-static const TerritoryLanguage ImperialMeasurementSystems[] = {
+static constexpr TerritoryLanguage ImperialMeasurementSystems[] = {
{ QLocale::English, QLocale::UnitedStates, QLocale::ImperialUSSystem },
{ QLocale::English, QLocale::UnitedStatesMinorOutlyingIslands, QLocale::ImperialUSSystem },
{ QLocale::Spanish, QLocale::UnitedStates, QLocale::ImperialUSSystem },
{ QLocale::Hawaiian, QLocale::UnitedStates, QLocale::ImperialUSSystem },
{ QLocale::English, QLocale::UnitedKingdom, QLocale::ImperialUKSystem }
};
-static const int ImperialMeasurementSystemsCount =
+static constexpr int ImperialMeasurementSystemsCount =
sizeof(ImperialMeasurementSystems)/sizeof(ImperialMeasurementSystems[0]);
/*
@@ -72,7 +72,7 @@ struct LanguageCodeEntry {
edited) CLDR data; see qtbase/util/locale_database/.
*/
-static const QLocaleId likely_subtags[] = {
+static constexpr QLocaleId likely_subtags[] = {
{ 2, 0, 0 }, { 2, 27, 90 }, // ab -> ab_Cyrl_GE
{ 3, 0, 0 }, { 3, 66, 77 }, // aa -> aa_Latn_ET
{ 4, 0, 0 }, { 4, 66, 216 }, // af -> af_Latn_ZA
@@ -806,7 +806,7 @@ static const QLocaleId likely_subtags[] = {
{ 0, 141, 0 }, { 255, 141, 50 } // und_Yiii -> ii_Yiii_CN
};
-static const quint16 locale_index[] = {
+static constexpr quint16 locale_index[] = {
0, // AnyLanguage
0, // C
1, // Abkhazian
@@ -1140,7 +1140,7 @@ static const quint16 locale_index[] = {
0 // trailing 0
};
-static const QLocaleData locale_data[] = {
+static constexpr QLocaleData locale_data[] = {
// lang script terr lStrt lpMid lpEnd lPair lDelm dec group prcnt zero minus plus exp qtOpn qtEnd altQO altQE lDFmt sDFmt lTFmt sTFmt slDay lDays ssDys sDays snDay nDays am pm byte siQnt iecQn crSym crDsp crFmt crFNg ntLng ntTer currISO curDgt curRnd dow1st wknd+ wknd- grpTop grpMid grpEnd
{ 1, 0, 0, 0, 0, 0, 0, 6, 0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 8, 0, 17, 0, 0, 0, 0, 56, 56, 83, 96, 0, 0, 0, 5, 22, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 17, 10, 10, 8, 56, 56, 27, 27, 13, 13, 2, 2, 5, 17, 23, 0, 0, 4, 0, 0, 0, {0,0,0}, 2, 1, 1, 6, 7, 1, 3, 3 }, // C/AnyScript/AnyTerritory
{ 2, 27, 90, 0, 0, 0, 0, 6, 0, 1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 27, 44, 0, 0, 56, 56, 56, 56, 83, 83, 0, 0, 0, 5, 22, 0, 0, 4, 0, 0, 0, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 17, 10, 10, 5, 27, 27, 27, 27, 13, 13, 2, 2, 4, 17, 23, 1, 0, 5, 0, 0, 0, {71,69,76}, 2, 1, 1, 6, 7, 1, 3, 3 }, // Abkhazian/Cyrillic/Georgia
@@ -1769,7 +1769,7 @@ static const QLocaleData locale_data[] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0,0,0}, 0, 0, 0, 0, 0, 0, 0, 0 } // trailing zeros
};
-static const char16_t list_pattern_part_data[] = {
+static constexpr char16_t list_pattern_part_data[] = {
0x25, 0x31, 0x2c, 0x20, 0x25, 0x32, 0x3b, 0x25, 0x31, 0x20, 0x65, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x64, 0x68,
0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x1363, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x12a5, 0x1293, 0x20, 0x25, 0x32, 0x25,
0x31, 0x20, 0x12a5, 0x1293, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x648, 0x25, 0x32, 0x61b, 0x25, 0x31, 0x20, 0x587, 0x20, 0x25,
@@ -1835,14 +1835,14 @@ static const char16_t list_pattern_part_data[] = {
0x20, 0x25, 0x32
};
-static const char16_t single_character_data[] = {
+static constexpr char16_t single_character_data[] = {
0x2e, 0x2c, 0x25, 0x30, 0x2d, 0x2b, 0x65, 0x22, 0x27, 0x45, 0x201c, 0x201d, 0x2018, 0x2019, 0xa0, 0x201e, 0x201a, 0xab, 0xbb, 0x2039,
0x203a, 0x66b, 0x66c, 0x66a, 0x61c, 0x660, 0x61c, 0x2d, 0x61c, 0x2b, 0x627, 0x633, 0x200e, 0x25, 0x200e, 0x200e, 0x2d, 0x200e, 0x2b, 0x9e6,
0x2212, 0x1040, 0x300c, 0x300d, 0x300e, 0x300f, 0x200f, 0x2d, 0x200f, 0x2b, 0xd804, 0xdd36, 0xd7, 0x31, 0x30, 0x5e, 0xf20, 0x202f, 0x2e41, 0xd83a,
0xdd50, 0x6f0, 0x200e, 0x2b, 0x200e, 0xd7, 0x6f1, 0x6f0, 0x5e, 0x966, 0xb7, 0x31, 0x30, 0x5e, 0x200e, 0x2212, 0x1c50, 0x415
};
-static const char16_t date_format_data[] = {
+static constexpr char16_t date_format_data[] = {
0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x20, 0x4d,
0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2c, 0x20,
0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x79, 0x79, 0x2d, 0x4d, 0x4d, 0x2d, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x20, 0x64,
@@ -1932,7 +1932,7 @@ static const char16_t date_format_data[] = {
0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79
};
-static const char16_t time_format_data[] = {
+static constexpr char16_t time_format_data[] = {
0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50,
0x20, 0x74, 0x68, 0x3a, 0x6d, 0x6d, 0x20, 0x41, 0x50, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x2c,
0x20, 0x74, 0x41, 0x50, 0x20, 0x68, 0x2e, 0x6d, 0x6d, 0x2e, 0x73, 0x73, 0x20, 0x74, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a,
@@ -1960,7 +1960,7 @@ static const char16_t time_format_data[] = {
0xe35, 0x20, 0x74, 0x48, 0x3a, 0x6d, 0x6d, 0x20, 0x27, 0x68, 0x6f, 0x64, 0x17a, 0x27, 0x2e
};
-static const char16_t days_data[] = {
+static constexpr char16_t days_data[] = {
0x53, 0x75, 0x6e, 0x64, 0x61, 0x79, 0x3b, 0x4d, 0x6f, 0x6e, 0x64, 0x61, 0x79, 0x3b, 0x54, 0x75, 0x65, 0x73, 0x64, 0x61,
0x79, 0x3b, 0x57, 0x65, 0x64, 0x6e, 0x65, 0x73, 0x64, 0x61, 0x79, 0x3b, 0x54, 0x68, 0x75, 0x72, 0x73, 0x64, 0x61, 0x79,
0x3b, 0x46, 0x72, 0x69, 0x64, 0x61, 0x79, 0x3b, 0x53, 0x61, 0x74, 0x75, 0x72, 0x64, 0x61, 0x79, 0x53, 0x75, 0x6e, 0x3b,
@@ -3073,7 +3073,7 @@ static const char16_t days_data[] = {
0x4d, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x53, 0x3b, 0x59, 0x3b, 0x53
};
-static const char16_t byte_unit_data[] = {
+static constexpr char16_t byte_unit_data[] = {
0x62, 0x79, 0x74, 0x65, 0x73, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x50, 0x42, 0x3b,
0x45, 0x42, 0x4b, 0x69, 0x42, 0x3b, 0x4d, 0x69, 0x42, 0x3b, 0x47, 0x69, 0x42, 0x3b, 0x54, 0x69, 0x42, 0x3b, 0x50, 0x69,
0x42, 0x3b, 0x45, 0x69, 0x42, 0x67, 0x72, 0x65, 0x65, 0x70, 0x62, 0x61, 0x6a, 0x74, 0x1263, 0x12ed, 0x1275, 0x12aa, 0x1263, 0x3b,
@@ -3145,7 +3145,7 @@ static const char16_t byte_unit_data[] = {
0x65, 0x20, 0x61, 0x67, 0x62, 0x79, 0x74, 0x65, 0x2d, 0x69, 0x74, 0x61
};
-static const char16_t am_data[] = {
+static constexpr char16_t am_data[] = {
0x41, 0x4d, 0x76, 0x6d, 0x2e, 0x61, 0x2e, 0x67, 0x41, 0x4e, 0x65, 0x20, 0x70, 0x61, 0x72, 0x61, 0x64, 0x69, 0x74, 0x65,
0x73, 0x1325, 0x12cb, 0x1275, 0x635, 0x9aa, 0x9c2, 0x9f0, 0x9cd, 0x9ac, 0x9be, 0x9b9, 0x9cd, 0x9a8, 0x64, 0x65, 0x20, 0x6c, 0x61, 0x20,
0x6d, 0x61, 0xf1, 0x61, 0x6e, 0x61, 0x69, 0x63, 0x68, 0x65, 0x68, 0x65, 0x61, 0x76, 0x6f, 0x410, 0x41c, 0x73, 0xe1, 0x72,
@@ -3189,7 +3189,7 @@ static const char16_t am_data[] = {
0x300
};
-static const char16_t pm_data[] = {
+static constexpr char16_t pm_data[] = {
0x50, 0x4d, 0x6e, 0x6d, 0x2e, 0x61, 0x2e, 0x6b, 0x45, 0x57, 0x65, 0x20, 0x70, 0x61, 0x73, 0x64, 0x69, 0x74, 0x65, 0x73,
0x12a8, 0x1230, 0x12d3, 0x1275, 0x645, 0x985, 0x9aa, 0x9f0, 0x9be, 0x9b9, 0x9cd, 0x9a8, 0x64, 0x65, 0x20, 0x6c, 0x61, 0x20, 0x74, 0x61,
0x72, 0x64, 0x65, 0x69, 0x63, 0x68, 0x61, 0x6d, 0x74, 0x68, 0x69, 0x41f, 0x41c, 0x63, 0x25b, 0x25b, 0x301, 0x6e, 0x6b, 0x6f,
@@ -3234,7 +3234,7 @@ static const char16_t pm_data[] = {
0x5db, 0x5de, 0x5d9, 0x5d8, 0x5d0, 0x5b8, 0x5d2, 0x1ecc, 0x300, 0x73, 0xe1, 0x6e, 0x186, 0x300, 0x73, 0xe1, 0x6e
};
-static const char16_t currency_symbol_data[] = {
+static constexpr char16_t currency_symbol_data[] = {
0x20be, 0x52, 0x24, 0x46, 0x43, 0x46, 0x41, 0x47, 0x48, 0x20b5, 0x4c, 0x65, 0x6b, 0xeb, 0x20ac, 0x64, 0x65, 0x6e, 0x1265, 0x122d,
0x62c, 0x2e, 0x645, 0x2e, 0x200f, 0x62f, 0x2e, 0x62c, 0x2e, 0x200f, 0x62f, 0x2e, 0x628, 0x2e, 0x200f, 0x46, 0x64, 0x6a, 0x4e, 0x66,
0x6b, 0x62f, 0x2e, 0x639, 0x2e, 0x200f, 0x20aa, 0x62f, 0x2e, 0x623, 0x2e, 0x200f, 0x62f, 0x2e, 0x643, 0x2e, 0x200f, 0x644, 0x2e, 0x644,
@@ -3255,7 +3255,7 @@ static const char16_t currency_symbol_data[] = {
0x6d, 0x441, 0x45e, 0x43c
};
-static const char16_t currency_display_name_data[] = {
+static constexpr char16_t currency_display_name_data[] = {
0x53, 0x75, 0x69, 0x64, 0x2d, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x64,
0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x43, 0x46, 0x41, 0x20,
0x46, 0xe0, 0x6c, 0xe2, 0x14b, 0x20, 0x42, 0x45, 0x41, 0x43, 0x47, 0x68, 0x61, 0x6e, 0x61, 0x20, 0x53, 0x69, 0x64, 0x69,
@@ -3535,14 +3535,14 @@ static const char16_t currency_display_name_data[] = {
0x6e, 0x65, 0x73, 0x75, 0x65, 0x72, 0x61, 0x77, 0x61, 0x72, 0x61
};
-static const char16_t currency_format_data[] = {
+static constexpr char16_t currency_format_data[] = {
0x25, 0x31, 0x25, 0x32, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x25, 0x32, 0x25, 0x31, 0x28, 0x25, 0x32, 0x25, 0x31, 0x29, 0x25,
0x31, 0xa0, 0x25, 0x32, 0x28, 0x25, 0x31, 0xa0, 0x25, 0x32, 0x29, 0x28, 0x25, 0x31, 0x25, 0x32, 0x29, 0x28, 0x25, 0x32,
0xa0, 0x25, 0x31, 0x29, 0x25, 0x32, 0x2d, 0x25, 0x31, 0x25, 0x32, 0x2212, 0x25, 0x31, 0x25, 0x32, 0x2d, 0xa0, 0x25, 0x31,
0x200e, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x200e, 0x28, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x29
};
-static const char16_t endonyms_data[] = {
+static constexpr char16_t endonyms_data[] = {
0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x53, 0x75, 0x69, 0x64, 0x2d, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61,
0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0xeb, 0x41, 0x67, 0x68, 0x65, 0x6d, 0x4b, 0xe0, 0x6d, 0xe0, 0x6c, 0xfb, 0x14b, 0x41,
0x6b, 0x61, 0x6e, 0x47, 0x61, 0x61, 0x6e, 0x61, 0x73, 0x68, 0x71, 0x69, 0x70, 0x53, 0x68, 0x71, 0x69, 0x70, 0xeb, 0x72,
@@ -3856,7 +3856,7 @@ static const char16_t endonyms_data[] = {
0x75, 0x65, 0x72, 0x61
};
-static const char language_name_list[] =
+static constexpr char language_name_list[] =
"Default\0"
"C\0"
"Abkhazian\0"
@@ -4189,7 +4189,7 @@ static const char language_name_list[] =
"Nheengatu\0"
;
-static const quint16 language_name_index[] = {
+static constexpr quint16 language_name_index[] = {
0, // AnyLanguage
8, // C
10, // Abkhazian
@@ -4522,7 +4522,7 @@ static const quint16 language_name_index[] = {
2748, // Nheengatu
};
-static const char script_name_list[] =
+static constexpr char script_name_list[] =
"Default\0"
"Adlam\0"
"Ahom\0"
@@ -4667,7 +4667,7 @@ static const char script_name_list[] =
"Yi\0"
;
-static const quint16 script_name_index[] = {
+static constexpr quint16 script_name_index[] = {
0, // AnyScript
8, // Adlam
14, // Ahom
@@ -4812,7 +4812,7 @@ static const quint16 script_name_index[] = {
1312, // Yi
};
-static const char territory_name_list[] =
+static constexpr char territory_name_list[] =
"Default\0"
"Afghanistan\0"
"Aland Islands\0"
@@ -5077,7 +5077,7 @@ static const char territory_name_list[] =
"Zimbabwe\0"
;
-static const quint16 territory_name_index[] = {
+static constexpr quint16 territory_name_index[] = {
0, // AnyTerritory
8, // Afghanistan
20, // Aland Islands
@@ -5675,7 +5675,7 @@ constexpr std::array<LanguageCodeEntry, 330> languageCodeList {
LanguageCodeEntry {{}, {}, {}, {{'y', 'r', 'l'}}}, // Nheengatu
};
-static const unsigned char script_code_list[] =
+static constexpr unsigned char script_code_list[] =
"Zzzz" // AnyScript
"Adlm" // Adlam
"Ahom" // Ahom
@@ -5820,7 +5820,7 @@ static const unsigned char script_code_list[] =
"Yiii" // Yi
;
-static const unsigned char territory_code_list[] =
+static constexpr unsigned char territory_code_list[] =
"ZZ\0" // AnyTerritory
"AF\0" // Afghanistan
"AX\0" // Aland Islands