Browse Source

* stricter compiler fixes

peter 24 years ago
parent
commit
81beaa227e
3 changed files with 31 additions and 19 deletions
  1. 6 3
      rtl/win32/graph.pp
  2. 11 7
      rtl/win32/objinc.inc
  3. 14 9
      rtl/win32/sysutils.pp

+ 6 - 3
rtl/win32/graph.pp

@@ -1947,8 +1947,8 @@ function queryadapterinfo : pmodeinfo;
     end;
 
   begin
-     SaveVideoState:=savestate;
-     RestoreVideoState:=restorestate;
+     SaveVideoState:={$ifdef fpc}@{$endif}savestate;
+     RestoreVideoState:={$ifdef fpc}@{$endif}restorestate;
      { we must take care of the border and caption }
      ScreenWidth:=GetSystemMetrics(SM_CXSCREEN)-
        2*GetSystemMetrics(SM_CXFRAME);
@@ -2222,7 +2222,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.5  2000-12-19 11:59:12  michael
+  Revision 1.6  2001-04-16 10:57:05  peter
+    * stricter compiler fixes
+
+  Revision 1.5  2000/12/19 11:59:12  michael
   * Fixes from Peter
 
   Revision 1.4  2000/11/14 19:45:08  florian

+ 11 - 7
rtl/win32/objinc.inc

@@ -112,7 +112,7 @@ begin
      FileOpen:=0;
      DosStreamError:=word(GetLastError);
      end
-   else 
+   else
      FileOpen := AHandle;
 end;
 
@@ -145,7 +145,7 @@ BEGIN
   res:=0;
   if readfile(handle,pointer(@buf),count,res,nil)=0 then
      DosStreamError:=word(GetLastError);
-  Actual:=res;    
+  Actual:=res;
   FileRead:=DosStreamError;
 end;
 
@@ -155,7 +155,7 @@ end;
 {---------------------------------------------------------------------------}
 FUNCTION FileWrite (Handle: THandle; Var Buf; Count: Sw_Word; Var Actual: Sw_Word): Word;
 BEGIN
-   if writefile(handle,pointer(@buf),count,Actual,nil)=0 then
+   if writefile(handle,pointer(@buf),count,longint(Actual),nil)=0 then
     Begin
       DosStreamError:=word(GetLasterror);
     end;
@@ -167,9 +167,10 @@ end;
 {  SetFileSize -> Platforms DOS          - Not Checked                      }
 {---------------------------------------------------------------------------}
 FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word;
-VAR Actual, Buf: LongInt;
+VAR Actual : dword;
+    Buf: LongInt;
 BEGIN
-   SetFilePos(Handle,FileSize,0,Actual);
+   SetFilePos(Handle,FileSize,0,longint(Actual));
    If (Actual = FileSize) Then
     Begin
       Actual := FileWrite(Handle, Buf, 0,Actual);   { Truncate the file }
@@ -184,10 +185,13 @@ END;
 
 {
   $Log$
-  Revision 1.3  2000-12-18 17:28:58  jonas
+  Revision 1.4  2001-04-16 10:57:05  peter
+    * stricter compiler fixes
+
+  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
- 
+
 }

+ 14 - 9
rtl/win32/sysutils.pp

@@ -74,21 +74,23 @@ end;
 
 Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
 Var
-  res : Longint;
+  res : dword;
 begin
-  if not ReadFile(Handle, Buffer, Count, res, nil) then
-   res := -1;
-  FileRead:=Res;
+  if ReadFile(Handle, Buffer, Count, res, nil) then
+   FileRead:=Res
+  else
+   FileRead:=-1;
 end;
 
 
 Function FileWrite (Handle : Longint; const Buffer; Count : Longint) : Longint;
 Var
-  Res : longint;
+  Res : dword;
 begin
-  if not WriteFile(Handle, Buffer, Count, Res, nil) then
-   Res:= -1;
-  FileWrite:=Res;
+  if WriteFile(Handle, Buffer, Count, Res, nil) then
+   FileWrite:=Res
+  else
+   FileWrite:=-1;
 end;
 
 
@@ -672,7 +674,10 @@ Finalization
 end.
 {
   $Log$
-  Revision 1.6  2001-02-20 22:14:19  peter
+  Revision 1.7  2001-04-16 10:57:05  peter
+    * stricter compiler fixes
+
+  Revision 1.6  2001/02/20 22:14:19  peter
     * merged getenvironmentvariable
 
   Revision 1.5  2000/12/18 17:28:58  jonas