From 28e5f62c60def34d4273eb5dd3407b063a2ee88f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 8 Feb 2022 22:25:25 +0100 Subject: [PATCH] fix: ImU64 is somehow not the same as u64 on Linux --- lib/libimhex/include/hex/ui/imgui_imhex_extensions.h | 6 ++++-- lib/libimhex/source/ui/imgui_imhex_extensions.cpp | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h b/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h index 530291419..9a9e8ccb5 100644 --- a/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h +++ b/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #define IMGUI_DEFINE_MATH_OPERATORS @@ -72,8 +74,8 @@ namespace ImGui { bool ToolBarButton(const char *symbol, ImVec4 color); bool IconButton(const char *symbol, ImVec4 color, ImVec2 size_arg = ImVec2(0, 0)); - bool InputIntegerPrefix(const char* label, const char *prefix, ImU64 *value, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None); - bool InputHexadecimal(const char* label, ImU64 *value, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None); + bool InputIntegerPrefix(const char* label, const char *prefix, u64 *value, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None); + bool InputHexadecimal(const char* label, u64 *value, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None); inline bool HasSecondPassed() { return static_cast(ImGui::GetTime() * 100) % 100 <= static_cast(ImGui::GetIO().DeltaTime * 100); diff --git a/lib/libimhex/source/ui/imgui_imhex_extensions.cpp b/lib/libimhex/source/ui/imgui_imhex_extensions.cpp index c2cc39213..b7e662362 100644 --- a/lib/libimhex/source/ui/imgui_imhex_extensions.cpp +++ b/lib/libimhex/source/ui/imgui_imhex_extensions.cpp @@ -495,7 +495,7 @@ namespace ImGui { return pressed; } - bool InputIntegerPrefix(const char *label, const char *prefix, ImU64 *value, ImGuiInputTextFlags flags) { + bool InputIntegerPrefix(const char *label, const char *prefix, u64 *value, ImGuiInputTextFlags flags) { auto window = ImGui::GetCurrentWindow(); const ImGuiID id = window->GetID(label); const ImGuiStyle &style = GImGui->Style; @@ -527,7 +527,7 @@ namespace ImGui { return value_changed; } - bool InputHexadecimal(const char *label, ImU64 *value, ImGuiInputTextFlags flags) { + bool InputHexadecimal(const char *label, u64 *value, ImGuiInputTextFlags flags) { return InputIntegerPrefix(label, "0x", value, flags | ImGuiInputTextFlags_CharsHexadecimal); }