From 75ed261007eb294dcd8bafd4260f71e32511284e Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 27 Sep 2019 16:57:03 +0100 Subject: [PATCH] refactor: mutt_window_mvaddstr() Encapsulate a curses function to reduce dependencies. --- mutt_curses.h | 9 --------- mutt_window.c | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-) 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 } /** -- 2.40.0