Browse Source

* fixed several compare problems between longints and
const > $80000000 that are treated as int64 constanst
by Delphi reported by Kovacs Attila Zoltan

pierre 25 năm trước cách đây
mục cha
commit
fddd96280d

+ 10 - 5
compiler/cg386inl.pas

@@ -124,11 +124,11 @@ implementation
                  If (cs_check_range in aktlocalswitches) and
                     {no need to rangecheck longints or cardinals on 32bit processors}
                     not((porddef(dest^.resulttype)^.typ = s32bit) and
-                        (porddef(dest^.resulttype)^.low = $80000000) and
+                        (porddef(dest^.resulttype)^.low = longint($80000000)) and
                         (porddef(dest^.resulttype)^.high = $7fffffff)) and
                     not((porddef(dest^.resulttype)^.typ = u32bit) and
                         (porddef(dest^.resulttype)^.low = 0) and
-                        (porddef(dest^.resulttype)^.high = $ffffffff)) then
+                        (porddef(dest^.resulttype)^.high = longint($ffffffff))) then
                   Begin
                     {do not register this temporary def}
                     OldRegisterDef := RegisterDef;
@@ -864,11 +864,11 @@ implementation
              for that)}
             {no need to rangecheck longints or cardinals on 32bit processors}
                not((porddef(dest_para^.left^.resulttype)^.typ = s32bit) and
-                   (porddef(dest_para^.left^.resulttype)^.low = $80000000) and
+                   (porddef(dest_para^.left^.resulttype)^.low = longint($80000000)) and
                    (porddef(dest_para^.left^.resulttype)^.high = $7fffffff)) and
                not((porddef(dest_para^.left^.resulttype)^.typ = u32bit) and
                    (porddef(dest_para^.left^.resulttype)^.low = 0) and
-                   (porddef(dest_para^.left^.resulttype)^.high = $ffffffff)) then
+                   (porddef(dest_para^.left^.resulttype)^.high = longint($ffffffff))) then
              Begin
                hp := getcopy(dest_para^.left);
                hp^.location.loc := LOC_REGISTER;
@@ -1528,7 +1528,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.100  2000-04-14 12:33:40  pierre
+  Revision 1.101  2000-05-11 09:56:20  pierre
+    * fixed several compare problems between longints and
+      const > $80000000 that are treated as int64 constanst
+      by Delphi reported by Kovacs Attila Zoltan
+
+  Revision 1.100  2000/04/14 12:33:40  pierre
    * better inlined real sqr function
 
   Revision 1.99  2000/04/04 21:41:56  pierre

+ 7 - 3
compiler/cg386set.pas

@@ -817,7 +817,7 @@ implementation
               if (min_label<0) and (max_label>0) then
                 begin
 {$ifdef Delphi}
-                   if min_label=$80000000 then
+                   if min_label=longint($80000000) then
                      dist:=Cardinal(max_label)+Cardinal($80000000)
                    else
                      dist:=Cardinal(max_label)+Cardinal(-min_label)
@@ -904,7 +904,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.49  2000-03-26 11:33:49  jonas
+  Revision 1.50  2000-05-11 09:56:20  pierre
+    * fixed several compare problems between longints and
+      const > $80000000 that are treated as int64 constanst
+      by Delphi reported by Kovacs Attila Zoltan
+
+  Revision 1.49  2000/03/26 11:33:49  jonas
     * release the register used to hold the value of the case variable
       at the end of the case
 
@@ -958,4 +963,3 @@ end.
     * some other type/const renamings
 
 }
-

+ 8 - 11
compiler/cobjects.pas

@@ -539,19 +539,11 @@ end;
 *****************************************************************************}
 
 var
-{$ifdef Delphi}
-  Crc32Tbl : array[0..255] of longword;
-{$else Delphi}
   Crc32Tbl : array[0..255] of longint;
-{$endif Delphi}
 
 procedure MakeCRC32Tbl;
 var
-{$ifdef Delphi}
-  crc : longword;
-{$else Delphi}
   crc : longint;
-{$endif Delphi}
   i,n : byte;
 begin
   for i:=0 to 255 do
@@ -559,7 +551,7 @@ begin
      crc:=i;
      for n:=1 to 8 do
       if odd(crc) then
-       crc:=(crc shr 1) xor $edb88320
+       crc:=(crc shr 1) xor longint($edb88320)
       else
        crc:=crc shr 1;
      Crc32Tbl[i]:=crc;
@@ -580,7 +572,7 @@ begin
   if Crc32Tbl[1]=0 then
    MakeCrc32Tbl;
   InitCrc:=$ffffffff;
-  for i:=1to Length(s) do
+  for i:=1 to Length(s) do
    InitCrc:=Crc32Tbl[byte(InitCrc) xor ord(s[i])] xor (InitCrc shr 8);
   GetSpeedValue:=InitCrc;
 end;
@@ -2401,7 +2393,12 @@ end;
 end.
 {
   $Log$
-  Revision 1.53  2000-05-11 09:29:01  pierre
+  Revision 1.54  2000-05-11 09:56:20  pierre
+    * fixed several compare problems between longints and
+      const > $80000000 that are treated as int64 constanst
+      by Delphi reported by Kovacs Attila Zoltan
+
+  Revision 1.53  2000/05/11 09:29:01  pierre
    * disbal all code using MemAvail for Delphi reported by Kovacs Attila Zoltan
 
   Revision 1.52  2000/02/09 13:22:50  peter

+ 10 - 5
compiler/dmisc.pas

@@ -500,7 +500,7 @@ begin
   StringToPchar(f.name);
 { FindFirstFile is a Win32 Call. }
   F.FindHandle:=FindFirstFile (pchar(@f.Name),F.W32FindData);
-  If longint(F.FindHandle)=Invalid_Handle_value then
+  If longint(F.FindHandle)=longint(Invalid_Handle_value) then
    begin
      DosError:=Last2DosError(GetLastError);
      exit;
@@ -531,7 +531,7 @@ end;
 
 Procedure FindClose(Var f: SearchRec);
 begin
-  If longint(F.FindHandle)<>Invalid_Handle_value then
+  If longint(F.FindHandle)<>longint(Invalid_Handle_value) then
    FindCloseFile(F.FindHandle);
 end;
 
@@ -736,7 +736,7 @@ var
    l : longint;
 begin
   l:=GetFileAttributes(filerec(f).name);
-  if l=$ffffffff then
+  if l=longint($ffffffff) then
    doserror:=getlasterror;
   attr:=l;
 end;
@@ -854,10 +854,15 @@ End;
 end.
 {
   $Log$
-  Revision 1.7  2000-02-09 13:22:52  peter
+  Revision 1.8  2000-05-11 09:56:20  pierre
+    * fixed several compare problems between longints and
+      const > $80000000 that are treated as int64 constanst
+      by Delphi reported by Kovacs Attila Zoltan
+
+  Revision 1.7  2000/02/09 13:22:52  peter
     * log truncated
 
   Revision 1.6  2000/01/07 01:14:23  peter
     * updated copyright to 2000
 
-}
+}

+ 7 - 2
compiler/ra386att.pas

@@ -1604,7 +1604,7 @@ Begin
           BuildConstSymbolExpression(false,false,false,value,asmsym);
           if asmsym<>'' then
            begin
-             if maxvalue<>$ffffffff then
+             if maxvalue<>longint($ffffffff) then
               Message(asmr_w_32bit_const_for_address);
              ConcatConstSymbol(curlist,asmsym,value)
            end
@@ -1995,7 +1995,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.76  2000-05-09 11:56:25  pierre
+  Revision 1.77  2000-05-11 09:56:21  pierre
+    * fixed several compare problems between longints and
+      const > $80000000 that are treated as int64 constanst
+      by Delphi reported by Kovacs Attila Zoltan
+
+  Revision 1.76  2000/05/09 11:56:25  pierre
    * Issue an error if opcode is not found
 
   Revision 1.75  2000/05/08 13:23:03  peter

+ 9 - 4
compiler/ra386int.pas

@@ -1647,7 +1647,7 @@ Begin
           if maxvalue = $ffff then
             strlength:=2
           else
-            if maxvalue = $ffffffff then
+            if maxvalue = longint($ffffffff) then
               strlength:=4;
           { DD and DW cases }
           if strlength <> 0 then
@@ -1677,7 +1677,7 @@ Begin
           BuildConstSymbolExpression(false,false,value,asmsym);
           if asmsym<>'' then
            begin
-             if maxvalue<>$ffffffff then
+             if maxvalue<>longint($ffffffff) then
                Message(asmr_w_const32bit_for_address);
              ConcatConstSymbol(curlist,asmsym,value)
            end
@@ -1826,7 +1826,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.66  2000-05-09 11:56:26  pierre
+  Revision 1.67  2000-05-11 09:56:21  pierre
+    * fixed several compare problems between longints and
+      const > $80000000 that are treated as int64 constanst
+      by Delphi reported by Kovacs Attila Zoltan
+
+  Revision 1.66  2000/05/09 11:56:26  pierre
    * Issue an error if opcode is not found
 
   Revision 1.65  2000/05/08 13:23:04  peter
@@ -1925,4 +1930,4 @@ end.
     * string constants are now handle correctly and also allowed in
       constant expressions
 
-}
+}

+ 9 - 4
compiler/rautils.pas

@@ -1404,7 +1404,7 @@ Procedure ConcatConstant(p: paasmoutput; value: longint; maxvalue: longint);
 {                  $ffffffff -> create a dword node.                  }
 {*********************************************************************}
 Begin
-  if (maxvalue <> $ffffffff) and (value > maxvalue) then
+  if (maxvalue <> longint($ffffffff)) and (value > maxvalue) then
    Begin
      Message(asmr_e_constant_out_of_bounds);
      { assuming a value of maxvalue }
@@ -1416,7 +1416,7 @@ Begin
    if maxvalue = $ffff then
     p^.concat(new(pai_const,init_16bit(word(value))))
   else
-   if maxvalue = $ffffffff then
+   if maxvalue = longint($ffffffff) then
     p^.concat(new(pai_const,init_32bit(longint(value))));
 end;
 
@@ -1512,7 +1512,12 @@ end;
 end.
 {
   $Log$
-  Revision 1.41  2000-05-08 13:23:05  peter
+  Revision 1.42  2000-05-11 09:56:22  pierre
+    * fixed several compare problems between longints and
+      const > $80000000 that are treated as int64 constanst
+      by Delphi reported by Kovacs Attila Zoltan
+
+  Revision 1.41  2000/05/08 13:23:05  peter
     * fixed reference parsing
 
   Revision 1.40  2000/04/06 07:56:04  pierre
@@ -1588,4 +1593,4 @@ end.
   Revision 1.20  1999/07/29 20:54:06  peter
     * write .size also
 
-}
+}