[PATCH 1/4] Use NCURSES_CONST in func_key declaration
Pavel Roskin
proski at gnu.org
Sun Feb 7 01:54:07 UTC 2010
This fixes a warning
wkeys.c: In function '_initkeys':
wkeys.c:128: warning: passing argument 1 of 'tgetstr' discards qualifiers
from pointer target type
/usr/include/termcap.h:63: note: expected 'char *' but argument is of type
'const char *'
NCURSES_CONST is normally empty for compatibility with other curses
implementations, but ncurses can be compiled with NCURSES_CONST set to
"const" for extra strictness. By using NCURSES_CONST, the code would
cause no warnings either way.
---
src/wkeys.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/wkeys.c b/src/wkeys.c
index 06571c6..57389a6 100644
--- a/src/wkeys.c
+++ b/src/wkeys.c
@@ -44,7 +44,11 @@ static int gotalrm;
int pendingkeys = 0;
int io_pending = 0;
-static const char *func_key[] = {
+#ifndef NCURSES_CONST
+#define NCURSES_CONST
+#endif
+
+static NCURSES_CONST char *func_key[] = {
"", "k1", "k2", "k3", "k4", "k5", "k6", "k7", "k8", "k9", "k0",
"kh", "kP", "ku", "kl", "kr", "kd", "kH", "kN", "kI", "kD",
"F1", "F2", NULL };
More information about the minicom-devel
mailing list