From 442227ee5519f307e9f74030a9eeb7aa7983a4bc Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 15 Dec 2013 21:18:30 +0100 Subject: Fix gcc signedness warning Thanks Marin Ramesa and Richard Braun for investigating. * i386/i386at/kd.c (kdintr): Make `char_idx' and `max' unsigned. (kdstate2idx): Make function take and return unsigned ints for the state. * i386/i386at/kd.h (kdstate2idx): Likewise. --- i386/i386at/kd.c | 8 ++++---- i386/i386at/kd.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c index 33d1799..3c66cc5 100644 --- a/i386/i386at/kd.c +++ b/i386/i386at/kd.c @@ -727,7 +727,7 @@ int vec; struct tty *tp; unsigned char c; unsigned char scancode; - int char_idx; + unsigned int char_idx; boolean_t up = FALSE; /* key-up event */ if (kd_pollc) @@ -807,7 +807,7 @@ int vec; set_kd_state(do_modifier(kd_state, c, up)); } else if (!up) { /* regular key-down */ - int max; /* max index for char sequence */ + unsigned int max; /* max index for char sequence */ max = char_idx + NUMOUTPUT; char_idx++; @@ -1028,9 +1028,9 @@ Scancode scancode; * Return the value for the 2nd index into key_map that * corresponds to the given state. */ -int +unsigned int kdstate2idx(state, extended) -int state; /* bit vector, not a state index */ +unsigned int state; /* bit vector, not a state index */ boolean_t extended; { int state_idx = NORM_STATE; diff --git a/i386/i386at/kd.h b/i386/i386at/kd.h index 9909341..0907e23 100644 --- a/i386/i386at/kd.h +++ b/i386/i386at/kd.h @@ -731,7 +731,7 @@ extern int kdsetbell (int, int); extern void kd_resend (void); extern void kd_handle_ack (void); extern int kd_kbd_magic (int); -extern int kdstate2idx (int, boolean_t); +extern unsigned int kdstate2idx (unsigned int, boolean_t); extern void kd_parserest (u_char *); extern int kdcnprobe(struct consdev *cp); extern int kdcninit(struct consdev *cp); -- cgit v1.2.3