diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-02-19 13:57:48 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-02-19 14:04:11 +0100 |
commit | 2d7e4573fc6b9ce6b34f97e673a469d07763ce90 (patch) | |
tree | 2fbcf571ec8acf05f1e578fc1069e1e6151cc097 /sfeed_curses.c | |
parent | 2542a7773711da8d6cea85a007bcc5a2e2b2ffb0 (diff) |
fix a compiler warning with (Net)BSD curses
Some curses implementations have tparm(char *) (BSD and older ncurses), some
have tparm(const char *).
The older POSIX specification had: tparm(char *):
https://pubs.opengroup.org/onlinepubs/7908799/xcurses/term.h.html
Just cast it to char *. The terminfo variables are defined elsewhere so it
should be safe.
Also remove an unnecesary cast in minicurses.
Hopefully this satisfies all curses variants and versions now.
Diffstat (limited to 'sfeed_curses.c')
-rw-r--r-- | sfeed_curses.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sfeed_curses.c b/sfeed_curses.c index 4087369..d12f170 100644 --- a/sfeed_curses.c +++ b/sfeed_curses.c @@ -265,14 +265,15 @@ estrdup(const char *s) return p; } -/* Wrapper for tparm which allows NULL parameter for str. */ +/* Wrapper for tparm() which allows NULL parameter for str. */ char * -tparmnull(char *str, long p1, long p2, long p3, long p4, long p5, long p6, +tparmnull(const char *str, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8, long p9) { if (!str) return NULL; - return tparm(str, p1, p2, p3, p4, p5, p6, p7, p8, p9); + /* some tparm() implementations have char *, some have const char * */ + return tparm((char *)str, p1, p2, p3, p4, p5, p6, p7, p8, p9); } /* Counts column width of character string. */ |