From 0773617140ab3b8f4192a52bff59deecbacbbcfe Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 27 May 2008 14:36:04 +0200 Subject: [PATCH] a-ststio.adb, [...]: Further code clean up of previous change. * a-ststio.adb, s-direio.adb: Further code clean up of previous change. Update comments. From-SVN: r136023 --- gcc/ada/a-ststio.adb | 15 +++------------ gcc/ada/s-direio.adb | 6 ++++++ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/gcc/ada/a-ststio.adb b/gcc/ada/a-ststio.adb index fd5e39a7a32..9c3bd31af58 100644 --- a/gcc/ada/a-ststio.adb +++ b/gcc/ada/a-ststio.adb @@ -101,11 +101,8 @@ package body Ada.Streams.Stream_IO is ----------- procedure Close (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin - FIO.Close (AFCB'Access); + FIO.Close (AP (File)'Unrestricted_Access); end Close; ------------ @@ -140,11 +137,8 @@ package body Ada.Streams.Stream_IO is ------------ procedure Delete (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin - FIO.Delete (AFCB'Access); + FIO.Delete (AP (File)'Unrestricted_Access); end Delete; ----------------- @@ -357,9 +351,6 @@ package body Ada.Streams.Stream_IO is -------------- procedure Set_Mode (File : in out File_Type; Mode : File_Mode) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin FIO.Check_File_Open (AP (File)); @@ -371,7 +362,7 @@ package body Ada.Streams.Stream_IO is if ((File.Mode = FCB.In_File) /= (Mode = In_File)) and then not File.Update_Mode then - FIO.Reset (AFCB'Access, FCB.Inout_File); + FIO.Reset (AP (File)'Unrestricted_Access, FCB.Inout_File); File.Update_Mode := True; end if; diff --git a/gcc/ada/s-direio.adb b/gcc/ada/s-direio.adb index 328051c125a..c764a1c658e 100644 --- a/gcc/ada/s-direio.adb +++ b/gcc/ada/s-direio.adb @@ -252,6 +252,9 @@ package body System.Direct_IO is procedure Reset (File : in out File_Type; Mode : FCB.File_Mode) is pragma Unmodified (File); + -- File is actually modified via Unrestricted_Access below, but + -- GNAT will generate a warning anyway. + begin FIO.Reset (AP (File)'Unrestricted_Access, Mode); File.Index := 1; @@ -260,6 +263,9 @@ package body System.Direct_IO is procedure Reset (File : in out File_Type) is pragma Unmodified (File); + -- File is actually modified via Unrestricted_Access below, but + -- GNAT will generate a warning anyway. + begin FIO.Reset (AP (File)'Unrestricted_Access); File.Index := 1; -- 2.30.2