compiler/libec; ecere; ide: (Emscripten WIP) Address virtual method issues
[sdk] / ecere / src / com / instance.ec
index 000ce63..6a9c24d 100644 (file)
@@ -4154,7 +4154,7 @@ public dllexport Method eClass_AddMethod(Class _class, const char * name, const
                if(method.vid >= _class.vTblSize)
                   printf("error: virtual methods overriding failure\n");
                else
-                  _class._vTbl[method.vid] = function ? function : (void *)DefaultFunction;
+                  _class._vTbl[method.vid] = function ? function : null; //(void *)DefaultFunction;
                for(deriv = _class.derivatives.first; deriv; deriv = deriv.next)
                {
                   Class derivClass = deriv.data;
@@ -4195,7 +4195,7 @@ public dllexport Method eClass_AddMethod(Class _class, const char * name, const
          Method method
          {
             name = CopyString(name),
-            function = function ? function : DefaultFunction;
+            function = function ? function : null; //DefaultFunction;
             _class = _class;
             dataTypeString = CopyString(type);
             memberAccess = declMode;
@@ -4223,7 +4223,7 @@ public dllexport Method eClass_AddVirtualMethod(Class _class, const char * name,
                if(method.vid >= _class.vTblSize)
                   printf("error: virtual methods overriding failure\n");
                else
-                  _class._vTbl[method.vid] = function ? function : (void *)DefaultFunction;
+                  _class._vTbl[method.vid] = function ? function : null; //(void *)DefaultFunction;
             }
             else
                base = null;
@@ -4236,7 +4236,7 @@ public dllexport Method eClass_AddVirtualMethod(Class _class, const char * name,
          Method method
          {
             name = CopyString(name);
-            function = function ? function : DefaultFunction;
+            function = function ? function : null; //DefaultFunction;
             type = virtualMethod;
             _class = _class;
             vid = _class.vTblSize++;
@@ -4245,11 +4245,11 @@ public dllexport Method eClass_AddVirtualMethod(Class _class, const char * name,
          };
          _class.methods.Add((BTNode)method);
          _class._vTbl = renew _class._vTbl void *[_class.vTblSize];
-         _class._vTbl[method.vid] = function ? function : (void *)DefaultFunction;
+         _class._vTbl[method.vid] = function ? function : null; //(void *)DefaultFunction;
 
          // TODO: Fix derived classes
          if(_class.derivatives.first || _class.templatized.first)
-            FixDerivativeVirtualMethod(_class, name, method.vid, function ? function : (void *)DefaultFunction, type);
+            FixDerivativeVirtualMethod(_class, name, method.vid, function ? function : null /*(void *)DefaultFunction*/, type);
          return method;
       }
    }
@@ -5103,7 +5103,7 @@ public dllexport void eInstance_SetMethod(Instance instance, const char * name,
                memcpy(instance._vTbl, instance._class._vTbl,
                   sizeof(int(*)()) * instance._class.vTblSize);
             }
-            instance._vTbl[method.vid] = function ? function : (void *)DefaultFunction;
+            instance._vTbl[method.vid] = function ? function : null; //(void *)DefaultFunction;
          }
       }
    }