diff options
author | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2016-05-26 13:03:05 -0300 |
---|---|---|
committer | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2016-05-26 13:35:07 -0300 |
commit | 3ffe38b0c33bf7ff611098df2a8a9c16f696eb17 (patch) | |
tree | e2b6ff108e361dffad004802231fb778e27b898b | |
parent | a7e548743948bcd2efbe3a9779f0e03c72a93fd8 (diff) | |
download | efl-3ffe38b0c33bf7ff611098df2a8a9c16f696eb17.tar.gz |
eina: Fix then callbacks prototypes
Eina_Error is not passed by pointer anymore, which could cause invalid
pointer access in promise compositions (all and race).
Also added Eina_Promise* to prototypes.
-rw-r--r-- | src/lib/eina/eina_promise.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c index e3a14fe534..6f83172e10 100644 --- a/src/lib/eina/eina_promise.c +++ b/src/lib/eina/eina_promise.c @@ -548,7 +548,7 @@ eina_promise_owner_default_call_then(Eina_Promise_Owner* promise) } static void -_eina_promise_all_compose_then_cb(_Eina_Promise_Default_Owner* promise, void* value EINA_UNUSED) +_eina_promise_all_compose_then_cb(_Eina_Promise_Default_Owner* promise, void* value EINA_UNUSED, Eina_Promise* promise_then EINA_UNUSED) { _Eina_Promise_Iterator* iterator; @@ -563,12 +563,12 @@ _eina_promise_all_compose_then_cb(_Eina_Promise_Default_Owner* promise, void* va } static void -_eina_promise_all_compose_error_then_cb(_Eina_Promise_Default_Owner* promise, Eina_Error const* error) +_eina_promise_all_compose_error_then_cb(_Eina_Promise_Default_Owner* promise, Eina_Error error, Eina_Promise* promise_then EINA_UNUSED) { if (!promise->promise.has_finished) { promise->promise.has_finished = promise->promise.has_errored = EINA_TRUE; - promise->promise.error = *error; + promise->promise.error = error; _eina_promise_finish(promise); } } @@ -718,7 +718,7 @@ _eina_promise_race_free(_Eina_Promise_Race_Value_Type* value) } static void -_eina_promise_race_compose_then_cb(struct _Eina_Promise_Race_Information* info, void* value EINA_UNUSED) +_eina_promise_race_compose_then_cb(struct _Eina_Promise_Race_Information* info, void* value EINA_UNUSED, Eina_Promise* promise_then EINA_UNUSED) { _Eina_Promise_Default_Owner* race_promise; _Eina_Promise_Race_Value_Type *race_value; @@ -735,7 +735,7 @@ _eina_promise_race_compose_then_cb(struct _Eina_Promise_Race_Information* info, } static void -_eina_promise_race_compose_error_then_cb(struct _Eina_Promise_Race_Information* info, Eina_Error const* error) +_eina_promise_race_compose_error_then_cb(struct _Eina_Promise_Race_Information* info, Eina_Error error, Eina_Promise* promise_then EINA_UNUSED) { _Eina_Promise_Default_Owner* race_promise; _Eina_Promise_Race_Value_Type *race_value; @@ -746,7 +746,7 @@ _eina_promise_race_compose_error_then_cb(struct _Eina_Promise_Race_Information* if (!race_promise->promise.has_finished) { race_value->promise_index = info - &race_value->promises[0]; - eina_promise_owner_error_set(&race_promise->owner_vtable, *error); + eina_promise_owner_error_set(&race_promise->owner_vtable, error); } } |