diff --git a/CMakeLists.txt b/CMakeLists.txt index 166c5f7..b4a5b90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ set(IMGUI_DIR "${VENDOR_DIR}/imgui") set(DCIMGUI_DIR "${LIB_DIR}/dcimgui") set(DEARBINDINGS_DIR "${VENDOR_DIR}/dear_bindings") -# Export Clang DB +# Export compilation DB set(CMAKE_EXPORT_COMPILE_COMMANDS ON) file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}" "${BUILD_DIR}/current" SYMBOLIC) diff --git a/CMakePresets.json b/CMakePresets.json index 2125575..4a0e2e4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,8 +13,8 @@ "generator": "Unix Makefiles", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_C_COMPILER": "clang", - "CMAKE_CXX_COMPILER": "clang++" + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++" } }, { @@ -24,8 +24,8 @@ "generator": "Unix Makefiles", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "CMAKE_C_COMPILER": "clang", - "CMAKE_CXX_COMPILER": "clang++" + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++" } } ], diff --git a/README.md b/README.md index 7e6d5b9..5049035 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If your distro does not support `/usr/local/bin/` in PATH, try `/usr/bin/` inste ### Build Requirements -- Clang +- GCC - CMake 3.20+ - GNU Make - Python 3.10+ (for dear_bindings and GLAD generation) @@ -78,7 +78,7 @@ cmake --build -j $(nproc) --preset debug -t gdb ### IDE Support -Configuration files are provided for VS Code +Configuration files are provided for VS Code and they rely on `clangd` You will need to run a full build process atleast once before `clangd` picks up the compile DB diff --git a/lib/dcimgui/CMakeLists.txt b/lib/dcimgui/CMakeLists.txt index f36845d..978e854 100644 --- a/lib/dcimgui/CMakeLists.txt +++ b/lib/dcimgui/CMakeLists.txt @@ -52,8 +52,5 @@ add_library(dcimgui STATIC "${sources}") target_include_directories(dcimgui PUBLIC "${DCIMGUI_DIR}" "${DCIMGUI_DIR}/backends") target_include_directories(dcimgui PUBLIC "${IMGUI_DIR}" "${IMGUI_DIR}/backends") -# Disable unavoidable warnings -target_compile_options(dcimgui PRIVATE -Wno-macro-redefined) - # Custom imconfig.h target_compile_definitions(dcimgui PUBLIC IMGUI_USER_CONFIG="dcimconfig.h") diff --git a/lib/dcimgui/dcimconfig.h b/lib/dcimgui/dcimconfig.h index 6934e27..933afbc 100644 --- a/lib/dcimgui/dcimconfig.h +++ b/lib/dcimgui/dcimconfig.h @@ -1,5 +1,3 @@ -#pragma once - #include // 32-bit characters for drawing @@ -7,3 +5,8 @@ // Don't provide barebones OpenGL definitions from ImGui #define IMGUI_IMPL_OPENGL_LOADER_CUSTOM 1 + +// Remove imgui.h defines before dcimgui.h re-defines them +#undef IMGUI_CHECKVERSION +#undef IM_ALLOC +#undef IM_FREE diff --git a/src/gui/window.c b/src/gui/window.c index 7ad84c5..5e20eac 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -217,7 +217,7 @@ static void gui_window_draw_addresses_pane(Gui* gui, ImVec2 size) { ImGui_TableNextColumn(); ImVec2 text_pos = ImGui_GetCursorScreenPos(); ImVec2 rect_pos = text_pos; - ImGui_Text(""); + ImGui_TextUnformatted(""); const char* text = "Too many results, no live updates!"; ImVec2 text_size = ImGui_CalcTextSize(text); ImDrawList* foreground = ImGui_GetWindowDrawList(); diff --git a/src/memory/search.c b/src/memory/search.c index 138a3fa..2784a59 100644 --- a/src/memory/search.c +++ b/src/memory/search.c @@ -103,7 +103,7 @@ void memory_search_set_params(MemorySearch* memory_search, MemorySearchParams pa params.region_flags = memory_search->params.region_flags; } - params.type = CLAMP(params.type, MemoryTypeMAX - 1, 0); + params.type = CLAMP(params.type, MemoryTypeMAX - 1u, 0u); params.alignment = MAX(params.alignment, 1); params.deviation = ABS(params.deviation); if(params.type <= MemoryTypeInteger) { @@ -310,7 +310,7 @@ static void* memory_search_begin_callback(Thread* self, void* context) { MemoryAddress chunk_addr = 0; MemoryAddress chunk_end = 0; MemoryAddress chunk_end_max_type_margin = 0; - void* chunk_cur; + void* chunk_cur = chunk_buf; while(addr < region->end) { if(addr > chunk_end_max_type_margin) { thread_self_quit_if_canceled(self); @@ -956,6 +956,8 @@ MemorySearchResultBase* memory_search_get_result_base(MemorySearchResultSet* set return &set->results_128[i].base; } } + + return NULL; } static MemorySearchValueDisplay