Browse Source

Fix MSVC warnings (#7666)

* Fix MSVC x64 warnings

* Fix MSVC x86 warnings
pull/7667/merge
obligaron 1 year ago committed by GitHub
parent
commit
b169d91c48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      Source/DiabloUI/settingsmenu.cpp
  2. 4
      Source/options.cpp

2
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<int>(vecDialogItems.size() * ListItemHeight, uiRectangle.size.height - 272) } };
Size { uiRectangle.size.width - 100, std::min<int>(static_cast<int>(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<UiScrollbar>((*ArtScrollBarBackground)[0], (*ArtScrollBarThumb)[0],

4
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_t>(size));
if (std::fread(buffer.data(), static_cast<size_t>(size), 1, file) != 1) {
const char *errorMessage = std::strerror(errno);
if (errorMessage == nullptr) errorMessage = "";
LogError(LogCategory::System, "std::fread: failed with \"{}\"", errorMessage);

Loading…
Cancel
Save