summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-01-04 17:55:14 -0800
committerCedric BAIL <cedric.bail@free.fr>2019-01-16 16:10:30 -0800
commitba80dfe3f41abbd64083914409ad2ff525526776 (patch)
treefa88d4335542b97e864501414ba8db622c178e63 /src/lib/eina
parent5ab4784bbd31ab8dccfbfa9a84d944f5bb2a1441 (diff)
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 <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D7578
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_internal.h2
-rw-r--r--src/lib/eina/eina_promise.c7
-rw-r--r--src/lib/eina/eina_promise.h13
3 files changed, 1 insertions, 21 deletions
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 @@
42#endif 42#endif
43 43
44#include "eina_prefix.h" 44#include "eina_prefix.h"
45#include "eina_promise.h"
45 46
46typedef struct _Eina_Vpath_Interface_User Eina_Vpath_Interface_User; 47typedef struct _Eina_Vpath_Interface_User Eina_Vpath_Interface_User;
47 48
@@ -99,7 +100,6 @@ EAPI void eina_vpath_interface_app_set(const char *app_name, Eina_Prefix *p);
99 */ 100 */
100EAPI void eina_vpath_interface_user_set(Eina_Vpath_Interface_User *user); 101EAPI void eina_vpath_interface_user_set(Eina_Vpath_Interface_User *user);
101 102
102
103void eina_xdg_env_init(void); 103void eina_xdg_env_init(void);
104 104
105#undef EAPI 105#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)
1096 return (Eina_Future_Desc){.cb = _eina_future_cb_convert_to, .data = type}; 1096 return (Eina_Future_Desc){.cb = _eina_future_cb_convert_to, .data = type};
1097} 1097}
1098 1098
1099EAPI void *
1100eina_promise_data_get(const Eina_Promise *p)
1101{
1102 EINA_SAFETY_ON_NULL_RETURN_VAL(p, NULL);
1103 return (void *)p->data;
1104}
1105
1106static Eina_Value 1099static Eina_Value
1107_eina_future_cb_easy(void *data, const Eina_Value value, 1100_eina_future_cb_easy(void *data, const Eina_Value value,
1108 const Eina_Future *dead_future) 1101 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 {
535 * @see eina_promise_continue_new() 535 * @see eina_promise_continue_new()
536 * @see eina_promise_resolve() 536 * @see eina_promise_resolve()
537 * @see eina_promise_reject() 537 * @see eina_promise_reject()
538 * @see eina_promise_data_get()
539 * @see eina_promise_as_value() 538 * @see eina_promise_as_value()
540 * @see #Eina_Future_Scheduler 539 * @see #Eina_Future_Scheduler
541 * @see #Eina_Future_Scheduler_Entry 540 * @see #Eina_Future_Scheduler_Entry
@@ -602,7 +601,6 @@ EAPI Eina_Promise *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promi
602 * @see eina_promise_new() 601 * @see eina_promise_new()
603 * @see eina_promise_resolve() 602 * @see eina_promise_resolve()
604 * @see eina_promise_reject() 603 * @see eina_promise_reject()
605 * @see eina_promise_data_get()
606 * @see eina_promise_as_value() 604 * @see eina_promise_as_value()
607 * @see #Eina_Future_Scheduler 605 * @see #Eina_Future_Scheduler
608 * @see #Eina_Future_Scheduler_Entry 606 * @see #Eina_Future_Scheduler_Entry
@@ -611,15 +609,6 @@ EAPI Eina_Promise *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promi
611EAPI 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; 609EAPI 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;
612 610
613/** 611/**
614 * Gets the data attached to the promise.
615 *
616 * @return The data passed to eina_promise_new() or @c NULL on error.
617 * @see eina_promise_new()
618 * @see eina_promise_data_set()
619 */
620EAPI void *eina_promise_data_get(const Eina_Promise *p) EINA_ARG_NONNULL(1);
621
622/**
623 * Resolves a promise. 612 * Resolves a promise.
624 * 613 *
625 * This function schedules a resolve event in a 614 * This function schedules a resolve event in a
@@ -637,7 +626,6 @@ EAPI void *eina_promise_data_get(const Eina_Promise *p) EINA_ARG_NONNULL(1);
637 * 626 *
638 * @see eina_promise_new() 627 * @see eina_promise_new()
639 * @see eina_promise_reject() 628 * @see eina_promise_reject()
640 * @see eina_promise_data_get()
641 * @see eina_promise_as_value() 629 * @see eina_promise_as_value()
642 */ 630 */
643EAPI void eina_promise_resolve(Eina_Promise *p, Eina_Value value) EINA_ARG_NONNULL(1); 631EAPI 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
655 * 643 *
656 * @see eina_promise_new() 644 * @see eina_promise_new()
657 * @see eina_promise_resolve() 645 * @see eina_promise_resolve()
658 * @see eina_promise_data_get()
659 * @see eina_promise_as_value() 646 * @see eina_promise_as_value()
660 */ 647 */
661EAPI void eina_promise_reject(Eina_Promise *p, Eina_Error err) EINA_ARG_NONNULL(1); 648EAPI void eina_promise_reject(Eina_Promise *p, Eina_Error err) EINA_ARG_NONNULL(1);