Skip to content

Commit

Permalink
Fix remaining compiler warnings on Windows/MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Jun 10, 2024
1 parent 223fe7b commit 64925c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/app/dialog_inspect_xde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,9 @@ static QTreeWidgetItem* createPropertyTreeItem(const QString& text, const OccHan
else if (imgTexture->DataBuffer() && !imgTexture->DataBuffer()->IsEmpty()) {
// Texture is provided by some embedded data
item->setText(1, DialogInspectXde::tr("<data>"));
const OccHandle<NCollection_Buffer>& buff = imgTexture->DataBuffer();
item->setImage(1, QByteArray::fromRawData(reinterpret_cast<const char*>(buff->Data()), buff->Size()));
const char* buffData = reinterpret_cast<const char*>(imgTexture->DataBuffer()->Data());
const int buffSize = Cpp::safeStaticCast<int>(imgTexture->DataBuffer()->Size());
item->setImage(1, QByteArray::fromRawData(buffData, buffSize));
}

return item;
Expand Down
2 changes: 1 addition & 1 deletion src/base/string_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ std::string toUtf8String(std::string_view str, const std::locale& locale)
return {};

// Encode intermediate utf16 string to utf8
const int lenUtf16 = utf16.size() - 1;
const int lenUtf16 = Cpp::safeStaticCast<int>(utf16.size()) - 1;
const int lenUtf8 = WideCharToMultiByte(CP_UTF8, 0, utf16.data(), lenUtf16, nullptr, 0, nullptr, nullptr);
thread_local std::vector<char> utf8;
utf8.resize(lenUtf8 + 1);
Expand Down
2 changes: 1 addition & 1 deletion src/io_ply/miniply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ namespace miniply {
return 0;
}
const PLYProperty& prop = element()->properties[propIdx];
return prop.listData.size() / kPLYPropertySize[uint32_t(prop.type)];
return static_cast<uint32_t>(prop.listData.size() / kPLYPropertySize[uint32_t(prop.type)]);
}


Expand Down

0 comments on commit 64925c4

Please sign in to comment.