Skip to content

Commit

Permalink
dialog: remove parent assert from add_button/add_buttons/populate_tit…
Browse files Browse the repository at this point in the history
…le_bar

In all cases, the assert will be checked by the first use of the parent
when passed into gui_set_parent(), and the variable is otherwise unused
by the function.

This allows stubbing gui code without having to touch the dialog code.
  • Loading branch information
jgriffiths committed Jan 6, 2025
1 parent c178c47 commit d971575
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions main/ui/dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ gui_view_node_t* make_even_split(const ui_button_layout_t layout, const uint8_t
// Helper to make a standard button, for consistent look and feel behaviour
void add_button(gui_view_node_t* parent, btn_data_t* btn_info)
{
JADE_ASSERT(parent);
JADE_ASSERT(btn_info);

// Cannot specify both 'text label' and 'explicit content'
Expand Down Expand Up @@ -98,7 +97,6 @@ void add_button(gui_view_node_t* parent, btn_data_t* btn_info)
// Helper to create buttons in a row or column
void add_buttons(gui_view_node_t* parent, const ui_button_layout_t layout, btn_data_t* btns, const size_t num_btns)
{
JADE_ASSERT(parent);
JADE_ASSERT(layout == UI_ROW || layout == UI_COLUMN);
JADE_ASSERT(btns);
JADE_ASSERT(num_btns);
Expand Down Expand Up @@ -132,7 +130,6 @@ static inline btn_data_t* add_default_border(btn_data_t* btn, const uint32_t def
void populate_title_bar(
gui_view_node_t* bar, const char* title, btn_data_t* btns, const size_t num_btns, gui_view_node_t** title_node)
{
JADE_ASSERT(bar);
JADE_ASSERT(title || btns);
JADE_ASSERT((btns && num_btns == 2) || !num_btns);
JADE_ASSERT(!title_node || title);
Expand Down

0 comments on commit d971575

Please sign in to comment.