summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_promise.c
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-26 13:03:05 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-26 13:35:07 -0300
commit3ffe38b0c33bf7ff611098df2a8a9c16f696eb17 (patch)
treee2b6ff108e361dffad004802231fb778e27b898b /src/lib/eina/eina_promise.c
parenta7e548743948bcd2efbe3a9779f0e03c72a93fd8 (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_promise.c12
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)
548} 548}
549 549
550static void 550static void
551_eina_promise_all_compose_then_cb(_Eina_Promise_Default_Owner* promise, void* value EINA_UNUSED) 551_eina_promise_all_compose_then_cb(_Eina_Promise_Default_Owner* promise, void* value EINA_UNUSED, Eina_Promise* promise_then EINA_UNUSED)
552{ 552{
553 _Eina_Promise_Iterator* iterator; 553 _Eina_Promise_Iterator* iterator;
554 554
@@ -563,12 +563,12 @@ _eina_promise_all_compose_then_cb(_Eina_Promise_Default_Owner* promise, void* va
563} 563}
564 564
565static void 565static void
566_eina_promise_all_compose_error_then_cb(_Eina_Promise_Default_Owner* promise, Eina_Error const* error) 566_eina_promise_all_compose_error_then_cb(_Eina_Promise_Default_Owner* promise, Eina_Error error, Eina_Promise* promise_then EINA_UNUSED)
567{ 567{
568 if (!promise->promise.has_finished) 568 if (!promise->promise.has_finished)
569 { 569 {
570 promise->promise.has_finished = promise->promise.has_errored = EINA_TRUE; 570 promise->promise.has_finished = promise->promise.has_errored = EINA_TRUE;
571 promise->promise.error = *error; 571 promise->promise.error = error;
572 _eina_promise_finish(promise); 572 _eina_promise_finish(promise);
573 } 573 }
574} 574}
@@ -718,7 +718,7 @@ _eina_promise_race_free(_Eina_Promise_Race_Value_Type* value)
718} 718}
719 719
720static void 720static void
721_eina_promise_race_compose_then_cb(struct _Eina_Promise_Race_Information* info, void* value EINA_UNUSED) 721_eina_promise_race_compose_then_cb(struct _Eina_Promise_Race_Information* info, void* value EINA_UNUSED, Eina_Promise* promise_then EINA_UNUSED)
722{ 722{
723 _Eina_Promise_Default_Owner* race_promise; 723 _Eina_Promise_Default_Owner* race_promise;
724 _Eina_Promise_Race_Value_Type *race_value; 724 _Eina_Promise_Race_Value_Type *race_value;
@@ -735,7 +735,7 @@ _eina_promise_race_compose_then_cb(struct _Eina_Promise_Race_Information* info,
735} 735}
736 736
737static void 737static void
738_eina_promise_race_compose_error_then_cb(struct _Eina_Promise_Race_Information* info, Eina_Error const* error) 738_eina_promise_race_compose_error_then_cb(struct _Eina_Promise_Race_Information* info, Eina_Error error, Eina_Promise* promise_then EINA_UNUSED)
739{ 739{
740 _Eina_Promise_Default_Owner* race_promise; 740 _Eina_Promise_Default_Owner* race_promise;
741 _Eina_Promise_Race_Value_Type *race_value; 741 _Eina_Promise_Race_Value_Type *race_value;
@@ -746,7 +746,7 @@ _eina_promise_race_compose_error_then_cb(struct _Eina_Promise_Race_Information*
746 if (!race_promise->promise.has_finished) 746 if (!race_promise->promise.has_finished)
747 { 747 {
748 race_value->promise_index = info - &race_value->promises[0]; 748 race_value->promise_index = info - &race_value->promises[0];
749 eina_promise_owner_error_set(&race_promise->owner_vtable, *error); 749 eina_promise_owner_error_set(&race_promise->owner_vtable, error);
750 } 750 }
751} 751}
752 752