Change edit_char() from unsigned char to char

This squashes a few more warnings.
This commit is contained in:
Kevin Easton
2015-06-20 00:03:15 +10:00
parent 53f7c374cf
commit 8649c17912
3 changed files with 6 additions and 7 deletions

View File

@@ -15,7 +15,6 @@ extern char *recv_nick;
void eval_inputlist (char *, char *); void eval_inputlist (char *, char *);
int BX_parse_command (char *, int, char *); int BX_parse_command (char *, int, char *);
void BX_parse_line (const char *, char *, const char *, int, int, int); void BX_parse_line (const char *, char *, const char *, int, int, int);
void edit_char (unsigned char);
void execute_timer (void); void execute_timer (void);
void ison_now (char *, char *); void ison_now (char *, char *);
void quote_char (char, char *); void quote_char (char, char *);

View File

@@ -22,6 +22,7 @@
void input_move_cursor (int); void input_move_cursor (int);
void change_input_prompt (int); void change_input_prompt (int);
void BX_cursor_to_input (void); void BX_cursor_to_input (void);
void edit_char(char);
/* keybinding functions */ /* keybinding functions */
void backward_character (char, char *); void backward_character (char, char *);

View File

@@ -1332,7 +1332,7 @@ BUILT_IN_KEYBINDING(parse_text)
* edit_char: handles each character for an input stream. Not too difficult * edit_char: handles each character for an input stream. Not too difficult
* to work out. * to work out.
*/ */
void edit_char (u_char key) void edit_char(char key)
{ {
void (*func) (char, char *) = NULL; void (*func) (char, char *) = NULL;
char *ptr = NULL; char *ptr = NULL;
@@ -1353,8 +1353,7 @@ void edit_char (u_char key)
/* were we waiting for a keypress? */ /* were we waiting for a keypress? */
if (last_input_screen->promptlist && last_input_screen->promptlist->type == WAIT_PROMPT_KEY) if (last_input_screen->promptlist && last_input_screen->promptlist->type == WAIT_PROMPT_KEY)
{ {
unsigned char key_[2] = "\0"; char key_[2] = { key, 0 };
key_[0] = key;
oldprompt = last_input_screen->promptlist; oldprompt = last_input_screen->promptlist;
last_input_screen->promptlist = oldprompt->next; last_input_screen->promptlist = oldprompt->next;
(*oldprompt->func)(oldprompt->data, key_); (*oldprompt->func)(oldprompt->data, key_);
@@ -1394,7 +1393,7 @@ void edit_char (u_char key)
#ifdef TRANSLATE #ifdef TRANSLATE
if (translation) if (translation)
extended_key = transFromClient[key]; extended_key = transFromClient[(unsigned char)key];
else else
#endif #endif
extended_key = key; extended_key = key;
@@ -2862,10 +2861,10 @@ BUILT_IN_COMMAND(type)
} }
default: default:
{ {
c = *(args++); c = (unsigned char)*(args++);
if (islower(c)) if (islower(c))
c = toupper(c); c = toupper(c);
if (c < 64) if (c < 64 || c > 95)
{ {
say("Invalid key sequence: ^%c", c); say("Invalid key sequence: ^%c", c);
return; return;