Skip to content

Commit f626558

Browse files
committed
(tty_keyname_to_keycode): return int instead of long.
A part of ticket #3474. Signed-off-by: Andrew Borodin <[email protected]>
1 parent 1f5e3c1 commit f626558

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
@@ -433,7 +433,7 @@ void
433433
keybind_cmd_bind (GArray *keymap, const char *keybind, long action)
434434
{
435435
char *caption = NULL;
436-
long key;
436+
int key;
437437

438438
key = tty_keyname_to_keycode (keybind, &caption);
439439
keymap_add (keymap, key, action, caption);

lib/tty/key.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ channels_down (void)
14381438
* Return the code associated with the symbolic name keyname
14391439
*/
14401440

1441-
long
1441+
int
14421442
tty_keyname_to_keycode (const char *name, char **label)
14431443
{
14441444
char **lc_keys, **p;
@@ -1548,7 +1548,7 @@ tty_keyname_to_keycode (const char *name, char **label)
15481548
if (use_meta != -1)
15491549
k = ALT (k);
15501550

1551-
return (long) k;
1551+
return k;
15521552
}
15531553

15541554
/* --------------------------------------------------------------------------------------------- */

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
@@ -624,7 +624,6 @@ load_keys_from_section (const char *terminal, mc_config_t *cfg)
624624
char *section_name;
625625
gchar **profile_keys, **keys;
626626
char *valcopy, *value;
627-
long key_code;
628627

629628
if (terminal == NULL)
630629
return;
@@ -643,7 +642,8 @@ load_keys_from_section (const char *terminal, mc_config_t *cfg)
643642
continue;
644643
}
645644

646-
key_code = tty_keyname_to_keycode (*profile_keys, NULL);
645+
const int key_code = tty_keyname_to_keycode (*profile_keys, NULL);
646+
647647
if (key_code != 0)
648648
{
649649
gchar **values;

0 commit comments

Comments
 (0)