Browse Source

* changed fpc_read_text to use out instead of var

git-svn-id: trunk@73 -
florian 20 years ago
parent
commit
f8c314a7b7
4 changed files with 44 additions and 20 deletions
  1. 1 0
      .gitattributes
  2. 10 10
      rtl/inc/compproc.inc
  3. 10 10
      rtl/inc/text.inc
  4. 23 0
      tests/webtbs/tw3970.pp

+ 1 - 0
.gitattributes

@@ -6113,6 +6113,7 @@ tests/webtbs/tw3939.pp svneol=native#text/plain
 tests/webtbs/tw3953a.pp svneol=native#text/plain
 tests/webtbs/tw3953a.pp svneol=native#text/plain
 tests/webtbs/tw3953b.pp svneol=native#text/plain
 tests/webtbs/tw3953b.pp svneol=native#text/plain
 tests/webtbs/tw3967.pp svneol=native#text/plain
 tests/webtbs/tw3967.pp svneol=native#text/plain
+tests/webtbs/tw3970.pp svneol=native#text/plain
 tests/webtbs/tw3971.pp svneol=native#text/plain
 tests/webtbs/tw3971.pp svneol=native#text/plain
 tests/webtbs/tw3973.pp svneol=native#text/plain
 tests/webtbs/tw3973.pp svneol=native#text/plain
 tests/webtbs/tw3977.pp svneol=native#text/plain
 tests/webtbs/tw3977.pp svneol=native#text/plain

+ 10 - 10
rtl/inc/compproc.inc

@@ -221,17 +221,17 @@ procedure fpc_vararray_put(var d : variant;const s : variant;indices : psizeint;
 
 
 Procedure fpc_Read_End(var f:Text); compilerproc;
 Procedure fpc_Read_End(var f:Text); compilerproc;
 Procedure fpc_ReadLn_End(var f : Text); compilerproc;
 Procedure fpc_ReadLn_End(var f : Text); compilerproc;
-Procedure fpc_Read_Text_ShortStr(var f : Text;var s : String); compilerproc;
-Procedure fpc_Read_Text_PChar_As_Pointer(var f : Text;var s : PChar); compilerproc;
-Procedure fpc_Read_Text_PChar_As_Array(var f : Text;var s : array of char); compilerproc;
-Procedure fpc_Read_Text_AnsiStr(var f : Text;var s : AnsiString); compilerproc;
-Procedure fpc_Read_Text_Char(var f : Text; var c : char); compilerproc;
-Procedure fpc_Read_Text_SInt(var f : Text; var l :ValSInt); compilerproc;
-Procedure fpc_Read_Text_UInt(var f : Text; var u :ValUInt); compilerproc;
-Procedure fpc_Read_Text_Float(var f : Text; var v :ValReal); compilerproc;
+Procedure fpc_Read_Text_ShortStr(var f : Text;out s : String); compilerproc;
+Procedure fpc_Read_Text_PChar_As_Pointer(var f : Text;out s : PChar); compilerproc;
+Procedure fpc_Read_Text_PChar_As_Array(var f : Text;out s : array of char); compilerproc;
+Procedure fpc_Read_Text_AnsiStr(var f : Text;out s : AnsiString); compilerproc;
+Procedure fpc_Read_Text_Char(var f : Text; out c : char); compilerproc;
+Procedure fpc_Read_Text_SInt(var f : Text; out l :ValSInt); compilerproc;
+Procedure fpc_Read_Text_UInt(var f : Text; out u :ValUInt); compilerproc;
+Procedure fpc_Read_Text_Float(var f : Text; out v :ValReal); compilerproc;
 {$ifndef CPU64}
 {$ifndef CPU64}
-Procedure fpc_Read_Text_QWord(var f : text; var q : qword); compilerproc;
-Procedure fpc_Read_Text_Int64(var f : text; var i : int64); compilerproc;
+Procedure fpc_Read_Text_QWord(var f : text; out q : qword); compilerproc;
+Procedure fpc_Read_Text_Int64(var f : text; out i : int64); compilerproc;
 {$endif CPU64}
 {$endif CPU64}
 
 
 {$ifdef FPC_INCLUDE_SOFTWARE_MOD_DIV}
 {$ifdef FPC_INCLUDE_SOFTWARE_MOD_DIV}

+ 10 - 10
rtl/inc/text.inc

@@ -938,19 +938,19 @@ Begin
 End;
 End;
 
 
 
 
-Procedure fpc_Read_Text_ShortStr(var f : Text;var s : String); iocheck; [Public,Alias:'FPC_READ_TEXT_SHORTSTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
+Procedure fpc_Read_Text_ShortStr(var f : Text;out s : String); iocheck; [Public,Alias:'FPC_READ_TEXT_SHORTSTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
 Begin
 Begin
   s[0]:=chr(ReadPCharLen(f,pchar(@s[1]),high(s)));
   s[0]:=chr(ReadPCharLen(f,pchar(@s[1]),high(s)));
 End;
 End;
 
 
 
 
-Procedure fpc_Read_Text_PChar_As_Pointer(var f : Text;var s : PChar); iocheck; [Public,Alias:'FPC_READ_TEXT_PCHAR_AS_POINTER']; {$ifdef hascompilerproc} compilerproc; {$endif}
+Procedure fpc_Read_Text_PChar_As_Pointer(var f : Text;out s : PChar); iocheck; [Public,Alias:'FPC_READ_TEXT_PCHAR_AS_POINTER']; {$ifdef hascompilerproc} compilerproc; {$endif}
 Begin
 Begin
   pchar(s+ReadPCharLen(f,s,$7fffffff))^:=#0;
   pchar(s+ReadPCharLen(f,s,$7fffffff))^:=#0;
 End;
 End;
 
 
 
 
-Procedure fpc_Read_Text_PChar_As_Array(var f : Text;var s : array of char); iocheck; [Public,Alias:'FPC_READ_TEXT_PCHAR_AS_ARRAY']; {$ifdef hascompilerproc} compilerproc; {$endif}
+Procedure fpc_Read_Text_PChar_As_Array(var f : Text;out s : array of char); iocheck; [Public,Alias:'FPC_READ_TEXT_PCHAR_AS_ARRAY']; {$ifdef hascompilerproc} compilerproc; {$endif}
 var
 var
   len: longint;
   len: longint;
 Begin
 Begin
@@ -960,7 +960,7 @@ Begin
 End;
 End;
 
 
 
 
-Procedure fpc_Read_Text_AnsiStr(var f : Text;var s : AnsiString); iocheck; [Public,Alias:'FPC_READ_TEXT_ANSISTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
+Procedure fpc_Read_Text_AnsiStr(var f : Text;out s : AnsiString); iocheck; [Public,Alias:'FPC_READ_TEXT_ANSISTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
 var
 var
   slen,len : longint;
   slen,len : longint;
 Begin
 Begin
@@ -976,7 +976,7 @@ Begin
 End;
 End;
 
 
 {$ifdef hascompilerproc}
 {$ifdef hascompilerproc}
-procedure fpc_Read_Text_Char(var f : Text; var c: char); iocheck; [Public,Alias:'FPC_READ_TEXT_CHAR'];compilerproc;
+procedure fpc_Read_Text_Char(var f : Text; out c: char); iocheck; [Public,Alias:'FPC_READ_TEXT_CHAR'];compilerproc;
 {$else hascompilerproc}
 {$else hascompilerproc}
 Function fpc_Read_Text_Char(var f : Text):char;[Public,Alias:'FPC_READ_TEXT_CHAR'];
 Function fpc_Read_Text_Char(var f : Text):char;[Public,Alias:'FPC_READ_TEXT_CHAR'];
 {$endif hascompilerproc}
 {$endif hascompilerproc}
@@ -1023,7 +1023,7 @@ end;
 
 
 
 
 {$ifdef hascompilerproc}
 {$ifdef hascompilerproc}
-Procedure fpc_Read_Text_SInt(var f : Text; var l : ValSInt); iocheck; [Public,Alias:'FPC_READ_TEXT_SINT']; compilerproc;
+Procedure fpc_Read_Text_SInt(var f : Text; out l : ValSInt); iocheck; [Public,Alias:'FPC_READ_TEXT_SINT']; compilerproc;
 {$else hascompilerproc}
 {$else hascompilerproc}
 Function fpc_Read_Text_SInt(var f : Text):ValSInt;[Public,Alias:'FPC_READ_TEXT_SINT'];
 Function fpc_Read_Text_SInt(var f : Text):ValSInt;[Public,Alias:'FPC_READ_TEXT_SINT'];
 {$endif hascompilerproc}
 {$endif hascompilerproc}
@@ -1085,7 +1085,7 @@ End;
 
 
 
 
 {$ifdef hascompilerproc}
 {$ifdef hascompilerproc}
-Procedure fpc_Read_Text_UInt(var f : Text; var u : ValUInt);  iocheck; [Public,Alias:'FPC_READ_TEXT_UINT']; compilerproc;
+Procedure fpc_Read_Text_UInt(var f : Text; out u : ValUInt);  iocheck; [Public,Alias:'FPC_READ_TEXT_UINT']; compilerproc;
 {$else hascompilerproc}
 {$else hascompilerproc}
 Function fpc_Read_Text_UInt(var f : Text):ValUInt;[Public,Alias:'FPC_READ_TEXT_UINT'];
 Function fpc_Read_Text_UInt(var f : Text):ValUInt;[Public,Alias:'FPC_READ_TEXT_UINT'];
 {$endif hascompilerproc}
 {$endif hascompilerproc}
@@ -1133,7 +1133,7 @@ End;
 
 
 
 
 {$ifdef hascompilerproc}
 {$ifdef hascompilerproc}
-procedure fpc_Read_Text_Float(var f : Text; var v : ValReal); iocheck; [Public,Alias:'FPC_READ_TEXT_FLOAT']; compilerproc;
+procedure fpc_Read_Text_Float(var f : Text; out v : ValReal); iocheck; [Public,Alias:'FPC_READ_TEXT_FLOAT']; compilerproc;
 {$else hascompilerproc}
 {$else hascompilerproc}
 Function fpc_Read_Text_Float(var f : Text):ValReal;[Public,Alias:'FPC_READ_TEXT_FLOAT'];
 Function fpc_Read_Text_Float(var f : Text):ValReal;[Public,Alias:'FPC_READ_TEXT_FLOAT'];
 {$endif hascompilerproc}
 {$endif hascompilerproc}
@@ -1183,7 +1183,7 @@ end;
 {$ifndef cpu64}
 {$ifndef cpu64}
 
 
 {$ifdef hascompilerproc}
 {$ifdef hascompilerproc}
-procedure fpc_Read_Text_QWord(var f : text; var q : qword); iocheck; [public,alias:'FPC_READ_TEXT_QWORD']; compilerproc;
+procedure fpc_Read_Text_QWord(var f : text; out q : qword); iocheck; [public,alias:'FPC_READ_TEXT_QWORD']; compilerproc;
 {$else hascompilerproc}
 {$else hascompilerproc}
 function fpc_Read_Text_QWord(var f : text) : qword;[public,alias:'FPC_READ_TEXT_QWORD'];
 function fpc_Read_Text_QWord(var f : text) : qword;[public,alias:'FPC_READ_TEXT_QWORD'];
 {$endif hascompilerproc}
 {$endif hascompilerproc}
@@ -1230,7 +1230,7 @@ Begin
 End;
 End;
 
 
 {$ifdef hascompilerproc}
 {$ifdef hascompilerproc}
-procedure fpc_Read_Text_Int64(var f : text; var i : int64); iocheck; [public,alias:'FPC_READ_TEXT_INT64']; compilerproc;
+procedure fpc_Read_Text_Int64(var f : text; out i : int64); iocheck; [public,alias:'FPC_READ_TEXT_INT64']; compilerproc;
 {$else hascompilerproc}
 {$else hascompilerproc}
 function fpc_Read_Text_Int64(var f : text) : int64;[public,alias:'FPC_READ_TEXT_INT64']; {$ifdef hascompilerproc} compilerproc; {$endif}
 function fpc_Read_Text_Int64(var f : text) : int64;[public,alias:'FPC_READ_TEXT_INT64']; {$ifdef hascompilerproc} compilerproc; {$endif}
 {$endif hascompilerproc}
 {$endif hascompilerproc}

+ 23 - 0
tests/webtbs/tw3970.pp

@@ -0,0 +1,23 @@
+{ %OPT=-Sew }
+
+{ Source provided for Free Pascal Bug Report 3970 }
+{ Submitted by "Yiannis Dondos" on  2005-05-15 }
+{ e-mail: [email protected] }
+
+{$warnings+}
+program test1;
+
+var
+   f: Text;
+   i: Integer;
+   s: ShortString;
+
+begin
+     Assign (f, 'test.dat');
+     Reset (f);
+
+     ReadLn (f, i);
+     ReadLn (f, s); // Warning!
+
+     Close (f);
+end.