summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2020-07-15 13:45:20 -0400
committerGravatar Lioncash2020-07-15 13:45:22 -0400
commitaf5a56ddc4454fe81183b940c73038909189cf6f (patch)
treeefabea58cda5d6a1d32576daf661adafe4dcd548 /src
parentsettings: Make use of std::string_view over std::string for logging (diff)
downloadyuzu-af5a56ddc4454fe81183b940c73038909189cf6f.tar.gz
yuzu-af5a56ddc4454fe81183b940c73038909189cf6f.tar.xz
yuzu-af5a56ddc4454fe81183b940c73038909189cf6f.zip
settings: Resolve a sign conversion warning within GetTimeZoneString()
A sign conversion warning was occurring due to an int < size_t comparison.
Diffstat (limited to '')
-rw-r--r--src/core/settings.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/settings.cpp b/src/core/settings.cpp
index 74d558284..eb39e81da 100644
--- a/src/core/settings.cpp
+++ b/src/core/settings.cpp
@@ -67,18 +67,18 @@ Values values = {};
67bool configuring_global = true; 67bool configuring_global = true;
68 68
69std::string GetTimeZoneString() { 69std::string GetTimeZoneString() {
70 static constexpr std::array<const char*, 46> timezones{{ 70 static constexpr std::array timezones{
71 "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire", 71 "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire",
72 "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", 72 "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0",
73 "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan", 73 "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan",
74 "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT", 74 "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT",
75 "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey", 75 "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey",
76 "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu", 76 "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu",
77 }}; 77 };
78
79 ASSERT(Settings::values.time_zone_index.GetValue() < timezones.size());
80 78
81 return timezones[Settings::values.time_zone_index.GetValue()]; 79 const auto time_zone_index = static_cast<std::size_t>(values.time_zone_index.GetValue());
80 ASSERT(time_zone_index < timezones.size());
81 return timezones[time_zone_index];
82} 82}
83 83
84void Apply() { 84void Apply() {