Procházet zdrojové kódy

* patch by Pierre to fix warnings which prevent cross building

git-svn-id: trunk@38719 -
florian před 7 roky
rodič
revize
5dda0f5c74
1 změnil soubory, kde provedl 10 přidání a 2 odebrání
  1. 10 2
      compiler/optutils.pas

+ 10 - 2
compiler/optutils.pas

@@ -388,7 +388,15 @@ unit optutils;
               Result:=fen_norecurse_false;
             end;
           else
-            n.optinfo^.executionweight:=AWord(arg);
+{$push}
+{ The code below emits two warnings if ptruint and aword are the same type }
+{$warn 4044 off}
+{$warn 6018 off}
+            if ptruint(arg) > high(aword) then
+              n.optinfo^.executionweight:=high(AWord)
+            else
+              n.optinfo^.executionweight:=AWord(ptruint(arg));
+{$pop}
         end;
       end;
 
@@ -396,7 +404,7 @@ unit optutils;
     procedure CalcExecutionWeights(p : tnode;Initial : AWord = 100);
       begin
         if assigned(p) then
-          foreachnodestatic(pm_postprocess,p,@SetExecutionWeight,Pointer(Initial));
+          foreachnodestatic(pm_postprocess,p,@SetExecutionWeight,Pointer(ptruint(Initial)));
       end;