Quellcode durchsuchen

Merged revisions 73 via svnmerge from
/trunk

git-svn-id: branches/fixes_2_0@357 -

peter vor 20 Jahren
Ursprung
Commit
9e86f0ff8f
4 geänderte Dateien mit 38 neuen und 14 gelöschten Zeilen
  1. 1 0
      .gitattributes
  2. 7 7
      rtl/inc/compproc.inc
  3. 7 7
      rtl/inc/text.inc
  4. 23 0
      tests/webtbs/tw3970.pp

+ 1 - 0
.gitattributes

@@ -5908,6 +5908,7 @@ tests/webtbs/tw3939.pp svneol=native#text/plain
 tests/webtbs/tw3953a.pp svneol=native#text/plain
 tests/webtbs/tw3953b.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/tw3973.pp svneol=native#text/plain
 tests/webtbs/tw3977.pp svneol=native#text/plain

+ 7 - 7
rtl/inc/compproc.inc

@@ -196,14 +196,14 @@ Procedure fpc_ReadLn_End(var f : Text); 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;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_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}
-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}
 
 {$ifdef FPC_INCLUDE_SOFTWARE_MOD_DIV}

+ 7 - 7
rtl/inc/text.inc

@@ -952,7 +952,7 @@ Begin
 End;
 
 
-Procedure fpc_Read_Text_AnsiStr(var f : Text;var s : AnsiString); iocheck; [Public,Alias:'FPC_READ_TEXT_ANSISTR']; compilerproc;
+Procedure fpc_Read_Text_AnsiStr(var f : Text;out s : AnsiString); iocheck; [Public,Alias:'FPC_READ_TEXT_ANSISTR']; compilerproc;
 var
   slen,len : longint;
 Begin
@@ -967,7 +967,7 @@ Begin
   SetLength(S,Slen);
 End;
 
-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;
 Begin
   c:=#0;
 { Check error and if file is open }
@@ -998,7 +998,7 @@ Begin
 end;
 
 
-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;
 var
   hs   : String;
   code : longint;
@@ -1041,7 +1041,7 @@ Begin
 End;
 
 
-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;
 var
   hs   : String;
   code : longint;
@@ -1077,7 +1077,7 @@ Begin
 End;
 
 
-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;
 var
   hs : string;
   code : Word;
@@ -1115,7 +1115,7 @@ end;
 
 {$ifndef cpu64}
 
-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;
 var
   hs   : String;
   code : longint;
@@ -1150,7 +1150,7 @@ Begin
    InOutRes:=106;
 End;
 
-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;
 var
   hs   : String;
   code : Longint;

+ 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.