Skip to content

Commit

Permalink
(tty_keyname_to_keycode): return int instead of long.
Browse files Browse the repository at this point in the history
A part of ticket #3474.

Signed-off-by: Andrew Borodin <[email protected]>
  • Loading branch information
aborodin committed Feb 3, 2025
1 parent 1f5e3c1 commit f626558
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/keybind.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ void
keybind_cmd_bind (GArray *keymap, const char *keybind, long action)
{
char *caption = NULL;
long key;
int key;

key = tty_keyname_to_keycode (keybind, &caption);
keymap_add (keymap, key, action, caption);
Expand Down
4 changes: 2 additions & 2 deletions lib/tty/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ channels_down (void)
* Return the code associated with the symbolic name keyname
*/

long
int
tty_keyname_to_keycode (const char *name, char **label)
{
char **lc_keys, **p;
Expand Down Expand Up @@ -1548,7 +1548,7 @@ tty_keyname_to_keycode (const char *name, char **label)
if (use_meta != -1)
k = ALT (k);

return (long) k;
return k;
}

/* --------------------------------------------------------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion lib/tty/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void init_key (void);
void init_key_input_fd (void);
void done_key (void);

long tty_keyname_to_keycode (const char *name, char **label);
int tty_keyname_to_keycode (const char *name, char **label);
char *tty_keycode_to_keyname (const int keycode);
/* mouse support */
int tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block);
Expand Down
4 changes: 2 additions & 2 deletions src/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ load_keys_from_section (const char *terminal, mc_config_t *cfg)
char *section_name;
gchar **profile_keys, **keys;
char *valcopy, *value;
long key_code;

if (terminal == NULL)
return;
Expand All @@ -643,7 +642,8 @@ load_keys_from_section (const char *terminal, mc_config_t *cfg)
continue;
}

key_code = tty_keyname_to_keycode (*profile_keys, NULL);
const int key_code = tty_keyname_to_keycode (*profile_keys, NULL);

if (key_code != 0)
{
gchar **values;
Expand Down

0 comments on commit f626558

Please sign in to comment.