gui: add asserts to guarantee behaviour

Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
Ronald Caesar 2025-08-10 01:57:07 -04:00
parent b38dce4ef1
commit 36bce8fa0a
No known key found for this signature in database
GPG key ID: 04307C401999C596

View file

@ -1,11 +1,16 @@
#include "panels.h" #include "panels.h"
#include <math.h> #include <math.h>
#include "ARM/cpu.h" #include "Base/Assert.h"
#include "aarch64/isa.h"
#include "imgui.h" #include "imgui.h"
int8_t gui::panel::render_performance_panel(gui::panel::performance_panel_t* panel, performance_data_t* data, int8_t gui::panel::render_performance_panel(gui::panel::performance_panel_t* panel, performance_data_t* data,
std::chrono::steady_clock::time_point* last_render) std::chrono::steady_clock::time_point* last_render)
{ {
ASSERT(nullptr != panel);
ASSERT(nullptr != data);
ASSERT(nullptr != last_render);
bool is_visible = true; bool is_visible = true;
(void)::ImGui::Begin(PANEL_NAME_PERFORMANCE, &is_visible); (void)::ImGui::Begin(PANEL_NAME_PERFORMANCE, &is_visible);
if (false == is_visible) if (false == is_visible)
@ -77,6 +82,8 @@ int8_t gui::panel::render_performance_panel(gui::panel::performance_panel_t* pan
int8_t gui::panel::render_cpu_panel(bool* show_cpu_result_popup) int8_t gui::panel::render_cpu_panel(bool* show_cpu_result_popup)
{ {
ASSERT(nullptr != show_cpu_result_popup);
bool is_visible = true; bool is_visible = true;
(void)::ImGui::Begin(PANEL_NAME_CPU, &is_visible, ImGuiWindowFlags_NoCollapse); (void)::ImGui::Begin(PANEL_NAME_CPU, &is_visible, ImGuiWindowFlags_NoCollapse);
if (false == is_visible) if (false == is_visible)