mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Various MSVC warnings
This commit is contained in:
2
lib/external/libwolv
vendored
2
lib/external/libwolv
vendored
Submodule lib/external/libwolv updated: ba8fb9c842...5b9d75e39a
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: 506b867e51...3095ad4f61
@@ -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());
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
private:
|
||||
std::optional<float> m_value;
|
||||
std::optional<double> m_value;
|
||||
};
|
||||
|
||||
class NodeDisplayBuffer : public dp::Node {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace hex::plugin::disasm {
|
||||
|
||||
m_instruction = nullptr;
|
||||
auto mode = m_mode;
|
||||
if (m_endian == true) {
|
||||
if (bool(m_endian)) {
|
||||
mode = cs_mode(u32(mode) | CS_MODE_LITTLE_ENDIAN);
|
||||
} else {
|
||||
mode = cs_mode(u32(mode) | CS_MODE_BIG_ENDIAN);
|
||||
|
||||
@@ -6,10 +6,16 @@
|
||||
#include <wolv/io/file.hpp>
|
||||
|
||||
// <yara/types.h>'s RE type has a zero-sized array, which is not allowed in ISO C++.
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#include <yara.h>
|
||||
#pragma GCC diagnostic pop
|
||||
#if !defined(_MSC_VER)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
#include <yara.h>
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
namespace hex::plugin::yara {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user