From: Richard Russon Date: Fri, 27 Sep 2019 15:57:03 +0000 (+0100) Subject: refactor: mutt_window_mvaddstr() X-Git-Tag: 2019-10-25~30^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75ed261007eb294dcd8bafd4260f71e32511284e;p=neomutt refactor: mutt_window_mvaddstr() Encapsulate a curses function to reduce dependencies. --- diff --git a/mutt_curses.h b/mutt_curses.h index 7dcbf1024..a0556703b 100644 --- a/mutt_curses.h +++ b/mutt_curses.h @@ -47,15 +47,6 @@ #define bool _Bool #endif -/* The prototypes for these four functions use "(char*)", - * whereas the ncurses versions use "(const char*)" */ -#undef mvaddnstr -#undef mvaddstr - -/* We redefine the helper macros to hide the compiler warnings */ -#define mvaddnstr(y, x, str, n) mvwaddnstr(stdscr, (y), (x), ((char *) str), (n)) -#define mvaddstr(y, x, str) mvwaddstr(stdscr, (y), (x), ((char *) str)) - #define KEY_DC SL_KEY_DELETE #define KEY_IC SL_KEY_IC diff --git a/mutt_window.c b/mutt_window.c index 51c484172..e0e4c3c20 100644 --- a/mutt_window.c +++ b/mutt_window.c @@ -211,7 +211,11 @@ int mutt_window_move(struct MuttWindow *win, int row, int col) */ int mutt_window_mvaddstr(struct MuttWindow *win, int row, int col, const char *str) { +#ifdef USE_SLANG_CURSES + return mvaddstr(win->row_offset + row, win->col_offset + col, (char *) str); +#else return mvaddstr(win->row_offset + row, win->col_offset + col, str); +#endif } /**