Prechádzať zdrojové kódy

* replaced custom packed record with tmethod

git-svn-id: trunk@45465 -
Jonas Maebe 5 rokov pred
rodič
commit
5be84e8079
1 zmenil súbory, kde vykonal 11 pridanie a 20 odobranie
  1. 11 20
      compiler/ncnv.pas

+ 11 - 20
compiler/ncnv.pas

@@ -2393,17 +2393,14 @@ implementation
       type
       type
          tprocedureofobject = function : tnode of object;
          tprocedureofobject = function : tnode of object;
       var
       var
-         r : packed record
-                proc : pointer;
-                obj : pointer;
-             end;
+         r : TMethod;
       begin
       begin
          result:=nil;
          result:=nil;
          { this is a little bit dirty but it works }
          { this is a little bit dirty but it works }
          { and should be quite portable too        }
          { and should be quite portable too        }
-         r.proc:=resultdefconvert[c];
-         r.obj:=self;
-         if assigned(r.proc) then
+         r.Code:=resultdefconvert[c];
+         r.Data:=self;
+         if assigned(r.Code) then
           result:=tprocedureofobject(r)();
           result:=tprocedureofobject(r)();
       end;
       end;
 
 
@@ -3981,16 +3978,13 @@ implementation
       type
       type
          tprocedureofobject = function : tnode of object;
          tprocedureofobject = function : tnode of object;
       var
       var
-         r : packed record
-                proc : pointer;
-                obj : pointer;
-             end;
+         r : TMethod;
       begin
       begin
          { this is a little bit dirty but it works }
          { this is a little bit dirty but it works }
          { and should be quite portable too        }
          { and should be quite portable too        }
-         r.proc:=firstconvert[c];
-         r.obj:=self;
-         if not assigned(r.proc) then
+         r.Code:=firstconvert[c];
+         r.Data:=self;
+         if not assigned(r.Code) then
            internalerror(200312081);
            internalerror(200312081);
          first_call_helper:=tprocedureofobject(r)()
          first_call_helper:=tprocedureofobject(r)()
       end;
       end;
@@ -4262,16 +4256,13 @@ implementation
          tprocedureofobject = procedure of object;
          tprocedureofobject = procedure of object;
 
 
       var
       var
-         r : packed record
-                proc : pointer;
-                obj : pointer;
-             end;
+         r : TMethod;
 
 
       begin
       begin
          { this is a little bit dirty but it works }
          { this is a little bit dirty but it works }
          { and should be quite portable too        }
          { and should be quite portable too        }
-         r.proc:=secondconvert[c];
-         r.obj:=self;
+         r.Code:=secondconvert[c];
+         r.Data:=self;
          tprocedureofobject(r)();
          tprocedureofobject(r)();
       end;
       end;