From 0cf8aa8bd64799afb2092c6507c3f7532e3fe25f Mon Sep 17 00:00:00 2001 From: tasn Date: Tue, 17 Apr 2012 10:27:37 +0000 Subject: [PATCH] Eobj: Fixed inheritance checks and fixed mixin examples accordingly. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@70263 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- examples/constructors/mixin.c | 2 +- examples/mixin/mixin.c | 2 +- lib/eobj.c | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/constructors/mixin.c b/examples/constructors/mixin.c index 7f5595c..c050c3a 100644 --- a/examples/constructors/mixin.c +++ b/examples/constructors/mixin.c @@ -68,5 +68,5 @@ mixin_class_get(void) NULL }; - return _my_class = eobj_class_new(&class_desc, EOBJ_CLASS_BASE, NULL); + return _my_class = eobj_class_new(&class_desc, NULL, NULL); } diff --git a/examples/mixin/mixin.c b/examples/mixin/mixin.c index 807f21f..a372709 100644 --- a/examples/mixin/mixin.c +++ b/examples/mixin/mixin.c @@ -62,7 +62,7 @@ mixin_class_get(void) NULL }; - _my_class = eobj_class_new(&class_desc, EOBJ_CLASS_BASE, NULL); + _my_class = eobj_class_new(&class_desc, NULL, NULL); return _my_class; } diff --git a/lib/eobj.c b/lib/eobj.c index 1b3066c..a66e488 100644 --- a/lib/eobj.c +++ b/lib/eobj.c @@ -683,17 +683,15 @@ eobj_class_new(const Eobj_Class_Description *desc, const Eobj_Class *parent, ... if ((klass->parent->desc->type != EOBJ_CLASS_TYPE_REGULAR) && (klass->parent->desc->type != EOBJ_CLASS_TYPE_REGULAR_NO_INSTANT)) { - /* FIXME: Actually handle it. */ ERR("Regular classes ('%s') aren't allowed to inherit from non-regular classes ('%s').", klass->desc->name, klass->parent->desc->name); goto cleanup; } break; case EOBJ_CLASS_TYPE_INTERFACE: case EOBJ_CLASS_TYPE_MIXIN: - if ((klass->parent->desc->type != EOBJ_CLASS_TYPE_REGULAR) && - (klass->parent->desc->type != EOBJ_CLASS_TYPE_REGULAR_NO_INSTANT)) + if ((klass->parent->desc->type != EOBJ_CLASS_TYPE_INTERFACE) && + (klass->parent->desc->type != EOBJ_CLASS_TYPE_MIXIN)) { - /* FIXME: Actually handle it. */ ERR("Non-regular classes ('%s') aren't allowed to inherit from regular classes ('%s').", klass->desc->name, klass->parent->desc->name); goto cleanup; } -- 2.7.4