瀏覽代碼

* fixed parameter order of self and result to be COM compatible

git-svn-id: trunk@3391 -
florian 19 年之前
父節點
當前提交
23af245ba2
共有 2 個文件被更改,包括 8 次插入21 次删除
  1. 6 17
      compiler/pdecsub.pas
  2. 2 4
      compiler/symconst.pas

+ 6 - 17
compiler/pdecsub.pas

@@ -100,16 +100,11 @@ implementation
            if pd.deftype=procdef then
             akttokenpos:=tprocdef(pd).fileinfo;
 
-           if is_interfacecom(tprocdef(pd)._class) then
-             paranr:=paranr_result_com
+           { For left to right add it at the end to be delphi compatible }
+           if pd.proccalloption in pushleftright_pocalls then
+             paranr:=paranr_result_leftright
            else
-             begin
-               { For left to right add it at the end to be delphi compatible }
-               if pd.proccalloption in pushleftright_pocalls then
-                 paranr:=paranr_result_leftright
-               else
-                 paranr:=paranr_result;
-             end;
+             paranr:=paranr_result;
            { Generate result variable accessing function result }
            vs:=tparavarsym.create('$result',paranr,vs_var,pd.rettype,[vo_is_funcret,vo_is_hidden_para]);
            pd.parast.insert(vs);
@@ -157,10 +152,7 @@ implementation
           begin
             { Generate self variable }
             tt:=voidpointertype;
-            if is_interfacecom(tprocdef(pd)._class) then
-              vs:=tparavarsym.create('$self',paranr_self_com,vs_value,tt,[vo_is_self,vo_is_hidden_para])
-            else
-              vs:=tparavarsym.create('$self',paranr_self,vs_value,tt,[vo_is_self,vo_is_hidden_para]);
+            vs:=tparavarsym.create('$self',paranr_self,vs_value,tt,[vo_is_self,vo_is_hidden_para]);
             pd.parast.insert(vs);
           end
         else
@@ -198,10 +190,7 @@ implementation
                       vsp:=vs_var;
                     tt.setdef(tprocdef(pd)._class);
                   end;
-                if is_interfacecom(tprocdef(pd)._class) then
-                  vs:=tparavarsym.create('$self',paranr_self_com,vsp,tt,[vo_is_self,vo_is_hidden_para])
-                else
-                  vs:=tparavarsym.create('$self',paranr_self,vsp,tt,[vo_is_self,vo_is_hidden_para]);
+                vs:=tparavarsym.create('$self',paranr_self,vsp,tt,[vo_is_self,vo_is_hidden_para]);
                 pd.parast.insert(vs);
 
                 akttokenpos:=storepos;

+ 2 - 4
compiler/symconst.pas

@@ -95,10 +95,8 @@ const
     and will increase with 10 for each parameter. The high parameters
     will be inserted with n+1 }
   paranr_parentfp = 1;
-  paranr_result = 2;
-  paranr_result_com = 3;
-  paranr_self = 3;
-  paranr_self_com = 2;
+  paranr_self = 2;
+  paranr_result = 3;
   paranr_vmt = 4;
   { Required to support variations of syscalls on MorphOS }
   paranr_syscall_basesysv = 9;