summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-08-27 00:22:52 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-08-27 11:35:38 -0300
commit701aab803d639c6105e5998b7e76097c42e23021 (patch)
treebaf029c9e08a529334fb9ec6696ddbb94510137b
parentb2cd2cbf164dc40cb90b69d0174569fe64a64629 (diff)
fixup Efl_Object: Add integration with Eina_Future.
Rename _from_array() to _array(), following others. Fix variable to be signed so -1 is clean (it would work due overlow, but not that clear).
-rw-r--r--src/lib/eo/Eo.h20
-rw-r--r--src/lib/eo/eo_base_class.c8
2 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 2a8cb44d9f..93f43580b4 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -344,10 +344,10 @@ EOAPI Eina_Bool efl_future_link(Eo *obj, Efl_Future *link);
344/** 344/**
345 * @struct _Efl_Future_Cb_Desc 345 * @struct _Efl_Future_Cb_Desc
346 * 346 *
347 * A struct with callbacks to be used by efl_future_cb_from_desc() and efl_future_chain_from_array() 347 * A struct with callbacks to be used by efl_future_cb_from_desc() and efl_future_chain_array()
348 * 348 *
349 * @see efl_future_cb_from_desc() 349 * @see efl_future_cb_from_desc()
350 * @see efl_future_chain_from_array() 350 * @see efl_future_chain_array()
351 */ 351 */
352typedef struct _Efl_Future_Cb_Desc { 352typedef struct _Efl_Future_Cb_Desc {
353 /** 353 /**
@@ -360,7 +360,7 @@ typedef struct _Efl_Future_Cb_Desc {
360 * 360 *
361 * @note This function is always called from a safe context (main loop or some platform defined safe context). 361 * @note This function is always called from a safe context (main loop or some platform defined safe context).
362 * 362 *
363 * @param o The object used to create the link in efl_future_cb_from_desc() or efl_future_chain_from_array(). 363 * @param o The object used to create the link in efl_future_cb_from_desc() or efl_future_chain_array().
364 * @param value The operation result 364 * @param value The operation result
365 * @return An Eina_Value to pass to the next Eina_Future in the chain (if any). 365 * @return An Eina_Value to pass to the next Eina_Future in the chain (if any).
366 * If there is no need to convert the received value, it's @b recommended 366 * If there is no need to convert the received value, it's @b recommended
@@ -399,7 +399,7 @@ typedef struct _Efl_Future_Cb_Desc {
399 * Otherwise this function is called from a safe context. 399 * Otherwise this function is called from a safe context.
400 * 400 *
401 * 401 *
402 * @param o The object used to create the link in efl_future_cb_from_desc() or efl_future_chain_from_array(). 402 * @param o The object used to create the link in efl_future_cb_from_desc() or efl_future_chain_array().
403 * @param error The operation error 403 * @param error The operation error
404 * @return An Eina_Value to pass to the next Eina_Future in the chain (if any). 404 * @return An Eina_Value to pass to the next Eina_Future in the chain (if any).
405 * If you need to convert to a different type or generate a new value, 405 * If you need to convert to a different type or generate a new value,
@@ -424,7 +424,7 @@ typedef struct _Efl_Future_Cb_Desc {
424 * from the current context with the following errors respectitally: `EINVAL`, `ENOMEM` and `ECANCELED`. 424 * from the current context with the following errors respectitally: `EINVAL`, `ENOMEM` and `ECANCELED`.
425 * Otherwise this function is called from a safe context. 425 * Otherwise this function is called from a safe context.
426 * 426 *
427 * @param o The object used to create the link in efl_future_cb_from_desc() or efl_future_chain_from_array(). 427 * @param o The object used to create the link in efl_future_cb_from_desc() or efl_future_chain_array().
428 * @param dead_future The future that was freed. 428 * @param dead_future The future that was freed.
429 */ 429 */
430 void (*free)(Eo *o, const Eina_Future *dead_future); 430 void (*free)(Eo *o, const Eina_Future *dead_future);
@@ -519,7 +519,7 @@ typedef struct _Efl_Future_Cb_Desc {
519 * @param obj The object to create the link. 519 * @param obj The object to create the link.
520 * @param desc An Efl_Future_Cb_Desc 520 * @param desc An Efl_Future_Cb_Desc
521 * @return An Eina_Future_Desc to be used by eina_future_then(), eina_future_chain() and friends. 521 * @return An Eina_Future_Desc to be used by eina_future_then(), eina_future_chain() and friends.
522 * @see efl_future_chain_from_array() 522 * @see efl_future_chain_array()
523 * @see efl_future_cb() 523 * @see efl_future_cb()
524 * @see #Efl_Future_Cb_Desc 524 * @see #Efl_Future_Cb_Desc
525 * @see efl_key_data_set() 525 * @see efl_key_data_set()
@@ -559,19 +559,19 @@ EOAPI Eina_Future_Desc efl_future_cb_from_desc(Eo *obj, const Efl_Future_Cb_Desc
559 * @see eina_future_then_from_desc() 559 * @see eina_future_then_from_desc()
560 * @see #Efl_Future_Cb_Desc 560 * @see #Efl_Future_Cb_Desc
561 */ 561 */
562EOAPI Eina_Future *efl_future_chain_from_array(Eo *obj, Eina_Future *prev, const Efl_Future_Cb_Desc descs[]); 562EOAPI Eina_Future *efl_future_chain_array(Eo *obj, Eina_Future *prev, const Efl_Future_Cb_Desc descs[]);
563 563
564/** 564/**
565 * Syntax suger over efl_future_chain_from_array() 565 * Syntax suger over efl_future_chain_array()
566 * 566 *
567 * Usage: 567 * Usage:
568 * @code 568 * @code
569 * Eina_Future *f = efl_future_chain(my_object, prev_future, {}, {}); 569 * Eina_Future *f = efl_future_chain(my_object, prev_future, {}, {});
570 * @endcode 570 * @endcode
571 * 571 *
572 * @see efl_future_chain_from_array() 572 * @see efl_future_chain_array()
573 */ 573 */
574#define efl_future_chain(_eo, _prev, ...) efl_future_chain_from_array(_eo, _prev, (Efl_Future_Cb_Desc []){__VA_ARGS__, {NULL, NULL, NULL, NULL, NULL}}) 574#define efl_future_chain(_eo, _prev, ...) efl_future_chain_array(_eo, _prev, (Efl_Future_Cb_Desc []){__VA_ARGS__, {NULL, NULL, NULL, NULL, NULL}})
575 575
576/** 576/**
577 * @addtogroup Eo_Debug_Information Eo's Debug information helper. 577 * @addtogroup Eo_Debug_Information Eo's Debug information helper.
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 913e7fbe5d..5c9de641d7 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1962,11 +1962,11 @@ efl_future_cb_from_desc(Eo *o, const Efl_Future_Cb_Desc desc)
1962} 1962}
1963 1963
1964EOAPI Eina_Future * 1964EOAPI Eina_Future *
1965efl_future_chain_from_array(Eo *obj, 1965efl_future_chain_array(Eo *obj,
1966 Eina_Future *prev, 1966 Eina_Future *prev,
1967 const Efl_Future_Cb_Desc descs[]) 1967 const Efl_Future_Cb_Desc descs[])
1968{ 1968{
1969 size_t i = -1; 1969 ssize_t i = -1;
1970 Eina_Future *f = prev; 1970 Eina_Future *f = prev;
1971 1971
1972 for (i = 0; descs[i].success || descs[i].error || descs[i].free || descs[i].success_type; i++) 1972 for (i = 0; descs[i].success || descs[i].error || descs[i].free || descs[i].success_type; i++)