Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 29a1c87

Browse files
committed
(tty_keyname_to_keycode): return int instead of long.
A part of ticket #3474. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
1 parent 23715e2 commit 29a1c87

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/keybind.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void
436436
keybind_cmd_bind (GArray *keymap, const char *keybind, long action)
437437
{
438438
char *caption = NULL;
439-
long key;
439+
int key;
440440

441441
key = tty_keyname_to_keycode (keybind, &caption);
442442
keymap_add (keymap, key, action, caption);

lib/tty/key.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ channels_down (void)
14411441
* Return the code associated with the symbolic name keyname
14421442
*/
14431443

1444-
long
1444+
int
14451445
tty_keyname_to_keycode (const char *name, char **label)
14461446
{
14471447
char **lc_keys, **p;
@@ -1551,7 +1551,7 @@ tty_keyname_to_keycode (const char *name, char **label)
15511551
if (use_meta != -1)
15521552
k = ALT (k);
15531553

1554-
return (long) k;
1554+
return k;
15551555
}
15561556

15571557
/* --------------------------------------------------------------------------------------------- */

lib/tty/key.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void init_key (void);
7575
void init_key_input_fd (void);
7676
void done_key (void);
7777

78-
long tty_keyname_to_keycode (const char *name, char **label);
78+
int tty_keyname_to_keycode (const char *name, char **label);
7979
char *tty_keycode_to_keyname (const int keycode);
8080
/* mouse support */
8181
int tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block);

src/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,6 @@ load_keys_from_section (const char *terminal, mc_config_t *cfg)
609609
char *section_name;
610610
gchar **profile_keys, **keys;
611611
char *valcopy, *value;
612-
long key_code;
613612

614613
if (terminal == NULL)
615614
return;
@@ -628,7 +627,8 @@ load_keys_from_section (const char *terminal, mc_config_t *cfg)
628627
continue;
629628
}
630629

631-
key_code = tty_keyname_to_keycode (*profile_keys, NULL);
630+
const int key_code = tty_keyname_to_keycode (*profile_keys, NULL);
631+
632632
if (key_code != 0)
633633
{
634634
gchar **values;

0 commit comments

Comments
 (0)