]> git.draconx.ca Git - rrace.git/commitdiff
Fix curses build on HP-UX.
authorNick Bowler <nbowler@draconx.ca>
Wed, 16 Nov 2022 03:09:48 +0000 (22:09 -0500)
committerNick Bowler <nbowler@draconx.ca>
Wed, 16 Nov 2022 03:09:48 +0000 (22:09 -0500)
On HP-UX, it seems that "lines" and "label_width" are defined as
object-like macros in <term.h> 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
src/cursmenu.c

index 8405e234fbedcb2eadd5b6e8acae8f13ddfd2d30..5cf88829c07f2225cc8df51c37a3f57df9cec8f0 100644 (file)
@@ -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;
 }
index e665a3289db9ecd4f76fa6235f1b8846fbf91410..127b4d7fa25b987c5f8ba2e34b49fb57bcec102f 100644 (file)
@@ -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;