From 22139dc4a08f9789489bec2acfdc74d33c0f6b47 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 11 Aug 2017 01:16:03 +0200 Subject: [PATCH] Turn menu_animation_ctx_tag into typedef --- menu/drivers/xmb.c | 18 +++++++----------- menu/menu_animation.c | 6 +++--- menu/menu_animation.h | 5 +---- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 76b051633a..2095f40ba9 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1087,7 +1087,7 @@ static void xmb_selection_pointer_changed( { menu_entry_t e; unsigned i, end, height; - menu_animation_ctx_tag_t tag; + menu_animation_ctx_tag tag; size_t num = 0; int threshold = 0; menu_list_t *menu_list = NULL; @@ -1118,7 +1118,7 @@ static void xmb_selection_pointer_changed( video_driver_get_size(NULL, &height); - tag.id = (uintptr_t)selection_buf; + tag = (uintptr_t)selection_buf; menu_animation_ctl(MENU_ANIMATION_CTL_KILL_BY_TAG, &tag); menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &num); @@ -1190,7 +1190,7 @@ static void xmb_selection_pointer_changed( entry.target_value = ia; entry.subject = &node->alpha; entry.easing_enum = EASING_OUT_QUAD; - entry.tag = tag.id; + entry.tag = tag; entry.cb = NULL; if (entry.subject) @@ -3735,11 +3735,9 @@ static void xmb_list_insert(void *userdata, static void xmb_list_clear(file_list_t *list) { size_t i; - menu_animation_ctx_tag_t tag; - size_t size = list->size; + size_t size = list->size; + menu_animation_ctx_tag tag = (uintptr_t)list; - tag.id = (uintptr_t)list; - menu_animation_ctl(MENU_ANIMATION_CTL_KILL_BY_TAG, &tag); for (i = 0; i < size; ++i) @@ -3757,10 +3755,8 @@ static void xmb_list_clear(file_list_t *list) static void xmb_list_deep_copy(const file_list_t *src, file_list_t *dst) { size_t i; - menu_animation_ctx_tag_t tag; - size_t size = dst->size; - - tag.id = (uintptr_t)dst; + menu_animation_ctx_tag tag = (uintptr_t)dst; + size_t size = dst->size; menu_animation_ctl(MENU_ANIMATION_CTL_KILL_BY_TAG, &tag); diff --git a/menu/menu_animation.c b/menu/menu_animation.c index bd9cdc0850..8464a7876c 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -648,14 +648,14 @@ bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data) case MENU_ANIMATION_CTL_KILL_BY_TAG: { unsigned i; - menu_animation_ctx_tag_t *tag = (menu_animation_ctx_tag_t*)data; + menu_animation_ctx_tag *tag = (menu_animation_ctx_tag*)data; - if (!tag || tag->id == (uintptr_t)-1) + if (!tag || *tag == (uintptr_t)-1) return false; for (i = 0; i < anim.size; ++i) { - if (anim.list[i].tag != tag->id) + if (anim.list[i].tag != *tag) continue; anim.list[i].alive = false; diff --git a/menu/menu_animation.h b/menu/menu_animation.h index c010c3971e..4798b39a67 100644 --- a/menu/menu_animation.h +++ b/menu/menu_animation.h @@ -91,10 +91,7 @@ typedef struct menu_animation_ctx_delta float ideal; } menu_animation_ctx_delta_t; -typedef struct menu_animation_ctx_tag -{ - uintptr_t id; -} menu_animation_ctx_tag_t; +typedef uintptr_t menu_animation_ctx_tag; typedef struct menu_animation_ctx_subject {