mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
build: Make ImHex fully compile with warnings enabled in MSVC
This commit is contained in:
@@ -91,7 +91,7 @@ namespace hex::plugin::builtin {
|
||||
T value = 0x00;
|
||||
std::memcpy(&value, buffer.data(), std::min(sizeof(T), Size));
|
||||
value = hex::changeEndianness(value, Size, endian);
|
||||
if (Size != sizeof(T))
|
||||
if constexpr (Size != sizeof(T))
|
||||
value = T(hex::signExtend(Size * 8, value));
|
||||
|
||||
return value;
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void drawNode() override {
|
||||
ImGui::PushItemWidth(100_scaled);
|
||||
ImGui::Combo("hex.builtin.nodes.crypto.aes.mode"_lang, &m_mode, "ECB\0CBC\0CFB128\0CTR\0GCM\0CCM\0OFB\0");
|
||||
ImGui::Combo("hex.builtin.nodes.crypto.aes.key_length"_lang, &m_keyLength, "128 Bits\000192 Bits\000256 Bits\000");
|
||||
ImGui::Combo("hex.builtin.nodes.crypto.aes.mode"_lang, &m_mode, "ECB\x00""CBC\x00""CFB128\x00""CTR\x00""GCM\x00""CCM\x00""OFB\x00");
|
||||
ImGui::Combo("hex.builtin.nodes.crypto.aes.key_length"_lang, &m_keyLength, "128 Bits\x00""192 Bits\x00""256 Bits\x00");
|
||||
ImGui::PopItemWidth();
|
||||
}
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ namespace hex::plugin::builtin {
|
||||
private:
|
||||
std::vector<u8> m_data;
|
||||
ImGuiExt::Texture m_texture;
|
||||
u32 m_width, m_height;
|
||||
u32 m_width = 0, m_height = 0;
|
||||
};
|
||||
|
||||
class NodeVisualizerByteDistribution : public dp::Node {
|
||||
|
||||
@@ -375,7 +375,7 @@ namespace hex::plugin::builtin {
|
||||
if (inputType == InputType::Regular) {
|
||||
try {
|
||||
ieee754statics.resultFloat = stod(decimalFloatingPointNumberString);
|
||||
} catch(const std::invalid_argument& _) {
|
||||
} catch (const std::invalid_argument &) {
|
||||
inputType = InputType::Invalid;
|
||||
}
|
||||
} else if (inputType == InputType::Infinity) {
|
||||
|
||||
@@ -106,8 +106,8 @@ namespace hex::plugin::builtin {
|
||||
|
||||
if (ImGui::BeginTable("##mathWrapper", 3)) {
|
||||
ImGui::TableSetupColumn("##keypad", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize);
|
||||
ImGui::TableSetupColumn("##results", ImGuiTableColumnFlags_WidthStretch, 0.666);
|
||||
ImGui::TableSetupColumn("##variables", ImGuiTableColumnFlags_WidthStretch, 0.666);
|
||||
ImGui::TableSetupColumn("##results", ImGuiTableColumnFlags_WidthStretch, 0.666F);
|
||||
ImGui::TableSetupColumn("##variables", ImGuiTableColumnFlags_WidthStretch, 0.666F);
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace hex::plugin::builtin {
|
||||
// Draw background
|
||||
{
|
||||
const ImVec2 margin = scaled({ 15, 15 });
|
||||
drawList->AddRectFilled(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_WindowBg, 200.0/255.0));
|
||||
drawList->AddRectFilled(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_WindowBg, 200.0F / 255.0F));
|
||||
drawList->AddRect(windowPos + margin, (windowPos + windowSize) - margin, ImGuiExt::GetCustomColorU32(ImGuiCustomCol_Highlight), 10_scaled, ImDrawFlags_None, 7.5_scaled);
|
||||
}
|
||||
|
||||
|
||||
@@ -490,9 +490,9 @@ namespace hex::plugin::builtin {
|
||||
if (ImGui::Begin("ImHexDockSpace", nullptr, ImGuiWindowFlags_NoBringToFrontOnFocus)) {
|
||||
if (!ImHexApi::Provider::isValid()) {
|
||||
static auto title = []{
|
||||
std::array<char, 256> title = {};
|
||||
ImFormatString(title.data(), title.size(), "%s/DockSpace_%08X", ImGui::GetCurrentWindowRead()->Name, ImGui::GetID("ImHexMainDock"));
|
||||
return title;
|
||||
std::array<char, 256> result = {};
|
||||
ImFormatString(result.data(), result.size(), "%s/DockSpace_%08X", ImGui::GetCurrentWindowRead()->Name, ImGui::GetID("ImHexMainDock"));
|
||||
return result;
|
||||
}();
|
||||
|
||||
if (ImGui::Begin(title.data(), nullptr, ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoBringToFrontOnFocus)) {
|
||||
|
||||
Reference in New Issue
Block a user