shithub: orca

Download patch

ref: cf733a4c2e4e95184712af85478fe8ef40c27713
parent: 57f070c7a0fa4a538a092189f5c40ce869de093e
author: cancel <cancel@cancel.fm>
date: Tue Jan 14 02:11:16 EST 2020

Cleanup

--- a/term_util.c
+++ b/term_util.c
@@ -219,7 +219,7 @@
   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 @@
   free(buffer);
   if (title)
     qmsg_set_title(msg, title);
+  return msg;
 }
 
 bool qmsg_drive(Qmsg *qm, int key) {
--- a/term_util.h
+++ b/term_util.h
@@ -115,10 +115,10 @@
 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);
 
--- a/tui_main.c
+++ b/tui_main.c
@@ -1998,12 +1998,10 @@
   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)