瀏覽代碼

* do_read/do_write addr argument changed to pointer

peter 21 年之前
父節點
當前提交
041eb4aa1d

+ 2 - 2
rtl/beos/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2004/04/21]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2004/04/22]
 #
 default: all
 MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom
@@ -1403,7 +1403,7 @@ varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
 		    $(OBJPASDIR)/varutilh.inc varutils.pp
 	$(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
 types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-  $(COMPILER) $(OBJPASDIR)/types.pp
+	$(COMPILER) $(OBJPASDIR)/types.pp
 cpu$(PPUEXT) : $(PROCINC)/cpu.pp system$(PPUEXT)
 mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) system$(PPUEXT)
 getopts$(PPUEXT) : $(INC)/getopts.pp system$(PPUEXT)

+ 1 - 1
rtl/beos/Makefile.fpc

@@ -137,7 +137,7 @@ varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
         $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
 
 types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-  $(COMPILER) $(OBJPASDIR)/types.pp
+        $(COMPILER) $(OBJPASDIR)/types.pp
 
 #
 # Other system-independent RTL Units

+ 8 - 5
rtl/beos/system.pp

@@ -208,7 +208,7 @@ begin
   InOutRes:=sys_rename($FF000000,p1,$FF000000,p2);
 end;
 
-function do_write(h,addr,len : longint) : longint;
+function do_write(h:longint;addr:pointer;len : longint) : longint;
 begin
 {  if h>0 then begin
     sys_write ('WRITE handle=%d ',h);
@@ -216,21 +216,21 @@ begin
     printf ('len=%d',len);
     printf ('%c',10);
   end;}
-  do_write:=sys_write (h,pointer(addr),len,zero);
+  do_write:=sys_write (h,addr,len,zero);
   if (do_write<0) then begin
     InOutRes:=do_write;
     do_write:=0;
   end else InOutRes:=0;
 end;
 
-function do_read(h,addr,len : longint) : longint;
+function do_read(h:longint;addr:pointer;len : longint) : longint;
 begin
 {  if h>2 then begin
     printf ('READ handle=%d ',h);
     printf ('addr=%x ',addr);
     printf ('len=%d',len);
   end;}
-  do_read:=sys_read (h,pointer(addr),len,zero);
+  do_read:=sys_read (h,addr,len,zero);
   if (do_read<0) then begin
     InOutRes:=do_read;
     do_read:=0;
@@ -541,7 +541,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.11  2004-01-20 23:09:14  hajny
+  Revision 1.12  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.11  2004/01/20 23:09:14  hajny
     * ExecuteProcess fixes, ProcessID and ThreadID added
 
   Revision 1.10  2003/10/25 23:42:35  hajny

+ 8 - 5
rtl/bsd/osmain.inc

@@ -205,12 +205,12 @@ Begin
 End;
 
 
-Function Do_Write(Handle,Addr,Len:Longint):longint;
+Function Do_Write(Handle:Longint;Addr:Pointer;Len:Longint):longint;
 
 var j : cint;
 Begin
   repeat
-    Do_Write:=Fpwrite(Handle,pchar(addr),len);
+    Do_Write:=Fpwrite(Handle,addr,len);
     j:=geterrno;
   until (do_write<>-1) or ((j<>ESysEINTR) and (j<>ESysEAgain));
   If Do_Write<0 Then
@@ -223,13 +223,13 @@ Begin
 End;
 
 
-Function Do_Read(Handle,Addr,Len:Longint):Longint;
+Function Do_Read(Handle:Longint;Addr:Pointer;Len:Longint):Longint;
 
 var j:cint;
 
 Begin
   repeat
-    Do_Read:=Fpread(Handle,pchar(addr),len);
+    Do_Read:=Fpread(Handle,addr,len);
     j:=geterrno;
   until (do_read<>-1) or ((j<>ESysEINTR) and (j<>ESysEAgain));
   If Do_Read<0 Then
@@ -593,7 +593,10 @@ end;
 
 {
    $Log$
-   Revision 1.12  2004-01-06 15:42:05  marco
+   Revision 1.13  2004-04-22 21:10:56  peter
+     * do_read/do_write addr argument changed to pointer
+
+   Revision 1.12  2004/01/06 15:42:05  marco
     * o_creat added when o_append
 
    Revision 1.11  2004/01/03 14:56:10  marco

+ 3 - 3
rtl/emx/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2004/04/21]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2004/04/22]
 #
 default: all
 MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom
@@ -1406,10 +1406,10 @@ objects$(PPUEXT) : $(INC)/objects.pp dos$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 printer$(PPUEXT) : $(OS2INC)/printer.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
 sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
 		    objpas$(PPUEXT) dos$(PPUEXT) sysconst$(PPUEXT)
-  $(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
+	$(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
 classes$(PPUEXT) : ../os2/classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
 		   sysutils$(PPUEXT) typinfo$(PPUEXT)
-  $(COMPILER) -Fi$(OBJPASDIR)/classes ../os2/classes.pp
+	$(COMPILER) -Fi$(OBJPASDIR)/classes ../os2/classes.pp
 typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
 	$(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
 math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)

+ 2 - 2
rtl/emx/Makefile.fpc

@@ -156,11 +156,11 @@ printer$(PPUEXT) : $(OS2INC)/printer.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEX
 
 sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
                     objpas$(PPUEXT) dos$(PPUEXT) sysconst$(PPUEXT)
-  $(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
+        $(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
 
 classes$(PPUEXT) : ../os2/classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
                    sysutils$(PPUEXT) typinfo$(PPUEXT)
-  $(COMPILER) -Fi$(OBJPASDIR)/classes ../os2/classes.pp
+        $(COMPILER) -Fi$(OBJPASDIR)/classes ../os2/classes.pp
 
 typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
         $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)

+ 6 - 3
rtl/emx/system.pas

@@ -402,7 +402,7 @@ begin
     end ['eax', 'edx', 'edi'];
 end;
 
-function do_read(h,addr,len:longint):longint; assembler;
+function do_read(h:longint;addr:pointer;len:longint):longint; assembler;
 asm
     pushl %ebx
 {$IFNDEF REGCALL}
@@ -421,7 +421,7 @@ asm
     popl %ebx
 end {['eax', 'ebx', 'ecx', 'edx']};
 
-function do_write(h,addr,len:longint) : longint; assembler;
+function do_write(h:longint;addr:pointer;len:longint) : longint; assembler;
 asm
     pushl %ebx
 {$IFDEF REGCALL}
@@ -1318,7 +1318,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.23  2004-01-20 23:05:31  hajny
+  Revision 1.24  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.23  2004/01/20 23:05:31  hajny
     * ExecuteProcess fixes, ProcessID and ThreadID added
 
   Revision 1.22  2003/12/26 22:20:44  hajny

+ 10 - 7
rtl/go32v2/system.pp

@@ -144,8 +144,8 @@ const
       reales,realds,realfs,realgs,
       realip,realcs,realsp,realss  : word;
     end;
-  function  do_write(h,addr,len : longint) : longint;
-  function  do_read(h,addr,len : longint) : longint;
+  function  do_write(h:longint;addr:pointer;len : longint) : longint;
+  function  do_read(h:longint;addr:pointer;len : longint) : longint;
   procedure syscopyfromdos(addr : longint; len : longint);
   procedure syscopytodos(addr : longint; len : longint);
   procedure sysrealintr(intnr : word;var regs : trealregs);
@@ -1019,7 +1019,7 @@ begin
 end;
 
 
-function do_write(h,addr,len : longint) : longint;
+function do_write(h:longint;addr:pointer;len : longint) : longint;
 var
   regs      : trealregs;
   size,
@@ -1032,7 +1032,7 @@ begin
       size:=tb_size
      else
       size:=len;
-     syscopytodos(addr+writesize,size);
+     syscopytodos(ptrint(addr)+writesize,size);
      regs.realecx:=size;
      regs.realedx:=tb_offset;
      regs.realds:=tb_segment;
@@ -1054,7 +1054,7 @@ begin
 end;
 
 
-function do_read(h,addr,len : longint) : longint;
+function do_read(h:longint;addr:pointer;len : longint) : longint;
 var
   regs     : trealregs;
   size,
@@ -1079,7 +1079,7 @@ begin
         do_read:=0;
         exit;
       end;
-     syscopyfromdos(addr+readsize,lo(regs.realeax));
+     syscopyfromdos(ptrint(addr)+readsize,lo(regs.realeax));
      inc(readsize,lo(regs.realeax));
      dec(len,lo(regs.realeax));
      { stop when not the specified size is read }
@@ -1607,7 +1607,10 @@ Begin
 End.
 {
   $Log$
-  Revision 1.33  2004-01-25 13:05:08  jonas
+  Revision 1.34  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.33  2004/01/25 13:05:08  jonas
     * fixed compilation errors
 
   Revision 1.32  2004/01/20 23:09:14  hajny

+ 6 - 3
rtl/inc/file.inc

@@ -134,7 +134,7 @@ Begin
    exit;
   case FileRec(f).Mode of
     fmInOut,fmOutput :
-      Result:=Do_Write(FileRec(f).Handle,Longint(@Buf),Count*FileRec(f).RecSize)
+      Result:=Do_Write(FileRec(f).Handle,@Buf,Count*FileRec(f).RecSize)
         div FileRec(f).RecSize;
     fmInPut: inOutRes := 105;
     else InOutRes:=103;
@@ -203,7 +203,7 @@ Begin
    exit;
   case FileRec(f).Mode of
     fmInOut,fmInput :
-      Result:=Do_Read(FileRec(f).Handle,Longint(@Buf),count*FileRec(f).RecSize)
+      Result:=Do_Read(FileRec(f).Handle,@Buf,count*FileRec(f).RecSize)
         div FileRec(f).RecSize;
     fmOutput: inOutRes := 104;
     else InOutRes:=103;
@@ -412,7 +412,10 @@ End;
 
 {
   $Log$
-  Revision 1.7  2003-11-29 14:07:52  peter
+  Revision 1.8  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.7  2003/11/29 14:07:52  peter
     * do not overwrite Inoutres in blockwrite with 101
 
   Revision 1.6  2002/12/07 14:36:14  carl

+ 6 - 3
rtl/inc/text.inc

@@ -35,7 +35,7 @@ End;
 
 Procedure FileReadFunc(var t:TextRec);
 Begin
-  t.BufEnd:=Do_Read(t.Handle,Longint(t.Bufptr),t.BufSize);
+  t.BufEnd:=Do_Read(t.Handle,t.Bufptr,t.BufSize);
   t.BufPos:=0;
 End;
 
@@ -44,7 +44,7 @@ Procedure FileWriteFunc(var t:TextRec);
 var
   i : longint;
 Begin
-  i:=Do_Write(t.Handle,Longint(t.Bufptr),t.BufPos);
+  i:=Do_Write(t.Handle,t.Bufptr,t.BufPos);
   if i<>t.BufPos then
     InOutRes:=101;
   t.BufPos:=0;
@@ -1266,7 +1266,10 @@ end;
 
 {
   $Log$
-  Revision 1.20  2002-11-29 16:26:52  peter
+  Revision 1.21  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.20  2002/11/29 16:26:52  peter
     * fixed ignorespaces which was broken by the previous commit
       when a line started with spaces
 

+ 6 - 3
rtl/inc/typefile.inc

@@ -68,7 +68,7 @@ Begin
    exit;
   case fileRec(f).mode of
     fmOutPut,fmInOut:
-      Do_Write(FileRec(f).Handle,Longint(@Buf),TypeSize);
+      Do_Write(FileRec(f).Handle,@Buf,TypeSize);
     fmInput: inOutRes := 105;
     else inOutRes := 103;
   end;
@@ -83,7 +83,7 @@ Begin
   case FileRec(f).mode of
     fmInput,fmInOut:
       begin
-        Result:=Do_Read(FileRec(f).Handle,Longint(@Buf),TypeSize);
+        Result:=Do_Read(FileRec(f).Handle,@Buf,TypeSize);
         If Result<TypeSize Then
          InOutRes:=100
       end;
@@ -94,7 +94,10 @@ End;
 
 {
   $Log$
-  Revision 1.4  2002-09-07 15:07:46  peter
+  Revision 1.5  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.4  2002/09/07 15:07:46  peter
     * old logs removed and tabs fixed
 
 }

+ 10 - 7
rtl/os2/system.pas

@@ -618,28 +618,28 @@ begin
   inoutres:=DosMove(p1, p2);
 end;
 
-function do_read(h,addr,len:longint):longint;
+function do_read(h:longint;addr:pointer;len:longint):longint;
 Var
   T: cardinal;
 begin
 {$ifdef IODEBUG}
-  write('do_read: handle=', h, ', addr=', addr, ', length=', len);
+  write('do_read: handle=', h, ', addr=', ptrint(addr), ', length=', len);
 {$endif}
-  InOutRes:=DosRead(H, Pointer(Addr), Len, T);
+  InOutRes:=DosRead(H, Addr, Len, T);
   do_read:= longint (T);
 {$ifdef IODEBUG}
   writeln(', actual_len=', t, ', InOutRes=', InOutRes);
 {$endif}
 end;
 
-function do_write(h,addr,len:longint) : longint;
+function do_write(h:longint;addr:pointer;len:longint) : longint;
 Var
   T: cardinal;
 begin
 {$ifdef IODEBUG}
-  write('do_write: handle=', h, ', addr=', addr, ', length=', len);
+  write('do_write: handle=', h, ', addr=', ptrint(addr), ', length=', len);
 {$endif}
-  InOutRes:=DosWrite(H, Pointer(Addr), Len, T);
+  InOutRes:=DosWrite(H, Addr, Len, T);
   do_write:= longint (T);
 {$ifdef IODEBUG}
   writeln(', actual_len=', t, ', InOutRes=', InOutRes);
@@ -1501,7 +1501,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.69  2004-03-24 19:23:09  hajny
+  Revision 1.70  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.69  2004/03/24 19:23:09  hajny
     * misleading warning removed
 
   Revision 1.68  2004/03/24 19:15:59  hajny

+ 10 - 7
rtl/watcom/system.pp

@@ -92,8 +92,8 @@ Const
       reales,realds,realfs,realgs,
       realip,realcs,realsp,realss  : word;
     end;
-  function  do_write(h,addr,len : longint) : longint;
-  function  do_read(h,addr,len : longint) : longint;
+  function  do_write(h:longint;addr:pointer;len : longint) : longint;
+  function  do_read(h:longint;addr:pointer;len : longint) : longint;
   procedure syscopyfromdos(addr : sizeuint; len : longint);
   procedure syscopytodos(addr : sizeuint; len : longint);
   procedure sysrealintr(intnr : word;var regs : trealregs);
@@ -948,7 +948,7 @@ begin
    GetInOutRes(lo(regs.realeax));
 end;
 
-function do_write(h,addr,len : longint) : longint;
+function do_write(h:longint;addr:pointer;len : longint) : longint;
 var
   regs      : trealregs;
   size,
@@ -961,7 +961,7 @@ begin
       size:=tb_size
      else
       size:=len;
-     syscopytodos(addr+writesize,size);
+     syscopytodos(ptrint(addr)+writesize,size);
      regs.realecx:=size;
      regs.realedx:=tb_offset;
      regs.realds:=tb_segment;
@@ -982,7 +982,7 @@ begin
   Do_Write:=WriteSize;
 end;
 
-function do_read(h,addr,len : longint) : longint;
+function do_read(h:longint;addr:pointer;len : longint) : longint;
 var
   regs     : trealregs;
   size,
@@ -1007,7 +1007,7 @@ begin
         do_read:=0;
         exit;
       end;
-     syscopyfromdos(addr+readsize,lo(regs.realeax));
+     syscopyfromdos(ptrint(addr)+readsize,lo(regs.realeax));
      inc(readsize,lo(regs.realeax));
      dec(len,lo(regs.realeax));
      { stop when not the specified size is read }
@@ -1537,7 +1537,10 @@ End.
 
 {
   $Log$
-  Revision 1.12  2004-01-20 23:12:49  hajny
+  Revision 1.13  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.12  2004/01/20 23:12:49  hajny
     * ExecuteProcess fixes, ProcessID and ThreadID added
 
   Revision 1.11  2004/01/11 23:08:39  hajny

+ 8 - 5
rtl/win32/system.pp

@@ -377,11 +377,11 @@ begin
 end;
 
 
-function do_write(h,addr,len : longint) : longint;
+function do_write(h:longint;addr:pointer;len : longint) : longint;
 var
    size:longint;
 begin
-   if writefile(h,pointer(addr),len,size,nil)=0 then
+   if writefile(h,addr,len,size,nil)=0 then
     Begin
       errno:=GetLastError;
       Errno2InoutRes;
@@ -390,11 +390,11 @@ begin
 end;
 
 
-function do_read(h,addr,len : longint) : longint;
+function do_read(h:longint;addr:pointer;len : longint) : longint;
 var
   _result:longint;
 begin
-  if readfile(h,pointer(addr),len,_result,nil)=0 then
+  if readfile(h,addr,len,_result,nil)=0 then
     Begin
       errno:=GetLastError;
       if errno=ERROR_BROKEN_PIPE then
@@ -1608,7 +1608,10 @@ end.
 
 {
   $Log$
-  Revision 1.54  2004-02-15 21:37:18  hajny
+  Revision 1.55  2004-04-22 21:10:56  peter
+    * do_read/do_write addr argument changed to pointer
+
+  Revision 1.54  2004/02/15 21:37:18  hajny
     * ProcessID initialization added
 
   Revision 1.53  2004/02/02 17:01:47  florian