Skip to content

Commit

Permalink
Fix MSVC warnings (#7666)
Browse files Browse the repository at this point in the history
* Fix MSVC x64 warnings

* Fix MSVC x86 warnings
  • Loading branch information
obligaron authored Jan 21, 2025
1 parent f793d33 commit b169d91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/DiabloUI/settingsmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
4 changes: 2 additions & 2 deletions Source/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b169d91

Please sign in to comment.