From b33372b1f6191c4d671cff0e0a96cda5dd000f50 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 23 Sep 2014 14:36:18 +0100 Subject: [PATCH] Eo do: simplify eo_do macro. This moves the mainloop check inside the function. There was never need for it to be in client code (i.e a header/macro). This is better suited inside eo_do_start because this is a macro some bindings have to re-implement, and we definitely don't want it to be any more complicated than it has to be. This breaks ABI and makes elm 1.12 depend on efl 1.11. This is not an issue as because of eolian and interfaces it's already the case. --- src/lib/eo/Eo.h | 5 ++--- src/lib/eo/eo.c | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 14e85f1c38..bf64f2a435 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -573,7 +573,7 @@ EAPI Eo_Op _eo_api_op_id_get(const void *api_func, Eina_Bool is_main_loop, const EAPI Eina_Bool _eo_call_resolve(const char *func_name, const Eo_Op op, Eo_Op_Call_Data *call, Eina_Bool is_main_loop, const char *file, int line); // start of eo_do barrier, gets the object pointer and ref it, put it on the stask - EAPI Eina_Bool _eo_do_start(const Eo *obj, const Eo_Class *cur_klass, Eina_Bool is_super, Eina_Bool is_main_loop, const char *file, const char *func, int line); + EAPI Eina_Bool _eo_do_start(const Eo *obj, const Eo_Class *cur_klass, Eina_Bool is_super, const char *file, const char *func, int line); // end of the eo_do barrier, unref the obj, move the stack pointer EAPI void _eo_do_end(const Eo **ojb); @@ -584,9 +584,8 @@ EAPI void _eo_do_end(const Eo **ojb); #define _eo_do_common(eoid, clsid, is_super, ...) \ ({ \ - Eina_Bool is_main_loop = eina_main_loop_is(); \ const Eo *_eoid_ EO_DO_CLEANUP = eoid; \ - _eo_do_start(_eoid_, clsid, is_super, is_main_loop, __FILE__, __FUNCTION__, __LINE__); \ + _eo_do_start(_eoid_, clsid, is_super, __FILE__, __FUNCTION__, __LINE__); \ __VA_ARGS__; \ }) diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index e04e2a2205..b6c6efa72e 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -504,8 +504,9 @@ _eo_do_internal(const Eo *eo_id, const Eo_Class *cur_klass_id, } EAPI Eina_Bool -_eo_do_start(const Eo *eo_id, const Eo_Class *cur_klass_id, Eina_Bool is_super, Eina_Bool is_main_loop, const char *file EINA_UNUSED, const char *func EINA_UNUSED, int line EINA_UNUSED) +_eo_do_start(const Eo *eo_id, const Eo_Class *cur_klass_id, Eina_Bool is_super, const char *file EINA_UNUSED, const char *func EINA_UNUSED, int line EINA_UNUSED) { + Eina_Bool is_main_loop = eina_main_loop_is(); Eina_Bool ret = EINA_TRUE; Eo_Stack_Frame *fptr, *pfptr; Eo_Call_Stack *stack = _eo_call_stack_get(is_main_loop);