From b9148c1d705316478e6082d094af196f2cfd2e0d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 15 May 2017 02:50:14 +0200 Subject: [PATCH] Cleanups --- tasks/task_content.c | 2 -- tasks/task_wifi.c | 25 +++---------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/tasks/task_content.c b/tasks/task_content.c index e9d75e6246..7e650d9f09 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -927,9 +927,7 @@ static bool command_event_cmd_exec(const char *data, content_info.argv = NULL; content_info.args = NULL; content_info.environ_get = NULL; -#ifdef HAVE_MENU content_info.environ_get = menu_content_environment_get; -#endif #endif if (path_get(RARCH_PATH_CONTENT) != (void*)data) diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c index 369eb8c47e..9a173e775b 100644 --- a/tasks/task_wifi.c +++ b/tasks/task_wifi.c @@ -24,14 +24,6 @@ #include "../verbosity.h" #include "../wifi/wifi_driver.h" -typedef struct wifi_handle wifi_handle_t; - -struct wifi_handle -{ - void *empty; -}; - - static void task_wifi_scan_handler(retro_task_t *task) { driver_wifi_scan(); @@ -39,22 +31,19 @@ static void task_wifi_scan_handler(retro_task_t *task) task_set_progress(task, 100); task_set_title(task, strdup(msg_hash_to_str(MSG_WIFI_SCAN_COMPLETE))); task_set_finished(task, true); - - return; } bool task_push_wifi_scan(retro_task_callback_t cb) { retro_task_t *task = (retro_task_t *)calloc(1, sizeof(*task)); - wifi_handle_t *state = (wifi_handle_t*)calloc(1, sizeof(*state)); - if (!task || !state) - goto error; + if (!task) + return false; /* blocking means no other task can run while this one is running, * which is the default */ task->type = TASK_TYPE_BLOCKING; - task->state = state; + task->state = NULL; task->handler = task_wifi_scan_handler; task->callback = cb; task->title = strdup(msg_hash_to_str( @@ -63,12 +52,4 @@ bool task_push_wifi_scan(retro_task_callback_t cb) task_queue_push(task); return true; - -error: - if (state) - free(state); - if (task) - free(task); - - return false; }