From c78f59e78c9993854e78da7180d0dd5b4109badd Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Fri, 27 Jul 2007 18:57:22 +0300 Subject: [PATCH] Doxygen: rename struct key to reduce spurious links Rename struct key to struct named_key, use more const, change the num member from int to term_event_key_T, and put a KBD_UNDEF at the end of the array (even though it won't be read). --- src/config/kbdbind.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/config/kbdbind.c b/src/config/kbdbind.c index 77ddd32ab..db597af6a 100644 --- a/src/config/kbdbind.c +++ b/src/config/kbdbind.c @@ -318,12 +318,12 @@ get_keymap_name(enum keymap_id keymap_id) } -struct key { - unsigned char *str; - int num; +struct named_key { + const unsigned char *str; + term_event_key_T num; }; -static struct key key_table[] = { +static const struct named_key key_table[] = { { "Enter", KBD_ENTER }, { "Space", ' ' }, { "Backspace", KBD_BS }, @@ -351,13 +351,13 @@ static struct key key_table[] = { { "F10", KBD_F10 }, { "F11", KBD_F11 }, { "F12", KBD_F12 }, - { NULL, 0 } + { NULL, KBD_UNDEF } }; term_event_key_T read_key(const unsigned char *key_str) { - struct key *key; + const struct named_key *key; if (key_str[0] && !key_str[1]) return key_str[0]; @@ -438,8 +438,8 @@ add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd, int escape) { unsigned char key_buffer[3] = "\\x"; - unsigned char *key_string = NULL; - struct key *key; + const unsigned char *key_string = NULL; + const struct named_key *key; if (kbd->key == KBD_UNDEF) return; @@ -459,7 +459,7 @@ add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd, if (!key_string) { key_string = key_buffer + 1; - *key_string = (unsigned char) kbd->key; + key_buffer[1] = (unsigned char) kbd->key; if (escape && strchr("'\"\\", kbd->key)) key_string--; }