[theme] remove a needless out-param

This commit is contained in:
Milo Turner 2020-02-22 14:49:20 -05:00
parent 153c084419
commit d78b6cc828
3 changed files with 4 additions and 9 deletions

View File

@ -26,7 +26,7 @@ void ax_log(struct ax_ctxt* ax, const char* string);
* -------------------------------------------------------------------------- */
void ax_begin_theme(struct ax_ctxt* ax);
void ax_end_theme(struct ax_ctxt* ax, struct ax_theme** out_thm);
struct ax_theme* ax_end_theme(struct ax_ctxt* ax);
void ax_set_theme_color(
struct ax_ctxt* ax, const char* cat, int64_t rgb);

View File

@ -107,7 +107,7 @@ void ax_begin_theme(struct ax_ctxt* ax)
ax->thmb = ax__theme_builder_new(ax->thmb_rgn);
}
void ax_end_theme(struct ax_ctxt* ax, struct ax_theme** out_thm)
struct ax_theme* ax_end_theme(struct ax_ctxt* ax)
{
ASSERT(ax->thmb != NULL, "`ax_end_theme' called while not building a theme");
@ -116,10 +116,7 @@ void ax_end_theme(struct ax_ctxt* ax, struct ax_theme** out_thm)
rgn_clear(ax->thmb_rgn);
ax__theme_load(thm, ax__backend_msgq(ax->bac));
if (out_thm != NULL) {
*out_thm = thm;
}
return thm;
}
void ax_set_theme_color(

View File

@ -27,9 +27,7 @@ static struct ax_theme* make_example_theme()
ax_set_theme_color(ax, "primary", 0x00ff00);
ax_set_theme_font(ax, "default", "/usr/share/fonts/TTF/DejaVuSans.ttf", 0);
ax_set_theme_font(ax, "h1", NULL, 95);
struct ax_theme* thm;
ax_end_theme(ax, &thm);
return thm;
return ax_end_theme(ax);
}
int main(void)