On Mon, Sep 11, 2017 at 8:15 PM, Cedric BAIL <cedric.b...@free.fr> wrote: > cedric pushed a commit to branch master. > > http://git.enlightenment.org/core/efl.git/commit/?id=fa9acf8b356b4e6d5ae899770b64f98e1f1a67f0 > > commit fa9acf8b356b4e6d5ae899770b64f98e1f1a67f0 > Author: Cedric BAIL <ced...@osg.samsung.com> > Date: Mon Sep 11 16:09:43 2017 -0700 > > eina: add eina_promise_data_set symetric to eina_promise_data_get. > --- > src/lib/eina/eina_promise.c | 9 +++++++++ > src/lib/eina/eina_promise.h | 11 +++++++++++ > 2 files changed, 20 insertions(+) > > diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c > index 1cbc9f274f..1fbac60f65 100644 > --- a/src/lib/eina/eina_promise.c > +++ b/src/lib/eina/eina_promise.c > @@ -998,6 +998,15 @@ eina_promise_data_get(const Eina_Promise *p) > return (void *)p->data; > } > > +EAPI void > +eina_promise_data_set(Eina_Promise *p, > + void *data) > +{ > + EINA_SAFETY_ON_NULL_RETURN(p); > + p->data = 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 9c8fc3a8a2..caca9574a9 100644 > --- a/src/lib/eina/eina_promise.h > +++ b/src/lib/eina/eina_promise.h > @@ -554,6 +554,17 @@ EAPI Eina_Promise > *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promi > EAPI void *eina_promise_data_get(const Eina_Promise *p) EINA_ARG_NONNULL(1); > > /** > + * Sets the data attached to the promise. > + * > + * Set the data passed to eina_promise_new(). > + * @see eina_promise_new() > + * @see eina_promise_resolve() > + * @see eina_promise_reject() > + * @see eina_promise_as_value()
these "@see" makes no sense, just "eina_promise_new()" and "eina_promise_data_get()" are enough > + */ > +EAPI void eina_promise_data_set(Eina_Promise *p, void *data) > EINA_ARG_NONNULL(1); as said on IRC, I tried to avoid this but in the end it pays off... with this we could simplify the internal ecore timer/job/idler future to not need an intermediate struct with 2 pointers just to break the cycle... so good move :-) -- Gustavo Sverzut Barbieri -------------------------------------- Mobile: +55 (16) 99354-9890 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel