About mutt_window_getyx in curs_lib.c:

void mutt_window_getyx (mutt_window_t *win, int *y, int *x)
{
  int row, col;

  getyx (stdscr, row, col);
  *y = row - win->row_offset;
  *x = col - win->col_offset;
}

Wouldn't it be cleaner to accept null pointers and do the assignment
only when the pointer is not null?

So, here:

    mutt_window_getyx (MuttMessageWindow, &ret, &x);  /* don't care about y: 
avoiding unused var warning */

this could be changed to:

    mutt_window_getyx (MuttMessageWindow, NULL, &x);

Alternatively, this function could be removed as it is used only once,
and only to get x:

$ grep -r mutt_window_getyx .
./curs_lib.c:    mutt_window_getyx (MuttMessageWindow, &ret, &x);  /* don't 
care about y: avoiding unused var warning */
./curs_lib.c:void mutt_window_getyx (mutt_window_t *win, int *y, int *x)
./mutt_curses.h:void mutt_window_getyx (mutt_window_t *, int *y, int *x);

One way to explicitly silent the "unused var" warning is to do:

  (void) y;  /* don't care about y: avoiding unused var warning */

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to