From cf733a4c2e4e95184712af85478fe8ef40c27713 Mon Sep 17 00:00:00 2001 From: cancel Date: Tue, 14 Jan 2020 07:11:16 +0900 Subject: [PATCH] Cleanup --- term_util.c | 3 ++- term_util.h | 4 ++-- tui_main.c | 6 ++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/term_util.c b/term_util.c index fc6ea0f..3e74800 100644 --- a/term_util.c +++ b/term_util.c @@ -219,7 +219,7 @@ Qmsg *qmsg_push(int height, int width) { return qm; } -void qmsg_printf_push(char const *title, char const *fmt, ...) { +Qmsg *qmsg_printf_push(char const *title, char const *fmt, ...) { int titlewidth = title ? (int)strlen(title) : 0; va_list ap; va_start(ap, fmt); @@ -267,6 +267,7 @@ void qmsg_printf_push(char const *title, char const *fmt, ...) { free(buffer); if (title) qmsg_set_title(msg, title); + return msg; } bool qmsg_drive(Qmsg *qm, int key) { diff --git a/term_util.h b/term_util.h index 2cd2f40..6ea7c8a 100644 --- a/term_util.h +++ b/term_util.h @@ -115,10 +115,10 @@ void qblock_print_frame(Qblock *qb, bool active); void qblock_set_title(Qblock *qb, char const *title); Qmsg *qmsg_push(int height, int width); +Qmsg *qmsg_printf_push(char const *title, char const *fmt, ...) + ORCA_TERM_UTIL_PRINTF(2, 3); WINDOW *qmsg_window(Qmsg *qm); void qmsg_set_title(Qmsg *qm, char const *title); -void qmsg_printf_push(char const *title, char const *fmt, ...) - ORCA_TERM_UTIL_PRINTF(2, 3); bool qmsg_drive(Qmsg *qm, int key); Qmsg *qmsg_of(Qblock *qb); diff --git a/tui_main.c b/tui_main.c index 274dcfd..78192b6 100644 --- a/tui_main.c +++ b/tui_main.c @@ -1998,12 +1998,10 @@ void push_about_msg(void) { static char const* footer = "Live Programming Environment"; // clang-format on + int rows = (int)ORCA_ARRAY_COUNTOF(logo); int cols = (int)strlen(logo[0]); - int hpad = 5; - int tpad = 2; - int bpad = 2; + int hpad = 5, tpad = 2, bpad = 2; int sep = 1; - int rows = (int)ORCA_ARRAY_COUNTOF(logo); int footer_len = (int)strlen(footer); int width = footer_len; if (cols > width)