From ada12fe3ddc5ee8b82dfe7031c59f00811aabad6 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Wed, 5 Apr 2017 17:25:38 +0100 Subject: [PATCH] build: workaround slang warnings The prototypes for these four functions use (char*), whereas the ncurses versions use (const char*) addnstr addstr mvaddnstr mvaddstr We redefine the helper macros to hide the compiler warnings. --- mutt_curses.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mutt_curses.h b/mutt_curses.h index ec56a9546..085b34433 100644 --- a/mutt_curses.h +++ b/mutt_curses.h @@ -33,6 +33,19 @@ #include +/* The prototypes for these four functions use "(char*)", + * whereas the ncurses versions use "(const char*)" */ +#undef addnstr +#undef addstr +#undef mvaddnstr +#undef mvaddstr + +/* We redefine the helper macros to hide the compiler warnings */ +#define addnstr(s,n) waddnstr(stdscr,((char*)s),(n)) +#define addstr(x) waddstr(stdscr, ((char*)x)) +#define mvaddnstr(y,x,s,n) mvwaddnstr(stdscr,(y),(x),((char*)s),(n)) +#define mvaddstr(y,x,s) mvwaddstr(stdscr,(y),(x),((char*)s)) + #define KEY_DC SL_KEY_DELETE #define KEY_IC SL_KEY_IC -- 2.40.0