fix: Various MSVC warnings

This commit is contained in:
WerWolv
2025-02-01 20:54:00 +01:00
parent ed37a3711f
commit 645b43e9cc
7 changed files with 20 additions and 11 deletions

View File

@@ -368,8 +368,11 @@ namespace hex::plugin::builtin {
},
[](const std::string &value, std::endian endian) -> std::vector<u8> {
std::vector<u8> bytes;
auto wideString = wolv::util::utf8ToWstring(value.c_str(), "Invalid");
std::copy(wideString.begin(), wideString.end(), std::back_inserter(bytes));
auto wideString = wolv::util::utf8ToWstring(value.c_str(), "");
if (wideString.empty()) return bytes;
bytes.resize(wideString.size() * sizeof(wchar_t));
std::memcpy(bytes.data(), wideString.data(), bytes.size());
if (endian != std::endian::native)
std::reverse(bytes.begin(), bytes.end());

View File

@@ -56,7 +56,7 @@ namespace hex::plugin::builtin {
}
private:
std::optional<float> m_value;
std::optional<double> m_value;
};
class NodeDisplayBuffer : public dp::Node {

View File

@@ -1493,7 +1493,7 @@ namespace hex::plugin::builtin {
if (m_lastEvaluationError->has_value())
message = processMessage((*m_lastEvaluationError)->message);
auto key = TextEditor::Coordinates(location.line, location.column);
errorMarkers[key] = std::make_pair(location.length, message);
errorMarkers[key] = std::make_pair(u32(location.length), message);
}
}
} else {