瀏覽代碼

* fixed range check errors

Jonas Maebe 24 年之前
父節點
當前提交
6c6250c5b4
共有 7 個文件被更改,包括 41 次插入20 次删除
  1. 6 3
      rtl/win32/dos.pp
  2. 5 2
      rtl/win32/objinc.inc
  3. 5 2
      rtl/win32/system.pp
  4. 8 5
      rtl/win32/sysutils.pp
  5. 6 3
      rtl/win32/wininc/base.inc
  6. 6 3
      rtl/win32/wininc/struct.inc
  7. 5 2
      rtl/win32/winsock.pp

+ 6 - 3
rtl/win32/dos.pp

@@ -558,7 +558,7 @@ end;
 procedure FindMatch(var f:searchrec);
 procedure FindMatch(var f:searchrec);
 begin
 begin
 { Find file with correct attribute }
 { Find file with correct attribute }
-  While (F.W32FindData.dwFileAttributes and F.ExcludeAttr)<>0 do
+  While (F.W32FindData.dwFileAttributes and cardinal(F.ExcludeAttr))<>0 do
    begin
    begin
      if not FindNextFile (F.FindHandle,F.W32FindData) then
      if not FindNextFile (F.FindHandle,F.W32FindData) then
       begin
       begin
@@ -815,7 +815,7 @@ var
 begin
 begin
   doserror:=0;
   doserror:=0;
   l:=GetFileAttributes(filerec(f).name);
   l:=GetFileAttributes(filerec(f).name);
-  if l=$ffffffff then
+  if l=longint($ffffffff) then
    begin
    begin
      doserror:=getlasterror;
      doserror:=getlasterror;
      attr:=0;
      attr:=0;
@@ -1016,7 +1016,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  2000-09-06 20:47:34  peter
+  Revision 1.7  2000-12-18 17:28:58  jonas
+    * fixed range check errors
+
+  Revision 1.6  2000/09/06 20:47:34  peter
     * removed previous fsplit() patch as it's not the correct behaviour for
     * removed previous fsplit() patch as it's not the correct behaviour for
       LFNs. The code showing the bug could easily be adapted (merged)
       LFNs. The code showing the bug could easily be adapted (merged)
 
 

+ 5 - 2
rtl/win32/objinc.inc

@@ -19,7 +19,7 @@
 CONST
 CONST
    { REQUIRED TO PUT MANUALLY here, because of name conflicts in win32.inc }
    { REQUIRED TO PUT MANUALLY here, because of name conflicts in win32.inc }
    { flags for CreateFile }
    { flags for CreateFile }
-   GENERIC_READ=$80000000;
+   GENERIC_READ=longint($80000000);
    GENERIC_WRITE=$40000000;
    GENERIC_WRITE=$40000000;
    CREATE_NEW = 1;
    CREATE_NEW = 1;
    CREATE_ALWAYS = 2;
    CREATE_ALWAYS = 2;
@@ -184,7 +184,10 @@ END;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:33:57  michael
+  Revision 1.3  2000-12-18 17:28:58  jonas
+    * fixed range check errors
+
+  Revision 1.2  2000/07/13 11:33:57  michael
   + removed logs
   + removed logs
  
  
 }
 }

+ 5 - 2
rtl/win32/system.pp

@@ -1171,7 +1171,7 @@ begin
         if IsConsole then Writeln(stderr,'Exception  ',
         if IsConsole then Writeln(stderr,'Exception  ',
                 hexstr(excep^.ExceptionRecord^.ExceptionCode, 8));
                 hexstr(excep^.ExceptionRecord^.ExceptionCode, 8));
 {$endif SYSTEMEXCEPTIONDEBUG}
 {$endif SYSTEMEXCEPTIONDEBUG}
-        case excep^.ExceptionRecord^.ExceptionCode of
+        case cardinal(excep^.ExceptionRecord^.ExceptionCode) of
                 STATUS_INTEGER_DIVIDE_BY_ZERO,
                 STATUS_INTEGER_DIVIDE_BY_ZERO,
                 STATUS_FLOAT_DIVIDE_BY_ZERO :
                 STATUS_FLOAT_DIVIDE_BY_ZERO :
                         res := SysHandleErrorFrame(200, frame, true);
                         res := SysHandleErrorFrame(200, frame, true);
@@ -1380,7 +1380,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2000-10-15 08:19:49  peter
+  Revision 1.2  2000-12-18 17:28:58  jonas
+    * fixed range check errors
+
+  Revision 1.1  2000/10/15 08:19:49  peter
     * system unit rename for 1.1 branch
     * system unit rename for 1.1 branch
 
 
   Revision 1.6  2000/10/13 12:01:52  peter
   Revision 1.6  2000/10/13 12:01:52  peter

+ 8 - 5
rtl/win32/sysutils.pp

@@ -42,7 +42,7 @@ implementation
 
 
 Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
 Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
 const
 const
-  AccessMode: array[0..2] of Integer = (
+  AccessMode: array[0..2] of Cardinal  = (
     GENERIC_READ,
     GENERIC_READ,
     GENERIC_WRITE,
     GENERIC_WRITE,
     GENERIC_READ or GENERIC_WRITE);
     GENERIC_READ or GENERIC_WRITE);
@@ -94,7 +94,7 @@ end;
 
 
 Function FileSeek (Handle,FOffset,Origin : Longint) : Longint;
 Function FileSeek (Handle,FOffset,Origin : Longint) : Longint;
 begin
 begin
-  Result := SetFilePointer(Handle, FOffset, nil, Origin);
+  Result := longint(SetFilePointer(Handle, FOffset, nil, Origin));
 end;
 end;
 
 
 
 
@@ -108,7 +108,7 @@ end;
 
 
 Function FileTruncate (Handle,Size: Longint) : boolean;
 Function FileTruncate (Handle,Size: Longint) : boolean;
 begin
 begin
-  Result:=SetFilePointer(handle,Size,nil,FILE_BEGIN)<>-1;
+  Result:=longint(SetFilePointer(handle,Size,nil,FILE_BEGIN))<>-1;
   If Result then
   If Result then
     Result:=SetEndOfFile(handle);
     Result:=SetEndOfFile(handle);
 end;
 end;
@@ -163,7 +163,7 @@ end;
 Function FindMatch(var f: TSearchRec) : Longint;
 Function FindMatch(var f: TSearchRec) : Longint;
 begin
 begin
   { Find file with correct attribute }
   { Find file with correct attribute }
-  While (F.FindData.dwFileAttributes and F.ExcludeAttr)<>0 do
+  While (F.FindData.dwFileAttributes and cardinal(F.ExcludeAttr))<>0 do
    begin
    begin
      if not FindNextFile (F.FindHandle,@F.FindData) then
      if not FindNextFile (F.FindHandle,@F.FindData) then
       begin
       begin
@@ -643,7 +643,10 @@ Finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2000-09-19 23:57:57  pierre
+  Revision 1.5  2000-12-18 17:28:58  jonas
+    * fixed range check errors
+
+  Revision 1.4  2000/09/19 23:57:57  pierre
    * bug fix for 1041 (merged)
    * bug fix for 1041 (merged)
 
 
   Revision 1.3  2000/08/29 18:01:52  michael
   Revision 1.3  2000/08/29 18:01:52  michael

+ 6 - 3
rtl/win32/wininc/base.inc

@@ -711,7 +711,7 @@ type
   { argument types are unknown }
   { argument types are unknown }
   function RGB(r,g,b : longint) : DWORD;
   function RGB(r,g,b : longint) : DWORD;
     begin
     begin
-       RGB:=DWORD(((BYTE(r)) or ((WORD(g)) shl 8)) or ((DWORD(BYTE(b))) shl 16));
+       RGB:=DWORD(((DWORD(BYTE(r))) or ((DWORD(WORD(g))) shl 8)) or ((DWORD(BYTE(b))) shl 16));
     end;
     end;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
@@ -879,7 +879,7 @@ type
   { argument types are unknown }
   { argument types are unknown }
   function MAKEROP4(fore,back : longint) : DWORD;
   function MAKEROP4(fore,back : longint) : DWORD;
     begin
     begin
-       MAKEROP4:=DWORD(((back shl 8) and $FF000000) or fore);
+       MAKEROP4:=DWORD((DWORD(back shl 8) and $FF000000) or DWORD(fore));
     end;
     end;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
@@ -941,7 +941,10 @@ type
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2000-10-11 16:05:56  peter
+  Revision 1.5  2000-12-18 17:28:58  jonas
+    * fixed range check errors
+
+  Revision 1.4  2000/10/11 16:05:56  peter
     * stdcall for callbacks (merged)
     * stdcall for callbacks (merged)
 
 
   Revision 1.3  2000/08/16 18:35:19  peter
   Revision 1.3  2000/08/16 18:35:19  peter

+ 6 - 3
rtl/win32/wininc/struct.inc

@@ -745,7 +745,7 @@
      DCB = record
      DCB = record
           DCBlength : DWORD;
           DCBlength : DWORD;
           BaudRate : DWORD;
           BaudRate : DWORD;
-          flag0 : longint;
+          flag0 : DWORD;
           wReserved : WORD;
           wReserved : WORD;
           XonLim : WORD;
           XonLim : WORD;
           XoffLim : WORD;
           XoffLim : WORD;
@@ -908,7 +908,7 @@
      PCOMPOSITIONFORM = ^COMPOSITIONFORM;
      PCOMPOSITIONFORM = ^COMPOSITIONFORM;
 
 
      COMSTAT = record
      COMSTAT = record
-          flag0 : longint;
+          flag0 : DWORD;
           cbInQue : DWORD;
           cbInQue : DWORD;
           cbOutQue : DWORD;
           cbOutQue : DWORD;
        end;
        end;
@@ -6961,7 +6961,10 @@ type
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2000-11-21 08:49:14  jonas
+  Revision 1.5  2000-12-18 17:28:58  jonas
+    * fixed range check errors
+
+  Revision 1.4  2000/11/21 08:49:14  jonas
     * workaround for the "hicon: hicon" bug (merged from fixes branch)
     * workaround for the "hicon: hicon" bug (merged from fixes branch)
 
 
   Revision 1.3  2000/10/11 16:05:56  peter
   Revision 1.3  2000/10/11 16:05:56  peter

+ 5 - 2
rtl/win32/winsock.pp

@@ -304,7 +304,7 @@ unit winsock;
     }
     }
     const
     const
        INVALID_SOCKET = not(1);
        INVALID_SOCKET = not(1);
-       SOCKET_ERROR = -1;
+       SOCKET_ERROR = $ffffffff;
        SOCK_STREAM = 1;
        SOCK_STREAM = 1;
        SOCK_DGRAM = 2;
        SOCK_DGRAM = 2;
        SOCK_RAW = 3;
        SOCK_RAW = 3;
@@ -951,7 +951,10 @@ unit winsock;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:33:58  michael
+  Revision 1.3  2000-12-18 17:28:58  jonas
+    * fixed range check errors
+
+  Revision 1.2  2000/07/13 11:33:58  michael
   + removed logs
   + removed logs
  
  
 }
 }