diff options
author | Thomas Quinot <quinot@adacore.com> | 2007-06-06 12:20:58 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-06-06 12:20:58 +0200 |
commit | 0ebb72c85d0c10fd1479f35ebfd34d505f095664 (patch) | |
tree | c1cb28798d5dad24054054be601f483a92a5dd57 | |
parent | d0dd5209d981a9705ea87c5e86211e8f0709bb7c (diff) | |
download | gcc-0ebb72c85d0c10fd1479f35ebfd34d505f095664.zip gcc-0ebb72c85d0c10fd1479f35ebfd34d505f095664.tar.gz gcc-0ebb72c85d0c10fd1479f35ebfd34d505f095664.tar.bz2 |
a-textio.ads, [...] (Write): Add explicit size clause for the C imported variable.
2007-04-20 Thomas Quinot <quinot@adacore.com>
* a-textio.ads, a-textio.adb (Write): Add explicit size clause for the
C imported variable.
(Skip_Line): Do not reset Before_LM_PM immediately when Before_LM is set
on entry.
From-SVN: r125380
-rw-r--r-- | gcc/ada/a-textio.adb | 21 | ||||
-rw-r--r-- | gcc/ada/a-textio.ads | 2 |
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb index aa566da..86a4986 100644 --- a/gcc/ada/a-textio.adb +++ b/gcc/ada/a-textio.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2007, 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- -- @@ -37,8 +37,8 @@ with Interfaces.C_Streams; use Interfaces.C_Streams; with System.File_IO; with System.CRTL; -with Unchecked_Conversion; -with Unchecked_Deallocation; +with Ada.Unchecked_Conversion; +with Ada.Unchecked_Deallocation; pragma Elaborate_All (System.File_IO); -- Needed because of calls to Chain_File in package body elaboration @@ -49,8 +49,8 @@ package body Ada.Text_IO is subtype AP is FCB.AFCB_Ptr; - function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode); - function To_TIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode); + function To_FCB is new Ada.Unchecked_Conversion (File_Mode, FCB.File_Mode); + function To_TIO is new Ada.Unchecked_Conversion (FCB.File_Mode, File_Mode); use type FCB.File_Mode; use type System.CRTL.size_t; @@ -95,7 +95,7 @@ package body Ada.Text_IO is type FCB_Ptr is access all Text_AFCB; FT : FCB_Ptr := FCB_Ptr (File); - procedure Free is new Unchecked_Deallocation (Text_AFCB, FCB_Ptr); + procedure Free is new Ada.Unchecked_Deallocation (Text_AFCB, FCB_Ptr); begin Free (FT); @@ -1577,7 +1577,12 @@ package body Ada.Text_IO is for L in 1 .. Spacing loop if File.Before_LM then File.Before_LM := False; - File.Before_LM_PM := False; + + -- Note that if File.Before_LM_PM is currently set, we also have + -- to reset it (because it makes sense for Before_LM_PM to be set + -- only when Before_LM is also set). This is done later on in this + -- subprogram, as soon as Before_LM_PM has been taken into account + -- for the purpose of page and line counts. else ch := Getc (File); @@ -1805,13 +1810,13 @@ package body Ada.Text_IO is (File : in out Text_AFCB; Item : Stream_Element_Array) is - function Has_Translated_Characters return Boolean; -- return True if Item array contains a character which will be -- translated under the text file mode. There is only one such -- character under DOS based systems which is character 10. text_translation_required : Boolean; + for text_translation_required'Size use Character'Size; pragma Import (C, text_translation_required, "__gnat_text_translation_required"); diff --git a/gcc/ada/a-textio.ads b/gcc/ada/a-textio.ads index dec8ee7..5e8ae4d 100644 --- a/gcc/ada/a-textio.ads +++ b/gcc/ada/a-textio.ads @@ -353,7 +353,7 @@ private -- the Self field of the corresponding file. Before_LM : Boolean := False; - -- This flag is used to deal with the anomolies introduced by the + -- This flag is used to deal with the anomalies introduced by the -- peculiar definition of End_Of_File and End_Of_Page in Ada. These -- functions require looking ahead more than one character. Since -- there is no convenient way of backing up more than one character, |