From caa6cc5bc81278f446d852f73422af36c4c846c5 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 14 Mar 2020 18:55:43 +0100 Subject: Perfect but leaks --- src/ft_convert_keycode.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/ft_convert_keycode.c') diff --git a/src/ft_convert_keycode.c b/src/ft_convert_keycode.c index 5a037c5..899dae9 100644 --- a/src/ft_convert_keycode.c +++ b/src/ft_convert_keycode.c @@ -19,17 +19,18 @@ int32_t uint16_t keycode; keycode = UINT16_MAX; - (tmp_code == FT_W_KEY) ? (keycode = 0) : 0; - (tmp_code == FT_A_KEY) ? (keycode = 1) : 0; - (tmp_code == FT_S_KEY) ? (keycode = 2) : 0; - (tmp_code == FT_D_KEY) ? (keycode = 3) : 0; - (tmp_code == FT_L_ARR_KEY) ? (keycode = 4) : 0; - (tmp_code == FT_R_ARR_KEY) ? (keycode = 5) : 0; - (tmp_code == 3) ? (keycode = UINT16_MAX) : 0; - (tmp_code == 4) ? (keycode = UINT16_MAX) : 0; - (tmp_code == 5) ? (keycode = UINT16_MAX) : 0; - (tmp_code == FT_ESC_KEY) ? (keycode = FT_ESC_KEY) : 0; - (tmp_code == FT_F1_KEY) ? (keycode = FT_F1_KEY) : 0; - (tmp_code == FT_TAB_KEY) ? (keycode = FT_TAB_KEY) : 0; + keycode = (tmp_code == FT_W_KEY) ? (0) : (keycode); + keycode = (tmp_code == FT_A_KEY) ? (1) : (keycode); + keycode = (tmp_code == FT_S_KEY) ? (2) : (keycode); + keycode = (tmp_code == FT_D_KEY) ? (3) : (keycode); + keycode = (tmp_code == FT_L_ARR_KEY) ? (4) : (keycode); + keycode = (tmp_code == FT_R_ARR_KEY) ? (5) : (keycode); + keycode = (tmp_code == 3) ? (UINT16_MAX) : (keycode); + keycode = (tmp_code == 4) ? (UINT16_MAX) : (keycode); + keycode = (tmp_code == 5) ? (UINT16_MAX) : (keycode); + keycode = (tmp_code == FT_ESC_KEY) ? (FT_ESC_KEY) : (keycode); + keycode = (tmp_code == FT_F1_KEY) ? (FT_F1_KEY) : (keycode); + keycode = (tmp_code == FT_TAB_KEY) ? (FT_TAB_KEY) : (keycode); + keycode = (tmp_code == FT_RET_KEY) ? (FT_RET_KEY) : (keycode); return (keycode); } -- cgit v1.2.3