Commit 0ebb72c8 by Thomas Quinot Committed by Arnaud Charlet

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
parent d0dd5209
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- 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; ...@@ -37,8 +37,8 @@ with Interfaces.C_Streams; use Interfaces.C_Streams;
with System.File_IO; with System.File_IO;
with System.CRTL; with System.CRTL;
with Unchecked_Conversion; with Ada.Unchecked_Conversion;
with Unchecked_Deallocation; with Ada.Unchecked_Deallocation;
pragma Elaborate_All (System.File_IO); pragma Elaborate_All (System.File_IO);
-- Needed because of calls to Chain_File in package body elaboration -- Needed because of calls to Chain_File in package body elaboration
...@@ -49,8 +49,8 @@ package body Ada.Text_IO is ...@@ -49,8 +49,8 @@ package body Ada.Text_IO is
subtype AP is FCB.AFCB_Ptr; subtype AP is FCB.AFCB_Ptr;
function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode); function To_FCB is new Ada.Unchecked_Conversion (File_Mode, FCB.File_Mode);
function To_TIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode); function To_TIO is new Ada.Unchecked_Conversion (FCB.File_Mode, File_Mode);
use type FCB.File_Mode; use type FCB.File_Mode;
use type System.CRTL.size_t; use type System.CRTL.size_t;
...@@ -95,7 +95,7 @@ package body Ada.Text_IO is ...@@ -95,7 +95,7 @@ package body Ada.Text_IO is
type FCB_Ptr is access all Text_AFCB; type FCB_Ptr is access all Text_AFCB;
FT : FCB_Ptr := FCB_Ptr (File); 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 begin
Free (FT); Free (FT);
...@@ -1577,7 +1577,12 @@ package body Ada.Text_IO is ...@@ -1577,7 +1577,12 @@ package body Ada.Text_IO is
for L in 1 .. Spacing loop for L in 1 .. Spacing loop
if File.Before_LM then if File.Before_LM then
File.Before_LM := False; 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 else
ch := Getc (File); ch := Getc (File);
...@@ -1805,13 +1810,13 @@ package body Ada.Text_IO is ...@@ -1805,13 +1810,13 @@ package body Ada.Text_IO is
(File : in out Text_AFCB; (File : in out Text_AFCB;
Item : Stream_Element_Array) Item : Stream_Element_Array)
is is
function Has_Translated_Characters return Boolean; function Has_Translated_Characters return Boolean;
-- return True if Item array contains a character which will be -- return True if Item array contains a character which will be
-- translated under the text file mode. There is only one such -- translated under the text file mode. There is only one such
-- character under DOS based systems which is character 10. -- character under DOS based systems which is character 10.
text_translation_required : Boolean; text_translation_required : Boolean;
for text_translation_required'Size use Character'Size;
pragma Import (C, text_translation_required, pragma Import (C, text_translation_required,
"__gnat_text_translation_required"); "__gnat_text_translation_required");
......
...@@ -353,7 +353,7 @@ private ...@@ -353,7 +353,7 @@ private
-- the Self field of the corresponding file. -- the Self field of the corresponding file.
Before_LM : Boolean := False; 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 -- peculiar definition of End_Of_File and End_Of_Page in Ada. These
-- functions require looking ahead more than one character. Since -- functions require looking ahead more than one character. Since
-- there is no convenient way of backing up more than one character, -- there is no convenient way of backing up more than one character,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment