From ba80dfe3f41abbd64083914409ad2ff525526776 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 4 Jan 2019 17:55:14 -0800 Subject: eina: remove eina_promise_data_get has it lead to risky use. It seems that use of eina_promise_data_get lead to mostly missuse. As it duplicate other infrastructure which do not have the same problem. So better remove it and if we need it back, we can just revert this patch later. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D7578 --- src/lib/eina/eina_internal.h | 2 +- src/lib/eina/eina_promise.c | 7 ------- src/lib/eina/eina_promise.h | 13 ------------- 3 files changed, 1 insertion(+), 21 deletions(-) (limited to 'src/lib/eina') diff --git a/src/lib/eina/eina_internal.h b/src/lib/eina/eina_internal.h index 9ae14df76b..e501bd17b5 100644 --- a/src/lib/eina/eina_internal.h +++ b/src/lib/eina/eina_internal.h @@ -42,6 +42,7 @@ #endif #include "eina_prefix.h" +#include "eina_promise.h" typedef struct _Eina_Vpath_Interface_User Eina_Vpath_Interface_User; @@ -99,7 +100,6 @@ EAPI void eina_vpath_interface_app_set(const char *app_name, Eina_Prefix *p); */ EAPI void eina_vpath_interface_user_set(Eina_Vpath_Interface_User *user); - void eina_xdg_env_init(void); #undef EAPI diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c index e9d4461e55..1937c17d90 100644 --- a/src/lib/eina/eina_promise.c +++ b/src/lib/eina/eina_promise.c @@ -1096,13 +1096,6 @@ eina_future_cb_convert_to(const Eina_Value_Type *type) return (Eina_Future_Desc){.cb = _eina_future_cb_convert_to, .data = type}; } -EAPI void * -eina_promise_data_get(const Eina_Promise *p) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(p, NULL); - return (void *)p->data; -} - static Eina_Value _eina_future_cb_easy(void *data, const Eina_Value value, const Eina_Future *dead_future) diff --git a/src/lib/eina/eina_promise.h b/src/lib/eina/eina_promise.h index 9a148e45eb..428da12afa 100644 --- a/src/lib/eina/eina_promise.h +++ b/src/lib/eina/eina_promise.h @@ -535,7 +535,6 @@ struct _Eina_Future_Desc { * @see eina_promise_continue_new() * @see eina_promise_resolve() * @see eina_promise_reject() - * @see eina_promise_data_get() * @see eina_promise_as_value() * @see #Eina_Future_Scheduler * @see #Eina_Future_Scheduler_Entry @@ -602,7 +601,6 @@ EAPI Eina_Promise *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promi * @see eina_promise_new() * @see eina_promise_resolve() * @see eina_promise_reject() - * @see eina_promise_data_get() * @see eina_promise_as_value() * @see #Eina_Future_Scheduler * @see #Eina_Future_Scheduler_Entry @@ -610,15 +608,6 @@ EAPI Eina_Promise *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promi */ EAPI Eina_Promise *eina_promise_continue_new(const Eina_Future *dead_future, Eina_Promise_Cancel_Cb cancel_cb, const void *data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; -/** - * Gets the data attached to the promise. - * - * @return The data passed to eina_promise_new() or @c NULL on error. - * @see eina_promise_new() - * @see eina_promise_data_set() - */ -EAPI void *eina_promise_data_get(const Eina_Promise *p) EINA_ARG_NONNULL(1); - /** * Resolves a promise. * @@ -637,7 +626,6 @@ EAPI void *eina_promise_data_get(const Eina_Promise *p) EINA_ARG_NONNULL(1); * * @see eina_promise_new() * @see eina_promise_reject() - * @see eina_promise_data_get() * @see eina_promise_as_value() */ EAPI void eina_promise_resolve(Eina_Promise *p, Eina_Value value) EINA_ARG_NONNULL(1); @@ -655,7 +643,6 @@ EAPI void eina_promise_resolve(Eina_Promise *p, Eina_Value value) EINA_ARG_NONNU * * @see eina_promise_new() * @see eina_promise_resolve() - * @see eina_promise_data_get() * @see eina_promise_as_value() */ EAPI void eina_promise_reject(Eina_Promise *p, Eina_Error err) EINA_ARG_NONNULL(1); -- cgit v1.2.1