-- --
-- B o d y --
-- --
--- --
--- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System; use System;
+with System.CRTL;
with System.File_Control_Block;
with System.File_IO;
with System.Direct_IO;
package body Ada.Direct_IO is
- Zeroes : System.Storage_Elements.Storage_Array :=
+ Zeroes : constant System.Storage_Elements.Storage_Array :=
(1 .. System.Storage_Elements.Storage_Offset (Bytes) => 0);
-- Buffer used to fill out partial records.
subtype AP is FCB.AFCB_Ptr;
subtype FP is DIO.File_Type;
- subtype DCount is DIO.Count;
subtype DPCount is DIO.Positive_Count;
function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode);
function To_DIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode);
+ use type System.CRTL.size_t;
+
-----------
-- Close --
-----------
-- For a non-constrained variant record type, we read into an
-- intermediate buffer, since we may have the case of discriminated
-- records where a discriminant check is required, and we may need
- -- to assign only part of the record buffer originally written
+ -- to assign only part of the record buffer originally written.
+
+ -- Note: we have to turn warnings on/off because this use of
+ -- the Constrained attribute is an obsolescent feature.
+ pragma Warnings (Off);
if not Element_Type'Constrained then
+ pragma Warnings (On);
+
declare
Buf : Element_Type;
begin
-- Same processing for unconstrained case as above
+ -- Note: we have to turn warnings on/off because this use of
+ -- the Constrained attribute is an obsolescent feature.
+
+ pragma Warnings (Off);
if not Element_Type'Constrained then
+ pragma Warnings (On);
+
declare
Buf : Element_Type;