Browse Source

* fixed web bug tw4954 (warning when reading from a typed file)
+ test for the above (submitted test program minus childish remarks)

git-svn-id: trunk@3733 -

Jonas Maebe 19 years ago
parent
commit
316c4d6313
4 changed files with 29 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      rtl/inc/compproc.inc
  3. 1 1
      rtl/inc/typefile.inc
  4. 26 0
      tests/webtbs/tw4954.pp

+ 1 - 0
.gitattributes

@@ -6862,6 +6862,7 @@ tests/webtbs/tw4902.pp -text
 tests/webtbs/tw4922.pp svneol=native#text/plain
 tests/webtbs/tw4922.pp svneol=native#text/plain
 tests/webtbs/tw4925.pp svneol=native#text/plain
 tests/webtbs/tw4925.pp svneol=native#text/plain
 tests/webtbs/tw4950.pp svneol=native#text/plain
 tests/webtbs/tw4950.pp svneol=native#text/plain
+tests/webtbs/tw4954.pp svneol=native#text/plain
 tests/webtbs/tw4999.pp svneol=native#text/plain
 tests/webtbs/tw4999.pp svneol=native#text/plain
 tests/webtbs/tw5001.pp svneol=native#text/plain
 tests/webtbs/tw5001.pp svneol=native#text/plain
 tests/webtbs/tw5015.pp svneol=native#text/plain
 tests/webtbs/tw5015.pp svneol=native#text/plain

+ 1 - 1
rtl/inc/compproc.inc

@@ -325,7 +325,7 @@ procedure fpc_assert(Const Msg,FName:Shortstring;LineNo:Longint;ErrorAddr:Pointe
 Procedure fpc_reset_typed(var f : TypedFile;Size : Longint); compilerproc;
 Procedure fpc_reset_typed(var f : TypedFile;Size : Longint); compilerproc;
 Procedure fpc_rewrite_typed(var f : TypedFile;Size : Longint); compilerproc;
 Procedure fpc_rewrite_typed(var f : TypedFile;Size : Longint); compilerproc;
 Procedure fpc_typed_write(TypeSize : Longint;var f : TypedFile;const Buf); compilerproc;
 Procedure fpc_typed_write(TypeSize : Longint;var f : TypedFile;const Buf); compilerproc;
-Procedure fpc_typed_read(TypeSize : Longint;var f : TypedFile;var Buf); compilerproc;
+Procedure fpc_typed_read(TypeSize : Longint;var f : TypedFile;out Buf); compilerproc;
 
 
 {$ifdef FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
 {$ifdef FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
 function fpc_int64_to_double(i: int64): double; compilerproc;
 function fpc_int64_to_double(i: int64): double; compilerproc;

+ 1 - 1
rtl/inc/typefile.inc

@@ -73,7 +73,7 @@ Begin
   end;
   end;
 End;
 End;
 
 
-Procedure fpc_typed_read(TypeSize : Longint;var f : TypedFile;var Buf);[IOCheck, Public, Alias :'FPC_TYPED_READ']; compilerproc;
+Procedure fpc_typed_read(TypeSize : Longint;var f : TypedFile;out Buf);[IOCheck, Public, Alias :'FPC_TYPED_READ']; compilerproc;
 var
 var
   Result : Longint;
   Result : Longint;
 Begin
 Begin

+ 26 - 0
tests/webtbs/tw4954.pp

@@ -0,0 +1,26 @@
+{ %OPT=-Seh }
+
+program aFP211r;  { false hints on varrec }
+
+  type
+    t = record
+      d:integer
+    end;
+
+  var
+   f: file of t;
+
+  procedure P1;
+  var
+    varrec : t ;
+  begin
+    READ( f , varrec )
+  end{ P1 };
+
+begin 
+  assign( f , 'fname');
+  reset(f);
+  P1;
+end.
+
+