瀏覽代碼

* Fixed 'mixed signed/unsigned' warnings.
* Suppressed 2 unreachable code warnings.
* Now x86 compiler compiles without warnings and notes! It will be great to keep such state in future...

git-svn-id: trunk@11455 -

yury 17 年之前
父節點
當前提交
0bcaf8845f
共有 7 個文件被更改,包括 13 次插入9 次删除
  1. 1 1
      compiler/arm/aasmcpu.pas
  2. 2 0
      compiler/cfileutl.pas
  3. 3 3
      compiler/cutils.pas
  4. 2 0
      compiler/i386/cpupara.pas
  5. 2 2
      compiler/ogcoff.pas
  6. 1 1
      compiler/rgobj.pas
  7. 2 2
      compiler/x86/aasmcpu.pas

+ 1 - 1
compiler/arm/aasmcpu.pas

@@ -1508,7 +1508,7 @@ implementation
             top_const:
               begin
                 i_field:=1;
-                bytes:=bytes or (oper[op]^.val and $fff);
+                bytes:=bytes or dword(oper[op]^.val and $fff);
               end;
             top_reg:
               begin

+ 2 - 0
compiler/cfileutl.pas

@@ -983,10 +983,12 @@ implementation
         exit;
      { Support default macro's }
        DefaultReplacements(s);
+{$warnings off}
        if PathSeparator <> ';' then
         for i:=1 to length(s) do
          if s[i]=PathSeparator then
           s[i]:=';';
+{$warnings on}
      { get current dir }
        CurrentDir:=GetCurrentDir;
        repeat

+ 3 - 3
compiler/cutils.pas

@@ -1270,8 +1270,8 @@ implementation
 
     // Case x=NAN or y=NAN
 
-    if ( (ix>=$7ff00000) and (((ix-$7ff00000) or lx) <> 0) )
-        or ( (iy>=$7ff00000) and (((iy-$7ff00000) OR ly) <> 0) )
+    if ( (ix>=$7ff00000) and ((longword(ix-$7ff00000) or lx) <> 0) )
+        or ( (iy>=$7ff00000) and ((longword(iy-$7ff00000) OR ly) <> 0) )
     then exit(x+y);
 
     // Case x=y
@@ -1280,7 +1280,7 @@ implementation
 
     // Case x=0
 
-    if (ix or lx)=0
+    if (longword(ix) or lx)=0
     then begin
           twoword(x).hi:=hy and $80000000;  // return +-minimalSubnormal
           twoword(x).lo:=1;

+ 2 - 0
compiler/i386/cpupara.pas

@@ -664,10 +664,12 @@ unit cpupara;
           pocall_internproc :
             begin
               { Use default calling }
+{$warnings off}
               if (pocall_default=pocall_register) then
                 create_register_paraloc_info(p,side,p.paras,parareg,parasize)
               else
                 create_stdcall_paraloc_info(p,side,p.paras,parasize);
+{$warnings on}
             end;
           else
             create_stdcall_paraloc_info(p,side,p.paras,parasize);

+ 2 - 2
compiler/ogcoff.pas

@@ -2722,7 +2722,7 @@ const pemagic : array[0..3] of byte = (
             Comment(V_Error,'Invalid DLL '+dllname+', Dos Header invalid');
             exit;
           end;
-        newheaderofs:=longint(DosHeader[$3c]) or (DosHeader[$3d] shl 8) or (DosHeader[$3e] shl 16) or (DosHeader[$3f] shl 24);
+        newheaderofs:=cardinal(DosHeader[$3c]) or (DosHeader[$3d] shl 8) or (DosHeader[$3e] shl 16) or (DosHeader[$3f] shl 24);
         DLLReader.Seek(newheaderofs);
         if not DLLReader.Read(PEMagic,sizeof(PEMagic)) or
            (PEMagic[0]<>$50) or (PEMagic[1]<>$45) or (PEMagic[2]<>$00) or (PEMagic[3]<>$00) then
@@ -2765,7 +2765,7 @@ const pemagic : array[0..3] of byte = (
         DLLReader.Read(expdir,sizeof(expdir));
         for i:=0 to expdir.NumNames-1 do
           begin
-            DLLReader.Seek(sechdr.datapos+expdir.AddrNames-sechdr.rvaofs+i*4);
+            DLLReader.Seek(sechdr.datapos+longint(expdir.AddrNames)-sechdr.rvaofs+i*4);
             DLLReader.Read(NameOfs,4);
             Dec(NameOfs,sechdr.rvaofs);
             if (NameOfs<0) or

+ 1 - 1
compiler/rgobj.pas

@@ -269,7 +269,7 @@ unit rgobj;
           if header.count<2 then
             exit;
           p:=1;
-          while 2*p<header.count do
+          while 2*cardinal(p)<header.count do
             p:=2*p;
           while p<>0 do
             begin

+ 2 - 2
compiler/x86/aasmcpu.pas

@@ -1644,12 +1644,12 @@ implementation
            if (ir=NR_NO) and (br<>NR_ESP) then
             begin
               output.sib_present:=false;
-              output.modrm:=(md shl 6) or (rfield shl 3) or base;
+              output.modrm:=(longint(md) shl 6) or (rfield shl 3) or base;
             end
            else
             begin
               output.sib_present:=true;
-              output.modrm:=(md shl 6) or (rfield shl 3) or 4;
+              output.modrm:=(longint(md) shl 6) or (rfield shl 3) or 4;
               output.sib:=(scalefactor shl 6) or (index shl 3) or base;
             end;
          end;