]> granicus.if.org Git - neomutt/commitdiff
build: workaround slang warnings
authorRichard Russon <rich@flatcap.org>
Wed, 5 Apr 2017 16:25:38 +0000 (17:25 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 8 Apr 2017 21:24:37 +0000 (22:24 +0100)
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

index ec56a9546212aab5ae6c8ef25e0544f3ca8b01aa..085b34433506e84290903b7bbd5de2ce17243bf1 100644 (file)
 
 #include <slcurses.h>
 
+/* 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