OSDN Git Service

* gcc-interface/decl.c (make_type_from_size) <INTEGER_TYPE>: Just copy
[pf3gnuchains/gcc-fork.git] / gcc / ada / a-direio.adb
index b5f7939..7a5e5c8 100644 (file)
@@ -6,25 +6,23 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2005 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2009, 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- --
--- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
--- for  more details.  You should have  received  a copy of the GNU General --
--- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
--- Boston, MA 02110-1301, USA.                                              --
+-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
 --                                                                          --
--- As a special exception,  if other files  instantiate  generics from this --
--- unit, or you link  this unit with other files  to produce an executable, --
--- this  unit  does not  by itself cause  the resulting  executable  to  be --
--- covered  by the  GNU  General  Public  License.  This exception does not --
--- however invalidate  any other reasons why  the executable file  might be --
--- covered by the  GNU Public License.                                      --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception,   --
+-- version 3.1, as published by the Free Software Foundation.               --
+--                                                                          --
+-- You should have received a copy of the GNU General Public License and    --
+-- a copy of the GCC Runtime Library Exception along with this program;     --
+-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
+-- <http://www.gnu.org/licenses/>.                                          --
 --                                                                          --
 -- GNAT was originally developed  by the GNAT team at  New York University. --
 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
@@ -43,7 +41,7 @@ with System.File_Control_Block;
 with System.File_IO;
 with System.Direct_IO;
 with System.Storage_Elements;
-with Unchecked_Conversion;
+with Ada.Unchecked_Conversion;
 
 use type System.Direct_IO.Count;
 
@@ -63,8 +61,8 @@ package body Ada.Direct_IO is
    subtype FP      is DIO.File_Type;
    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);
+   function To_FCB is new Ada.Unchecked_Conversion (File_Mode, FCB.File_Mode);
+   function To_DIO is new Ada.Unchecked_Conversion (FCB.File_Mode, File_Mode);
 
    use type System.CRTL.size_t;
 
@@ -74,7 +72,7 @@ package body Ada.Direct_IO is
 
    procedure Close (File : in out File_Type) is
    begin
-      FIO.Close (AP (File));
+      FIO.Close (AP (File)'Unrestricted_Access);
    end Close;
 
    ------------
@@ -83,9 +81,9 @@ package body Ada.Direct_IO is
 
    procedure Create
      (File : in out File_Type;
-      Mode : in File_Mode := Inout_File;
-      Name : in String := "";
-      Form : in String := "")
+      Mode : File_Mode := Inout_File;
+      Name : String := "";
+      Form : String := "")
    is
    begin
       DIO.Create (FP (File), To_FCB (Mode), Name, Form);
@@ -98,14 +96,14 @@ package body Ada.Direct_IO is
 
    procedure Delete (File : in out File_Type) is
    begin
-      FIO.Delete (AP (File));
+      FIO.Delete (AP (File)'Unrestricted_Access);
    end Delete;
 
    -----------------
    -- End_Of_File --
    -----------------
 
-   function End_Of_File (File : in File_Type) return Boolean is
+   function End_Of_File (File : File_Type) return Boolean is
    begin
       return DIO.End_Of_File (FP (File));
    end End_Of_File;
@@ -114,7 +112,7 @@ package body Ada.Direct_IO is
    -- Form --
    ----------
 
-   function Form (File : in File_Type) return String is
+   function Form (File : File_Type) return String is
    begin
       return FIO.Form (AP (File));
    end Form;
@@ -123,7 +121,7 @@ package body Ada.Direct_IO is
    -- Index --
    -----------
 
-   function Index (File : in File_Type) return Positive_Count is
+   function Index (File : File_Type) return Positive_Count is
    begin
       return Positive_Count (DIO.Index (FP (File)));
    end Index;
@@ -132,7 +130,7 @@ package body Ada.Direct_IO is
    -- Is_Open --
    -------------
 
-   function Is_Open (File : in File_Type) return Boolean is
+   function Is_Open (File : File_Type) return Boolean is
    begin
       return FIO.Is_Open (AP (File));
    end Is_Open;
@@ -141,7 +139,7 @@ package body Ada.Direct_IO is
    -- Mode --
    ----------
 
-   function Mode (File : in File_Type) return File_Mode is
+   function Mode (File : File_Type) return File_Mode is
    begin
       return To_DIO (FIO.Mode (AP (File)));
    end Mode;
@@ -150,7 +148,7 @@ package body Ada.Direct_IO is
    -- Name --
    ----------
 
-   function Name (File : in File_Type) return String is
+   function Name (File : File_Type) return String is
    begin
       return FIO.Name (AP (File));
    end Name;
@@ -161,9 +159,9 @@ package body Ada.Direct_IO is
 
    procedure Open
      (File : in out File_Type;
-      Mode : in File_Mode;
-      Name : in String;
-      Form : in String := "")
+      Mode : File_Mode;
+      Name : String;
+      Form : String := "")
    is
    begin
       DIO.Open (FP (File), To_FCB (Mode), Name, Form);
@@ -175,9 +173,9 @@ package body Ada.Direct_IO is
    ----------
 
    procedure Read
-     (File : in File_Type;
+     (File : File_Type;
       Item : out Element_Type;
-      From : in Positive_Count)
+      From : Positive_Count)
    is
    begin
       --  For a non-constrained variant record type, we read into an
@@ -207,7 +205,7 @@ package body Ada.Direct_IO is
       end if;
    end Read;
 
-   procedure Read (File : in File_Type; Item : out Element_Type) is
+   procedure Read (File : File_Type; Item : out Element_Type) is
    begin
       --  Same processing for unconstrained case as above
 
@@ -235,7 +233,7 @@ package body Ada.Direct_IO is
    -- Reset --
    -----------
 
-   procedure Reset (File : in out File_Type; Mode : in File_Mode) is
+   procedure Reset (File : in out File_Type; Mode : File_Mode) is
    begin
       DIO.Reset (FP (File), To_FCB (Mode));
    end Reset;
@@ -249,7 +247,7 @@ package body Ada.Direct_IO is
    -- Set_Index --
    ---------------
 
-   procedure Set_Index (File : in File_Type; To : in Positive_Count) is
+   procedure Set_Index (File : File_Type; To : Positive_Count) is
    begin
       DIO.Set_Index (FP (File), DPCount (To));
    end Set_Index;
@@ -258,7 +256,7 @@ package body Ada.Direct_IO is
    -- Size --
    ----------
 
-   function Size (File : in File_Type) return Count is
+   function Size (File : File_Type) return Count is
    begin
       return Count (DIO.Size (FP (File)));
    end Size;
@@ -268,16 +266,16 @@ package body Ada.Direct_IO is
    -----------
 
    procedure Write
-     (File : in File_Type;
-      Item : in Element_Type;
-      To   : in Positive_Count)
+     (File : File_Type;
+      Item : Element_Type;
+      To   : Positive_Count)
    is
    begin
       DIO.Set_Index (FP (File), DPCount (To));
       DIO.Write (FP (File), Item'Address, Item'Size / SU, Zeroes);
    end Write;
 
-   procedure Write (File : in File_Type; Item : in Element_Type) is
+   procedure Write (File : File_Type; Item : Element_Type) is
    begin
       DIO.Write (FP (File), Item'Address, Item'Size / SU, Zeroes);
    end Write;