summaryrefslogtreecommitdiff
path: root/minicurses.h
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2022-02-19 13:57:48 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2022-02-19 14:04:11 +0100
commit2d7e4573fc6b9ce6b34f97e673a469d07763ce90 (patch)
tree2fbcf571ec8acf05f1e578fc1069e1e6151cc097 /minicurses.h
parent2542a7773711da8d6cea85a007bcc5a2e2b2ffb0 (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 'minicurses.h')
-rw-r--r--minicurses.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/minicurses.h b/minicurses.h
index 3e01e80..ad24b5e 100644
--- a/minicurses.h
+++ b/minicurses.h
@@ -3,20 +3,20 @@
#undef OK
#define OK (0)
-char *clr_eol = "\x1b[K";
-char *clear_screen = "\x1b[H\x1b[2J";
-char *cursor_address = "\x1b[%ld;%ldH";
-char *cursor_normal = "\x1b[?25h"; /* DECTCEM (in)Visible cursor */
-char *cursor_invisible = "\x1b[?25l"; /* DECTCEM (in)Visible cursor */
-char *eat_newline_glitch = (void *)1;
-char *enter_ca_mode = "\x1b[?1049h"; /* smcup */
-char *exit_ca_mode = "\x1b[?1049l"; /* rmcup */
-char *save_cursor = "\x1b""7";
-char *restore_cursor = "\x1b""8";
-char *exit_attribute_mode = "\x1b[0m";
-char *enter_bold_mode = "\x1b[1m";
-char *enter_dim_mode = "\x1b[2m";
-char *enter_reverse_mode = "\x1b[7m";
+const char *clr_eol = "\x1b[K";
+const char *clear_screen = "\x1b[H\x1b[2J";
+const char *cursor_address = "\x1b[%ld;%ldH";
+const char *cursor_normal = "\x1b[?25h"; /* DECTCEM (in)Visible cursor */
+const char *cursor_invisible = "\x1b[?25l"; /* DECTCEM (in)Visible cursor */
+const char *eat_newline_glitch = (void *)1;
+const char *enter_ca_mode = "\x1b[?1049h"; /* smcup */
+const char *exit_ca_mode = "\x1b[?1049l"; /* rmcup */
+const char *save_cursor = "\x1b""7";
+const char *restore_cursor = "\x1b""8";
+const char *exit_attribute_mode = "\x1b[0m";
+const char *enter_bold_mode = "\x1b[1m";
+const char *enter_dim_mode = "\x1b[2m";
+const char *enter_reverse_mode = "\x1b[7m";
int
setupterm(char *term, int fildes, int *errret)
@@ -34,5 +34,5 @@ tparm(char *s, long p1, long p2, ...)
return buf;
}
- return (char *)s;
+ return s;
}