From 63ba37205516e54b2c237819029d5046e69f58ce Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Tue, 15 Nov 2022 22:09:48 -0500 Subject: [PATCH] Fix curses build on HP-UX. On HP-UX, it seems that "lines" and "label_width" are defined as object-like macros in which causes dumb build failures since this code is using those identifiers as variables. Not too much hassle to just use a different name instead. --- src/curses.c | 4 ++-- src/cursmenu.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/curses.c b/src/curses.c index 8405e23..5cf8882 100644 --- a/src/curses.c +++ b/src/curses.c @@ -202,10 +202,10 @@ static void curs_redraw_goal(struct app_state *state, uint_fast32_t mask) } /* Thin wrapper around wresize which returns ERR if support is unavailable. */ -static int do_wresize(WINDOW *window, int lines, int columns) +static int do_wresize(WINDOW *window, int h, int w) { #if HAVE_CURSES_WRESIZE - return wresize(window, lines, columns); + return wresize(window, h, w); #endif return ERR; } diff --git a/src/cursmenu.c b/src/cursmenu.c index e665a32..127b4d7 100644 --- a/src/cursmenu.c +++ b/src/cursmenu.c @@ -67,12 +67,12 @@ void curs_execute_function(struct app_state *state, int func) /* * Return the width of the toolbar and the target width of toolbar labels. */ -static int toolbar_width(WINDOW *toolbar, int *label_width) +static int toolbar_width(WINDOW *toolbar, int *item_width) { int w, h; getmaxyx(toolbar, h, w); - *label_width = MAX(6, w/10); + *item_width = MAX(6, w/10); return (void)h, w; } @@ -88,10 +88,10 @@ static int toolbar_width(WINDOW *toolbar, int *label_width) * The minimum size of a label is 6 characters (2 of which are used for the * number indicator) */ -static int toolbar_xpos(int i, int total_width, int label_width) +static int toolbar_xpos(int i, int total_width, int item_width) { - int rem = total_width - 10*label_width; - int pos = (i-1)*label_width; + int rem = total_width - 10*item_width; + int pos = (i-1)*item_width; switch (rem) { case 9: pos += i > 6; -- 2.43.2