From 9e383749aec79fc530bdc780c13574ec9cda61f1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 11 Dec 2015 14:50:06 +0100 Subject: [PATCH] Pass userdata handle to get_selection callback --- menu/drivers/materialui.c | 3 +-- menu/drivers/xmb.c | 3 +-- menu/menu_driver.c | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 1e90ce7696..9b3fc4fbb2 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -1316,8 +1316,7 @@ static int mui_list_push(void *data, void *userdata, static size_t mui_list_get_selection(void *data) { - menu_handle_t *menu = (menu_handle_t*)data; - mui_handle_t *mui = menu ? (mui_handle_t*)menu->userdata : NULL; + mui_handle_t *mui = (mui_handle_t*)data; if (!mui) return 0; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 775fa7781f..ce94266d38 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -253,8 +253,7 @@ static void xmb_fill_default_background_path(xmb_handle_t *xmb, char *path, size static size_t xmb_list_get_selection(void *data) { - menu_handle_t *menu = (menu_handle_t*)data; - xmb_handle_t *xmb = menu ? (xmb_handle_t*)menu->userdata : NULL; + xmb_handle_t *xmb = (xmb_handle_t*)data; if (!xmb) return 0; diff --git a/menu/menu_driver.c b/menu/menu_driver.c index d04a88afe6..df3c968ece 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -198,7 +198,8 @@ size_t menu_driver_list_get_selection(void) const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr(); if (driver && driver->list_get_selection) - return driver->list_get_selection(menu_driver_data); + return driver->list_get_selection(menu_driver_data + ? menu_driver_data->userdata : NULL); return 0; }