diff options
Diffstat (limited to 'gcc/ada/s-fileio.adb')
-rw-r--r-- | gcc/ada/s-fileio.adb | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb index f93fee25e33..60a96e427cf 100644 --- a/gcc/ada/s-fileio.adb +++ b/gcc/ada/s-fileio.adb @@ -31,13 +31,12 @@ with Ada.Finalization; use Ada.Finalization; with Ada.IO_Exceptions; use Ada.IO_Exceptions; -with Ada.Unchecked_Conversion; with Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Interfaces.C_Streams; use Interfaces.C_Streams; -with System.CRTL; +with System.CRTL.Runtime; with System.Case_Util; use System.Case_Util; with System.OS_Lib; with System.Soft_Links; @@ -375,16 +374,7 @@ package body System.File_IO is ------------------- function Errno_Message (Errno : Integer := OS_Lib.Errno) return String is - pragma Warnings (Off); - function To_Chars_Ptr is - new Ada.Unchecked_Conversion (System.Address, chars_ptr); - -- On VMS, the compiler warns because System.Address is 64 bits, but - -- chars_ptr is 32 bits. It should be safe, though, because strerror - -- will return a 32-bit pointer. - pragma Warnings (On); - - Message : constant chars_ptr := - To_Chars_Ptr (CRTL.strerror (Errno)); + Message : constant chars_ptr := CRTL.Runtime.strerror (Errno); begin if Message = Null_Ptr then @@ -529,27 +519,17 @@ package body System.File_IO is end if; when Inout_File | Append_File => - if Creat then - Fopstr (1) := 'w'; - else - Fopstr (1) := 'r'; - end if; - + Fopstr (1) := (if Creat then 'w' else 'r'); Fopstr (2) := '+'; Fptr := 3; end case; - -- If text_translation_required is true then we need to append - -- either a t or b to the string to get the right mode + -- If text_translation_required is true then we need to append either a + -- "t" or "b" to the string to get the right mode. if text_translation_required then - if Text then - Fopstr (Fptr) := 't'; - else - Fopstr (Fptr) := 'b'; - end if; - + Fopstr (Fptr) := (if Text then 't' else 'b'); Fptr := Fptr + 1; end if; |