summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-12-18 11:26:12 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-12-18 16:44:54 +0100
commit73108301d4c4028b92f6a1ae0e4337dd71a1dc8e (patch)
treedd1d7929fc4460985abf8ed87cc9193c27bf8bd3
parent8fc2d570246fa6f42e03551faab176b706991a0c (diff)
downloadbarebox-73108301d4c4028b92f6a1ae0e4337dd71a1dc8e.tar.gz
barebox-73108301d4c4028b92f6a1ae0e4337dd71a1dc8e.tar.xz
Remove unnecessary casts in key defines
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/edit.c2
-rw-r--r--include/readkey.h12
-rw-r--r--lib/readkey.c2
-rw-r--r--lib/readline.c6
4 files changed, 11 insertions, 11 deletions
diff --git a/commands/edit.c b/commands/edit.c
index 6503edfc88..d292a5231b 100644
--- a/commands/edit.c
+++ b/commands/edit.c
@@ -394,7 +394,7 @@ static int do_edit(cmd_tbl_t * cmdtp, int argc, char *argv[])
int lastscrcol;
int i;
int linepos;
- char c;
+ int c;
if (argc != 2)
return COMMAND_ERROR_USAGE;
diff --git a/include/readkey.h b/include/readkey.h
index d27f0b4e97..d073e43082 100644
--- a/include/readkey.h
+++ b/include/readkey.h
@@ -14,15 +14,15 @@
#define KEY_ERASE_LINE CTL_CH('x')
#define KEY_INSERT CTL_CH('o')
#define KEY_CLEAR_SCREEN CTL_CH('l')
-#define KEY_DEL7 (char)127
-#define KEY_END (char)133 // Cursor Key End
-#define KEY_PAGEUP (char)135 // Cursor Key Page Up
-#define KEY_PAGEDOWN (char)136 // Cursor Key Page Down
-#define KEY_DEL (char)137 // Cursor Key Del
+#define KEY_DEL7 127
+#define KEY_END 133 // Cursor Key End
+#define KEY_PAGEUP 135 // Cursor Key Page Up
+#define KEY_PAGEDOWN 136 // Cursor Key Page Down
+#define KEY_DEL 137 // Cursor Key Del
#define ANSI_CLEAR_SCREEN "\e[2J\e[;H"
-char read_key(void);
+int read_key(void);
#endif /* READKEY_H */
diff --git a/lib/readkey.c b/lib/readkey.c
index 0464ce4b74..a42d1cb8ff 100644
--- a/lib/readkey.c
+++ b/lib/readkey.c
@@ -52,7 +52,7 @@ static const struct esc_cmds esccmds[] = {
{"[6~", KEY_PAGEDOWN},// Cursor Key Page Down
};
-char read_key(void)
+int read_key(void)
{
char c;
char esc[5];
diff --git a/lib/readline.c b/lib/readline.c
index 750da3b59c..b82150e355 100644
--- a/lib/readline.c
+++ b/lib/readline.c
@@ -17,8 +17,8 @@
#define MAX_CMDBUF_SIZE 256
#define CTL_BACKSPACE ('\b')
-#define DEL ((char)255)
-#define DEL7 ((char)127)
+#define DEL 255
+#define DEL7 127
#define CREAD_HIST_CHAR ('!')
#define getcmd_putch(ch) putchar(ch)
@@ -178,7 +178,7 @@ int readline(const char *prompt, char *buf, int len)
unsigned long eol_num = 0;
unsigned long rlen;
unsigned long wlen;
- unsigned char ichar;
+ int ichar;
int insert = 1;
int rc = 0;
#ifdef CONFIG_AUTO_COMPLETE