(Windows) Fixed some MSVC compiler warnings.

This commit is contained in:
Leon Styhre 2023-02-18 11:55:36 +01:00
parent 6ee62fb31f
commit 43a18146d5

View file

@ -62,7 +62,7 @@ void GuiThemeDownloader::parseThemesList()
for (auto& themeObject : themeObjects) { for (auto& themeObject : themeObjects) {
if (doc.HasMember(themeObject.c_str()) && doc[themeObject.c_str()].IsArray()) { if (doc.HasMember(themeObject.c_str()) && doc[themeObject.c_str()].IsArray()) {
const rapidjson::Value& themeSets {doc[themeObject.c_str()]}; const rapidjson::Value& themeSets {doc[themeObject.c_str()]};
for (size_t i {0}; i < themeSets.Size(); ++i) { for (int i {0}; i < static_cast<int>(themeSets.Size()); ++i) {
ThemeEntry themeEntry; ThemeEntry themeEntry;
const rapidjson::Value& theme {themeSets[i]}; const rapidjson::Value& theme {themeSets[i]};
@ -80,31 +80,31 @@ void GuiThemeDownloader::parseThemesList()
if (theme.HasMember("variants") && theme["variants"].IsArray()) { if (theme.HasMember("variants") && theme["variants"].IsArray()) {
const rapidjson::Value& variants {theme["variants"]}; const rapidjson::Value& variants {theme["variants"]};
for (size_t i {0}; i < variants.Size(); ++i) for (int i {0}; i < static_cast<int>(variants.Size()); ++i)
themeEntry.variants.emplace_back(variants[i].GetString()); themeEntry.variants.emplace_back(variants[i].GetString());
} }
if (theme.HasMember("colorSchemes") && theme["colorSchemes"].IsArray()) { if (theme.HasMember("colorSchemes") && theme["colorSchemes"].IsArray()) {
const rapidjson::Value& colorSchemes {theme["colorSchemes"]}; const rapidjson::Value& colorSchemes {theme["colorSchemes"]};
for (size_t i {0}; i < colorSchemes.Size(); ++i) for (int i {0}; i < static_cast<int>(colorSchemes.Size()); ++i)
themeEntry.colorSchemes.emplace_back(colorSchemes[i].GetString()); themeEntry.colorSchemes.emplace_back(colorSchemes[i].GetString());
} }
if (theme.HasMember("aspectRatios") && theme["aspectRatios"].IsArray()) { if (theme.HasMember("aspectRatios") && theme["aspectRatios"].IsArray()) {
const rapidjson::Value& aspectRatios {theme["aspectRatios"]}; const rapidjson::Value& aspectRatios {theme["aspectRatios"]};
for (size_t i {0}; i < aspectRatios.Size(); ++i) for (int i {0}; i < static_cast<int>(aspectRatios.Size()); ++i)
themeEntry.aspectRatios.emplace_back(aspectRatios[i].GetString()); themeEntry.aspectRatios.emplace_back(aspectRatios[i].GetString());
} }
if (theme.HasMember("transitions") && theme["transitions"].IsArray()) { if (theme.HasMember("transitions") && theme["transitions"].IsArray()) {
const rapidjson::Value& transitions {theme["transitions"]}; const rapidjson::Value& transitions {theme["transitions"]};
for (size_t i {0}; i < transitions.Size(); ++i) for (int i {0}; i < static_cast<int>(transitions.Size()); ++i)
themeEntry.transitions.emplace_back(transitions[i].GetString()); themeEntry.transitions.emplace_back(transitions[i].GetString());
} }
if (theme.HasMember("screenshots") && theme["screenshots"].IsArray()) { if (theme.HasMember("screenshots") && theme["screenshots"].IsArray()) {
const rapidjson::Value& screenshots {theme["screenshots"]}; const rapidjson::Value& screenshots {theme["screenshots"]};
for (size_t i {0}; i < screenshots.Size(); ++i) { for (int i {0}; i < static_cast<int>(screenshots.Size()); ++i) {
Screenshot screenshotEntry; Screenshot screenshotEntry;
if (screenshots[i].HasMember("image") && screenshots[i]["image"].IsString()) if (screenshots[i].HasMember("image") && screenshots[i]["image"].IsString())
screenshotEntry.image = screenshots[i]["image"].GetString(); screenshotEntry.image = screenshots[i]["image"].GetString();