Commit fc475a08 by Arnaud Charlet

[multiple changes]

2009-10-28  Vincent Celier  <celier@adacore.com>

	* prj-nmsc.adb (Add_To_Or_Remove_From_List): New name of procedure
	Add_If_Not_In_List to account to the fact that a directory may be
	removed from the list. Only remove directory if Removed is True.

2009-10-28  Gary Dismukes  <dismukes@adacore.com>

	* a-textio.ads, a-textio.ads: Put back function EOF_Char in private
	part. Put back body of function EOF_Char.
	* a-tienau.adb: Remove with of Interfaces.C_Streams and change EOF back
	to EOF_Char.

2009-10-28  Emmanuel Briot  <briot@adacore.com>

	* prj-tree.adb (Free): Fix memory leak.

2009-10-28  Thomas Quinot  <quinot@adacore.com>

	* s-fileio.adb: Minor reformatting

From-SVN: r153661
parent 4d8f8ffe
2009-10-28 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Add_To_Or_Remove_From_List): New name of procedure
Add_If_Not_In_List to account to the fact that a directory may be
removed from the list. Only remove directory if Removed is True.
2009-10-28 Gary Dismukes <dismukes@adacore.com>
* a-textio.ads, a-textio.ads: Put back function EOF_Char in private
part. Put back body of function EOF_Char.
* a-tienau.adb: Remove with of Interfaces.C_Streams and change EOF back
to EOF_Char.
2009-10-28 Emmanuel Briot <briot@adacore.com>
* prj-tree.adb (Free): Fix memory leak.
2009-10-28 Thomas Quinot <quinot@adacore.com>
* s-fileio.adb: Minor reformatting
2009-10-28 Arnaud Charlet <charlet@adacore.com> 2009-10-28 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/Make-lang.in: Update dependencies. * gcc-interface/Make-lang.in: Update dependencies.
......
...@@ -437,6 +437,15 @@ package body Ada.Text_IO is ...@@ -437,6 +437,15 @@ package body Ada.Text_IO is
return End_Of_Page (Current_In); return End_Of_Page (Current_In);
end End_Of_Page; end End_Of_Page;
--------------
-- EOF_Char --
--------------
function EOF_Char return Integer is
begin
return EOF;
end EOF_Char;
----------- -----------
-- Flush -- -- Flush --
----------- -----------
......
...@@ -458,6 +458,12 @@ private ...@@ -458,6 +458,12 @@ private
Current_Err : aliased File_Type := Standard_Err; Current_Err : aliased File_Type := Standard_Err;
-- Current files -- Current files
function EOF_Char return Integer;
-- Returns the system-specific character indicating the end of a text file.
-- This is exported for use by child packages such as Enumeration_Aux to
-- eliminate their needing to depend directly on Interfaces.C_Streams,
-- which is not available in certain target environments (such as AAMP).
procedure Initialize_Standard_Files; procedure Initialize_Standard_Files;
-- Initializes the file control blocks for the standard files. Called from -- Initializes the file control blocks for the standard files. Called from
-- the elaboration routine for this package, and from Reset_Standard_Files -- the elaboration routine for this package, and from Reset_Standard_Files
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
with Ada.Text_IO.Generic_Aux; use Ada.Text_IO.Generic_Aux; with Ada.Text_IO.Generic_Aux; use Ada.Text_IO.Generic_Aux;
with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Characters.Handling; use Ada.Characters.Handling;
with Interfaces.C_Streams; use Interfaces.C_Streams;
-- Note: this package does not yet deal properly with wide characters ??? -- Note: this package does not yet deal properly with wide characters ???
package body Ada.Text_IO.Enumeration_Aux is package body Ada.Text_IO.Enumeration_Aux is
...@@ -100,7 +98,7 @@ package body Ada.Text_IO.Enumeration_Aux is ...@@ -100,7 +98,7 @@ package body Ada.Text_IO.Enumeration_Aux is
Store_Char (File, Character'Pos (To_Upper (C)), Buf, Buflen); Store_Char (File, Character'Pos (To_Upper (C)), Buf, Buflen);
ch := Getc (File); ch := Getc (File);
exit when ch = EOF; exit when ch = EOF_Char;
C := Character'Val (ch); C := Character'Val (ch);
exit when not Is_Letter (C) exit when not Is_Letter (C)
......
...@@ -4708,21 +4708,22 @@ package body Prj.Nmsc is ...@@ -4708,21 +4708,22 @@ package body Prj.Nmsc is
is is
Directory : constant String := Get_Name_String (From); Directory : constant String := Get_Name_String (From);
procedure Add_If_Not_In_List procedure Add_To_Or_Remove_From_List
(Path_Id : Name_Id; (Path_Id : Name_Id;
Display_Path_Id : Name_Id); Display_Path_Id : Name_Id);
-- Add the directory Path_Id to the list of source_dirs if not -- When Removed = False, the directory Path_Id to the list of
-- already in the list. -- source_dirs if not already in the list. When Removed = True,
-- removed directory Path_Id if in the list.
procedure Recursive_Find_Dirs (Path : Name_Id); procedure Recursive_Find_Dirs (Path : Name_Id);
-- Find all the subdirectories (recursively) of Path and add them -- Find all the subdirectories (recursively) of Path and add them
-- to the list of source directories of the project. -- to the list of source directories of the project.
------------------------ --------------------------------
-- Add_If_Not_In_List -- -- Add_To_Or_Remove_From_List --
------------------------ --------------------------------
procedure Add_If_Not_In_List procedure Add_To_Or_Remove_From_List
(Path_Id : Name_Id; (Path_Id : Name_Id;
Display_Path_Id : Name_Id) Display_Path_Id : Name_Id)
is is
...@@ -4794,7 +4795,7 @@ package body Prj.Nmsc is ...@@ -4794,7 +4795,7 @@ package body Prj.Nmsc is
Data.Tree.Number_Lists.Table (Last_Src_Dir_Rank) := Data.Tree.Number_Lists.Table (Last_Src_Dir_Rank) :=
(Number => Rank, Next => No_Number_List); (Number => Rank, Next => No_Number_List);
elsif List /= Nil_String then elsif Removed and then List /= Nil_String then
-- Remove source dir, if present -- Remove source dir, if present
...@@ -4811,7 +4812,7 @@ package body Prj.Nmsc is ...@@ -4811,7 +4812,7 @@ package body Prj.Nmsc is
Data.Tree.Number_Lists.Table (Rank_List).Next; Data.Tree.Number_Lists.Table (Rank_List).Next;
end if; end if;
end if; end if;
end Add_If_Not_In_List; end Add_To_Or_Remove_From_List;
------------------------- -------------------------
-- Recursive_Find_Dirs -- -- Recursive_Find_Dirs --
...@@ -4857,7 +4858,7 @@ package body Prj.Nmsc is ...@@ -4857,7 +4858,7 @@ package body Prj.Nmsc is
end if; end if;
end if; end if;
Add_If_Not_In_List Add_To_Or_Remove_From_List
(Path_Id => Canonical_Path, (Path_Id => Canonical_Path,
Display_Path_Id => Non_Canonical_Path); Display_Path_Id => Non_Canonical_Path);
...@@ -5038,7 +5039,8 @@ package body Prj.Nmsc is ...@@ -5038,7 +5039,8 @@ package body Prj.Nmsc is
Directory => Directory =>
Get_Name_String (Project.Directory.Name), Get_Name_String (Project.Directory.Name),
Resolve_Links => Opt.Follow_Links_For_Dirs, Resolve_Links => Opt.Follow_Links_For_Dirs,
Case_Sensitive => True); Case_Sensitive => True) &
Directory_Separator;
Last_Path : constant Natural := Last_Path : constant Natural :=
Compute_Directory_Last (Path); Compute_Directory_Last (Path);
...@@ -5062,7 +5064,7 @@ package body Prj.Nmsc is ...@@ -5062,7 +5064,7 @@ package body Prj.Nmsc is
(Display_Path'First .. Last_Display_Path)); (Display_Path'First .. Last_Display_Path));
Display_Path_Id := Name_Find; Display_Path_Id := Name_Find;
Add_If_Not_In_List Add_To_Or_Remove_From_List
(Path_Id => Path_Id, (Path_Id => Path_Id,
Display_Path_Id => Display_Path_Id); Display_Path_Id => Display_Path_Id);
end; end;
......
...@@ -23,10 +23,11 @@ ...@@ -23,10 +23,11 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Osint; use Osint; with Osint; use Osint;
with Prj.Err; with Prj.Err;
with Ada.Unchecked_Deallocation;
package body Prj.Tree is package body Prj.Tree is
Node_With_Comments : constant array (Project_Node_Kind) of Boolean := Node_With_Comments : constant array (Project_Node_Kind) of Boolean :=
...@@ -1000,6 +1001,7 @@ package body Prj.Tree is ...@@ -1000,6 +1001,7 @@ package body Prj.Tree is
if Proj /= null then if Proj /= null then
Project_Node_Table.Free (Proj.Project_Nodes); Project_Node_Table.Free (Proj.Project_Nodes);
Projects_Htable.Reset (Proj.Projects_HT); Projects_Htable.Reset (Proj.Projects_HT);
Name_To_Name_HTable.Reset (Proj.External_References);
Free (Proj.Project_Path); Free (Proj.Project_Path);
Unchecked_Free (Proj); Unchecked_Free (Proj);
end if; end if;
......
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