From: Christian Heller Date: Tue, 21 Jan 2014 23:21:59 +0000 (+0100) Subject: Corrected erroneous interpretation of keycodes as command ids in variable names ... X-Git-Tag: tce~886 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/test.html?a=commitdiff_plain;h=92bfb08a4aacd653e94746ccc8c68c45b8e372cb;p=plomrogue Corrected erroneous interpretation of keycodes as command ids in variable names / comments. --- diff --git a/src/client/control.c b/src/client/control.c index 20f1fcf..64486e3 100644 --- a/src/client/control.c +++ b/src/client/control.c @@ -23,13 +23,13 @@ -/* If "command_id" matches "match" in get_available_keycode_to_command(), - * execute "f" with provided char arguments and return 1; else only return 0. +/* If "keycode" matches "match" in get_available_keycode_to_command(), execute + * "f" with provided char arguments and return 1; else only return 0. */ -static uint8_t try_cmd_0args(int command_id, char * match, void (* f) ()); -static uint8_t try_cmd_1args(int command_id, char * match, +static uint8_t try_cmd_0args(int keycode, char * match, void (* f) ()); +static uint8_t try_cmd_1args(int keycode, char * match, void (* f) (char), char c); -static uint8_t try_cmd_2args(int command_id, char * match, +static uint8_t try_cmd_2args(int keycode, char * match, void (* f) (char, char), char c1, char c2); /* If "command_id" is id of command named "match", send (via try_send()) a @@ -52,9 +52,9 @@ static void wrap_mv_kb_mod(char c1, char c2); -static uint8_t try_cmd_0args(int command_id, char * match, void (* f) ()) +static uint8_t try_cmd_0args(int keycode, char * match, void (* f) ()) { - if (command_id == get_available_keycode_to_command(match)) + if (keycode == get_available_keycode_to_command(match)) { f(); return 1; @@ -64,10 +64,10 @@ static uint8_t try_cmd_0args(int command_id, char * match, void (* f) ()) -static uint8_t try_cmd_1args(int command_id, char * match, +static uint8_t try_cmd_1args(int keycode, char * match, void (* f) (char), char c) { - if (command_id == get_available_keycode_to_command(match)) + if (keycode == get_available_keycode_to_command(match)) { f(c); return 1; @@ -77,10 +77,10 @@ static uint8_t try_cmd_1args(int command_id, char * match, -static uint8_t try_cmd_2args(int command_id, char * match, +static uint8_t try_cmd_2args(int keycode, char * match, void (* f) (char, char), char c1, char c2) { - if (command_id == get_available_keycode_to_command(match)) + if (keycode == get_available_keycode_to_command(match)) { f(c1, c2); return 1; diff --git a/src/client/keybindings.h b/src/client/keybindings.h index 7da3356..e2031f3 100644 --- a/src/client/keybindings.h +++ b/src/client/keybindings.h @@ -13,7 +13,7 @@ struct KeyBinding { struct KeyBinding * next; - uint16_t key; /* keycode */ + uint16_t key; /* keycode */ char * command; /* name of command / functionality bound to keycode */ };