Fix the warnings and some errors.

This commit is contained in:
sorgelig
2018-12-29 21:15:25 +08:00
parent 3aa5c4d438
commit ddd5b75d2b
19 changed files with 136 additions and 156 deletions

View File

@@ -475,7 +475,7 @@ static const int ev2ps2[] =
NONE, //191 KEY_F21
NONE, //192 KEY_F22
NONE, //193 KEY_F23
0x5D, //194 U-mlaut on DE mapped to
0x5D, //194 U-mlaut on DE mapped to backslash
NONE, //195 ???
NONE, //196 ???
NONE, //197 ???
@@ -986,7 +986,7 @@ typedef struct
int accx, accy;
} devInput;
static devInput input[NUMDEV] = { 0 };
static devInput input[NUMDEV] = {};
static int first_joystick = -1;
int mfd = -1;
@@ -1082,6 +1082,8 @@ static int check_devs()
static void INThandler(int code)
{
(void)code;
printf("\nExiting...\n");
if (mwd >= 0) inotify_rm_watch(mfd, mwd);
@@ -1257,7 +1259,7 @@ static int keyrah_trans(int key, int press)
else if (fn)
{
fn |= 2;
for (int n = 0; n<(sizeof(kr_fn_table) / (2 * sizeof(kr_fn_table[0]))); n++)
for (uint32_t n = 0; n<(sizeof(kr_fn_table) / (2 * sizeof(kr_fn_table[0]))); n++)
{
if ((key&255) == kr_fn_table[n * 2]) return kr_fn_table[(n * 2) + 1];
}
@@ -1423,8 +1425,6 @@ static void joy_analog(int num, int axis, int offset)
static void input_cb(struct input_event *ev, struct input_absinfo *absinfo, int dev)
{
static int key_mapped = 0;
static uint8_t modifiers = 0;
static char keys[6] = { 0,0,0,0,0,0 };
int map_skip = (ev->type == EV_KEY && ev->code == 57 && mapping_dev >= 0 && mapping_type==1);
int cancel = (ev->type == EV_KEY && ev->code == 1);