diff options
author | Tom Hacohen <tom@stosb.com> | 2013-07-30 14:12:03 +0100 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2013-07-30 14:13:21 +0100 |
commit | cf4f3e533690f0e535c3ad042cfcdd8027f53dac (patch) | |
tree | 434ac273b4b8d444d1777e405e9cb0ec7e710cf7 | |
parent | 712c21ef8b6504a4079dfcbc12b3c9d4b0ed6ad9 (diff) | |
download | efl-cf4f3e533690f0e535c3ad042cfcdd8027f53dac.tar.gz |
Revert "eo2_add accepts non-defauld constructors"
We want to have normal functions as non-default constructors, not va_arg
ones. What we should do is split the object creation to two parts again.
The creation, the constructing (changes using the macro) and the
verification/end part that checks the constructor has been called.
This reverts commit 2ff2ce1894f173b306a896bda595e1a7768c074d.
-rw-r--r-- | src/lib/eo/Eo.h | 2 | ||||
-rw-r--r-- | src/lib/eo/eo.c | 19 | ||||
-rw-r--r-- | src/lib/eo/eo_private.h | 1 |
3 files changed, 3 insertions, 19 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 10a3e4ec5e..ede7ce8635 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -919,7 +919,7 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); #define eo2_add(klass, parent, ...) \ ({ \ const Eo_Class *_tmp_klass = klass; \ - eo_add_internal(__FILE__, __LINE__, _tmp_klass, parent, eo2_constructor, ## __VA_ARGS__, EO_NOOP); \ + eo_add_internal(__FILE__, __LINE__, _tmp_klass, parent, ## __VA_ARGS__, EO_NOOP); \ }) /** diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 334218eaac..4bca8b7b5a 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -1464,24 +1464,9 @@ eo_add_internal(const char *file, int line, const Eo_Class *klass_id, Eo *parent _eo_ref(obj); - /* Run the relevant do stuff. */ if (klass->desc->version == EO2_VERSION) - { - eo2_constructor_type constr; - va_list p_list; - if(eo2_do_start((Eo *)obj_id, EINA_FALSE)) - { - va_start(p_list, parent_id); - while ((constr = va_arg(p_list, eo2_constructor_type))) - constr(); - va_end(p_list); - eo2_do_end(NULL); - do_err = EINA_FALSE; - } - else - do_err = EINA_TRUE; - } - else + eo2_do((Eo *)obj_id, eo2_constructor()); + /* Run the relevant do stuff. */ { va_list p_list; va_start(p_list, parent_id); diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h index 624e429b68..85a130c1ff 100644 --- a/src/lib/eo/eo_private.h +++ b/src/lib/eo/eo_private.h @@ -57,7 +57,6 @@ extern int _eo_log_dom; typedef size_t Eo_Id; typedef struct _Eo_Class _Eo_Class; typedef struct _Eo_Internal _Eo; -typedef void (*eo2_constructor_type)(void); /* Retrieves the pointer to the object from the id */ static inline _Eo *_eo_obj_pointer_get(const Eo_Id obj_id); |