Eobj: Fixed inheritance checks and fixed mixin examples accordingly.
authortasn <tasn>
Tue, 17 Apr 2012 10:27:37 +0000 (10:27 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 17 Apr 2012 10:27:37 +0000 (10:27 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@70263 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

examples/constructors/mixin.c
examples/mixin/mixin.c
lib/eobj.c

index 7f5595c..c050c3a 100644 (file)
@@ -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);
 }
index 807f21f..a372709 100644 (file)
@@ -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;
 }
index 1b3066c..a66e488 100644 (file)
@@ -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;
                 }