From 77a131b0f99f723f9dcd413c1ac0839f579cc46f Mon Sep 17 00:00:00 2001 From: Alcaro Date: Fri, 17 Oct 2014 21:37:02 +0200 Subject: [PATCH] Fix warning. It looks invalid, but that code is indeed weird. --- frontend/menu/menu_entries_cbs.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/menu/menu_entries_cbs.c b/frontend/menu/menu_entries_cbs.c index e6d5daeb8b..c19f137482 100644 --- a/frontend/menu/menu_entries_cbs.c +++ b/frontend/menu/menu_entries_cbs.c @@ -1030,20 +1030,19 @@ static int action_toggle_input_bind_analog_dpad_mode(unsigned type, const char * static int action_start_input_bind_device_id(unsigned type, const char *label, unsigned action) { - int *p = NULL; - unsigned port = 0; + int p; if (!driver.menu) return -1; - port = driver.menu->current_pad; - p = (int*)&g_settings.input.joypad_map[port]; - *p = port; + p = driver.menu->current_pad; - if (*p < -1) - *p = -1; - else if (*p >= MAX_PLAYERS) - *p = MAX_PLAYERS - 1; + if (p < -1) + p = -1; + else if (p >= MAX_PLAYERS) + p = MAX_PLAYERS - 1; + + g_settings.input.joypad_map[driver.menu->current_pad] = p; return 0; }