Commit 735ca1b9 by Pascal Obry Committed by Arnaud Charlet

prj.adb: Minor code refactoring.

2011-09-02  Pascal Obry  <obry@adacore.com>

	* prj.adb: Minor code refactoring. Move check for null project in
	Project_Changed.
	* projects.texi: Fix minor typos.

From-SVN: r178444
parent 86828d40
2011-09-02 Pascal Obry <obry@adacore.com>
* prj.adb: Minor code refactoring. Move check for null project in
Project_Changed.
* projects.texi: Fix minor typos.
2011-09-02 Ed Schonberg <schonberg@adacore.com> 2011-09-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): If the domain * sem_ch5.adb (Analyze_Iterator_Specification): If the domain
......
...@@ -366,8 +366,10 @@ package body Prj is ...@@ -366,8 +366,10 @@ package body Prj is
procedure Project_Changed (Iter : in out Source_Iterator) is procedure Project_Changed (Iter : in out Source_Iterator) is
begin begin
Iter.Language := Iter.Project.Project.Languages; if Iter.Project /= null then
Language_Changed (Iter); Iter.Language := Iter.Project.Project.Languages;
Language_Changed (Iter);
end if;
end Project_Changed; end Project_Changed;
---------------------- ----------------------
...@@ -392,9 +394,7 @@ package body Prj is ...@@ -392,9 +394,7 @@ package body Prj is
if Iter.All_Projects then if Iter.All_Projects then
Iter.Project := Iter.Project.Next; Iter.Project := Iter.Project.Next;
if Iter.Project /= null then Project_Changed (Iter);
Project_Changed (Iter);
end if;
else else
Iter.Project := null; Iter.Project := null;
...@@ -493,7 +493,6 @@ package body Prj is ...@@ -493,7 +493,6 @@ package body Prj is
Tree : Project_Tree_Ref) Tree : Project_Tree_Ref)
is is
List : Project_List; List : Project_List;
Agg : Aggregated_Project_List;
begin begin
if not Get (Seen, Project) then if not Get (Seen, Project) then
...@@ -525,12 +524,16 @@ package body Prj is ...@@ -525,12 +524,16 @@ package body Prj is
if Include_Aggregated if Include_Aggregated
and then Project.Qualifier = Aggregate and then Project.Qualifier = Aggregate
then then
Agg := Project.Aggregated_Projects; declare
while Agg /= null loop Agg : Aggregated_Project_List;
pragma Assert (Agg.Project /= No_Project); begin
Recursive_Check (Agg.Project, Agg.Tree); Agg := Project.Aggregated_Projects;
Agg := Agg.Next; while Agg /= null loop
end loop; pragma Assert (Agg.Project /= No_Project);
Recursive_Check (Agg.Project, Agg.Tree);
Agg := Agg.Next;
end loop;
end;
end if; end if;
if Imported_First then if Imported_First then
......
...@@ -2307,7 +2307,7 @@ attributes and packages are forbidden in an aggregate project. Here is the ...@@ -2307,7 +2307,7 @@ attributes and packages are forbidden in an aggregate project. Here is the
@itemize @bullet @itemize @bullet
@item Languages @item Languages
@item Source_files, Source_List_File and other attributes dealing with @item Source_Files, Source_List_File and other attributes dealing with
list of sources. list of sources.
@item Source_Dirs, Exec_Dir and Object_Dir @item Source_Dirs, Exec_Dir and Object_Dir
@item Library_Dir, Library_Name and other library-related attributes @item Library_Dir, Library_Name and other library-related attributes
...@@ -2317,7 +2317,7 @@ attributes and packages are forbidden in an aggregate project. Here is the ...@@ -2317,7 +2317,7 @@ attributes and packages are forbidden in an aggregate project. Here is the
@item Inherit_Source_Path @item Inherit_Source_Path
@item Excluded_Source_Dirs @item Excluded_Source_Dirs
@item Locally_Removed_Files @item Locally_Removed_Files
@item Excluded_Source_Fies @item Excluded_Source_Files
@item Excluded_Source_List_File @item Excluded_Source_List_File
@item Interfaces @item Interfaces
@end itemize @end itemize
......
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