From 801f269fa9a42a84683e2bcddc2fd166725031e5 Mon Sep 17 00:00:00 2001 From: obligaron Date: Tue, 21 Jan 2025 22:31:15 +0100 Subject: [PATCH 1/2] Fix MSVC x64 warnings --- Source/DiabloUI/settingsmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/DiabloUI/settingsmenu.cpp b/Source/DiabloUI/settingsmenu.cpp index d30d73a5e70..8d73c7febbb 100644 --- a/Source/DiabloUI/settingsmenu.cpp +++ b/Source/DiabloUI/settingsmenu.cpp @@ -536,7 +536,7 @@ void UiSettingsMenu() constexpr int ListItemHeight = 26; rectList = { uiRectangle.position + Displacement { 50, 204 }, - Size { uiRectangle.size.width - 100, std::min(vecDialogItems.size() * ListItemHeight, uiRectangle.size.height - 272) } }; + Size { uiRectangle.size.width - 100, std::min(static_cast(vecDialogItems.size()) * ListItemHeight, uiRectangle.size.height - 272) } }; rectDescription = { rectList.position + Displacement { -26, rectList.size.height + descriptionMarginTop }, Size { uiRectangle.size.width - 50, 80 - descriptionMarginTop } }; vecDialog.push_back(std::make_unique((*ArtScrollBarBackground)[0], (*ArtScrollBarThumb)[0], From 4d574d569b5d481a090aae94ddd0e350762abe38 Mon Sep 17 00:00:00 2001 From: obligaron Date: Tue, 21 Jan 2025 22:33:19 +0100 Subject: [PATCH 2/2] Fix MSVC x86 warnings --- Source/options.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/options.cpp b/Source/options.cpp index 228112a4394..b9221c30d7c 100644 --- a/Source/options.cpp +++ b/Source/options.cpp @@ -97,8 +97,8 @@ void LoadIni() if (file != nullptr) { uintmax_t size; if (GetFileSize(path.c_str(), &size)) { - buffer.resize(size); - if (std::fread(buffer.data(), size, 1, file) != 1) { + buffer.resize(static_cast(size)); + if (std::fread(buffer.data(), static_cast(size), 1, file) != 1) { const char *errorMessage = std::strerror(errno); if (errorMessage == nullptr) errorMessage = ""; LogError(LogCategory::System, "std::fread: failed with \"{}\"", errorMessage);