From 10626ff5388424c9be0aff04fbbc5a5b73cd210f Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 2 Jun 2014 13:09:21 +0100 Subject: [PATCH] Eo: Fix and use the abstract class .eo file. Until now it was just there, but never generated or used. --- src/Makefile_Eo.am | 7 +++++++ src/lib/eo/Eo.h | 11 +---------- src/lib/eo/eo.c | 4 ++-- src/lib/eo/eo_abstract_class.eo | 1 + src/lib/eo/eo_class_class.c | 12 +----------- src/tests/eo/suite/eo_test_general.c | 2 +- 6 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/Makefile_Eo.am b/src/Makefile_Eo.am index cd5e6b6a69..ca0c4446ef 100644 --- a/src/Makefile_Eo.am +++ b/src/Makefile_Eo.am @@ -1,11 +1,18 @@ ### Library +BUILT_SOURCES += \ + lib/eo/eo_abstract_class.eo.c \ + lib/eo/eo_abstract_class.eo.h + lib_LTLIBRARIES += lib/eo/libeo.la installed_eomainheadersdir = $(includedir)/eo-@VMAJ@ dist_installed_eomainheaders_DATA = lib/eo/Eo.h +nodist_installed_eomainheaders_DATA = \ + lib/eo/eo_abstract_class.eo.h + lib_eo_libeo_la_SOURCES = \ lib/eo/eo.c \ lib/eo/eo_ptr_indirection.c \ diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 5d92687c46..23150a602d 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -913,16 +913,7 @@ EAPI Eina_Bool eo_composite_is(const Eo *comp_obj); * @{ */ -/** - * @def EO_CLASS_CLASS - * The class type for the Eo Class class. - */ -#define EO_CLASS_CLASS eo_class_class_get() -/** - * @brief Use #EO_CLASS_CLASS - * @internal - * */ -EAPI const Eo_Class *eo_class_class_get(void); +#include "eo_abstract_class.eo.h" /** * @} diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 9b8d6d7e10..8a14021eed 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -979,7 +979,7 @@ eo_class_get(const Eo *eo_id) if (_eo_is_a_class(eo_id)) { EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, NULL); - return eo_class_class_get(); + return EO_ABSTRACT_CLASS_CLASS; } EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, NULL); @@ -1802,7 +1802,7 @@ eo_init(void) EINA_LOG_STATE_INIT); /* bootstrap EO_CLASS_CLASS */ - (void) eo_class_class_get(); + (void) EO_ABSTRACT_CLASS_CLASS; if (_eo_call_stack_key != 0) WRN("_eo_call_stack_key already set, this should not happen."); diff --git a/src/lib/eo/eo_abstract_class.eo b/src/lib/eo/eo_abstract_class.eo index 82ab90574f..27a52e394a 100644 --- a/src/lib/eo/eo_abstract_class.eo +++ b/src/lib/eo/eo_abstract_class.eo @@ -1,3 +1,4 @@ abstract Eo_Abstract_Class () { + data: null; } diff --git a/src/lib/eo/eo_class_class.c b/src/lib/eo/eo_class_class.c index 43c2ffeb8f..d356755a97 100644 --- a/src/lib/eo/eo_class_class.c +++ b/src/lib/eo/eo_class_class.c @@ -4,15 +4,5 @@ #include "Eo.h" -static const Eo_Class_Description class_desc = { - EO_VERSION, - "Eo_Abstract_Class", - EO_CLASS_TYPE_REGULAR_NO_INSTANT, - EO_CLASS_DESCRIPTION_NOOPS(), - NULL, - 0, - NULL, - NULL -}; +#include "eo_abstract_class.eo.c" -EO_DEFINE_CLASS(eo_class_class_get, &class_desc, NULL, NULL) diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c index c4e0725519..78561e8513 100644 --- a/src/tests/eo/suite/eo_test_general.c +++ b/src/tests/eo/suite/eo_test_general.c @@ -641,7 +641,7 @@ START_TEST(eo_magic_checks) fail_if(eo_class_get((Eo *) buf)); fail_if(eo_class_name_get((Eo_Class*) buf)); fail_if(eo_class_get(obj) != SIMPLE_CLASS); - fail_if(eo_class_get(SIMPLE_CLASS) != EO_CLASS_CLASS); + fail_if(eo_class_get(SIMPLE_CLASS) != EO_ABSTRACT_CLASS_CLASS); eo_do((Eo_Class *) buf,(void) NULL); eo_do_super((Eo_Class *) buf, SIMPLE_CLASS, simple_a_set(++i)); eo_do_super(SIMPLE_CLASS, (Eo_Class *) buf, simple_a_set(++i));