a-coinve.adb, [...]: Minor reformatting.
2011-12-02 Robert Dewar <dewar@adacore.com> * a-coinve.adb, a-coorma.adb, freeze.adb, a-coorse.adb, a-comutr.adb, a-coormu.adb, a-convec.adb: Minor reformatting. From-SVN: r181913
This commit is contained in:
parent
e47e21c129
commit
35fae080e6
|
@ -1,3 +1,8 @@
|
|||
2011-12-02 Robert Dewar <dewar@adacore.com>
|
||||
|
||||
* a-coinve.adb, a-coorma.adb, freeze.adb, a-coorse.adb, a-comutr.adb,
|
||||
a-coormu.adb, a-convec.adb: Minor reformatting.
|
||||
|
||||
2011-12-02 Matthew Heaney <heaney@adacore.com>
|
||||
|
||||
* a-coormu.ads, a-ciormu.ads: Declare iterator factory function.
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
with Ada.Containers.Generic_Array_Sort;
|
||||
with Ada.Unchecked_Deallocation;
|
||||
|
||||
with System; use type System.Address;
|
||||
|
||||
package body Ada.Containers.Indefinite_Vectors is
|
||||
|
@ -1112,7 +1113,6 @@ package body Ada.Containers.Indefinite_Vectors is
|
|||
if Object.Container /= null then
|
||||
declare
|
||||
B : Natural renames Object.Container.all.Busy;
|
||||
|
||||
begin
|
||||
B := B - 1;
|
||||
end;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
with Ada.Unchecked_Conversion;
|
||||
with Ada.Unchecked_Deallocation;
|
||||
|
||||
with System; use type System.Address;
|
||||
|
||||
package body Ada.Containers.Multiway_Trees is
|
||||
|
@ -913,7 +914,6 @@ package body Ada.Containers.Multiway_Trees is
|
|||
if Object.Container /= null then
|
||||
declare
|
||||
B : Natural renames Object.Container.all.Busy;
|
||||
|
||||
begin
|
||||
B := B - 1;
|
||||
end;
|
||||
|
@ -925,7 +925,6 @@ package body Ada.Containers.Multiway_Trees is
|
|||
if Object.Container /= null then
|
||||
declare
|
||||
B : Natural renames Object.Container.all.Busy;
|
||||
|
||||
begin
|
||||
B := B - 1;
|
||||
end;
|
||||
|
@ -942,13 +941,12 @@ package body Ada.Containers.Multiway_Trees is
|
|||
is
|
||||
N : constant Tree_Node_Access :=
|
||||
Find_In_Children (Root_Node (Container), Item);
|
||||
|
||||
begin
|
||||
if N = null then
|
||||
return No_Element;
|
||||
else
|
||||
return Cursor'(Container'Unrestricted_Access, N);
|
||||
end if;
|
||||
|
||||
return Cursor'(Container'Unrestricted_Access, N);
|
||||
end Find;
|
||||
|
||||
-----------
|
||||
|
@ -1071,11 +1069,8 @@ package body Ada.Containers.Multiway_Trees is
|
|||
|
||||
function Has_Element (Position : Cursor) return Boolean is
|
||||
begin
|
||||
if Position = No_Element then
|
||||
return False;
|
||||
end if;
|
||||
|
||||
return Position.Node.Parent /= null;
|
||||
return (if Position = No_Element then False
|
||||
else Position.Node.Parent /= null);
|
||||
end Has_Element;
|
||||
|
||||
------------------
|
||||
|
@ -1325,11 +1320,8 @@ package body Ada.Containers.Multiway_Trees is
|
|||
|
||||
function Is_Leaf (Position : Cursor) return Boolean is
|
||||
begin
|
||||
if Position = No_Element then
|
||||
return False;
|
||||
end if;
|
||||
|
||||
return Position.Node.Children.First = null;
|
||||
return (if Position = No_Element then False
|
||||
else Position.Node.Children.First = null);
|
||||
end Is_Leaf;
|
||||
|
||||
------------------
|
||||
|
@ -1361,11 +1353,8 @@ package body Ada.Containers.Multiway_Trees is
|
|||
|
||||
function Is_Root (Position : Cursor) return Boolean is
|
||||
begin
|
||||
if Position.Container = null then
|
||||
return False;
|
||||
end if;
|
||||
|
||||
return Position = Root (Position.Container.all);
|
||||
return (if Position.Container = null then False
|
||||
else Position = Root (Position.Container.all));
|
||||
end Is_Root;
|
||||
|
||||
-------------
|
||||
|
@ -1400,7 +1389,6 @@ package body Ada.Containers.Multiway_Trees is
|
|||
B : Natural renames Container'Unrestricted_Access.all.Busy;
|
||||
RC : constant Cursor :=
|
||||
(Container'Unrestricted_Access, Root_Node (Container));
|
||||
|
||||
begin
|
||||
return It : constant Iterator :=
|
||||
Iterator'(Limited_Controlled with
|
||||
|
@ -1474,7 +1462,6 @@ package body Ada.Containers.Multiway_Trees is
|
|||
return Tree_Iterator_Interfaces.Reversible_Iterator'Class
|
||||
is
|
||||
B : Natural renames Container'Unrestricted_Access.all.Busy;
|
||||
|
||||
begin
|
||||
return It : constant Child_Iterator :=
|
||||
Child_Iterator'(Limited_Controlled with
|
||||
|
@ -1494,7 +1481,6 @@ package body Ada.Containers.Multiway_Trees is
|
|||
return Tree_Iterator_Interfaces.Forward_Iterator'Class
|
||||
is
|
||||
B : Natural renames Position.Container'Unrestricted_Access.all.Busy;
|
||||
|
||||
begin
|
||||
return It : constant Iterator :=
|
||||
Iterator'(Limited_Controlled with
|
||||
|
@ -1635,7 +1621,7 @@ package body Ada.Containers.Multiway_Trees is
|
|||
begin
|
||||
if Is_Leaf (Position) then
|
||||
|
||||
-- If sibling is present, return it.
|
||||
-- If sibling is present, return it
|
||||
|
||||
if N.Next /= null then
|
||||
return (Object.Container, N.Next);
|
||||
|
@ -1650,7 +1636,7 @@ package body Ada.Containers.Multiway_Trees is
|
|||
begin
|
||||
while Par.Next = null loop
|
||||
|
||||
-- If we are back at the root the iteration is complete.
|
||||
-- If we are back at the root the iteration is complete
|
||||
|
||||
if Par = Root_Node (T) then
|
||||
return No_Element;
|
||||
|
@ -1679,7 +1665,7 @@ package body Ada.Containers.Multiway_Trees is
|
|||
end if;
|
||||
|
||||
else
|
||||
-- If an internal node, return its first child.
|
||||
-- If an internal node, return its first child
|
||||
|
||||
return (Object.Container, N.Children.First);
|
||||
end if;
|
||||
|
@ -1790,7 +1776,7 @@ package body Ada.Containers.Multiway_Trees is
|
|||
|
||||
for J in Count_Type'(2) .. Count loop
|
||||
|
||||
-- Reclaim other nodes if Storage_Error. ???
|
||||
-- Reclaim other nodes if Storage_Error???
|
||||
|
||||
Last.Next := new Tree_Node_Type'(Parent => Parent.Node,
|
||||
Prev => Last,
|
||||
|
@ -2044,8 +2030,8 @@ package body Ada.Containers.Multiway_Trees is
|
|||
C : Children_Type renames Subtree.Parent.Children;
|
||||
|
||||
begin
|
||||
-- This is a utility operation to remove a subtree
|
||||
-- node from its parent's list of children.
|
||||
-- This is a utility operation to remove a subtree node from its
|
||||
-- parent's list of children.
|
||||
|
||||
if C.First = Subtree then
|
||||
pragma Assert (Subtree.Prev = null);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
with Ada.Containers.Generic_Array_Sort;
|
||||
with Ada.Unchecked_Deallocation;
|
||||
|
||||
with System; use type System.Address;
|
||||
|
||||
package body Ada.Containers.Vectors is
|
||||
|
@ -785,7 +786,6 @@ package body Ada.Containers.Vectors is
|
|||
if Object.Container /= null then
|
||||
declare
|
||||
B : Natural renames Object.Container.all.Busy;
|
||||
|
||||
begin
|
||||
B := B - 1;
|
||||
end;
|
||||
|
@ -923,7 +923,6 @@ package body Ada.Containers.Vectors is
|
|||
J : Index_Type'Base;
|
||||
|
||||
begin
|
||||
|
||||
-- The semantics of Merge changed slightly per AI05-0021. It was
|
||||
-- originally the case that if Target and Source denoted the same
|
||||
-- container object, then the GNAT implementation of Merge did
|
||||
|
@ -1489,8 +1488,8 @@ package body Ada.Containers.Vectors is
|
|||
K : Index_Type'Base;
|
||||
|
||||
begin
|
||||
-- We next copy the source items that follow the space we
|
||||
-- inserted. Index value K is the first index of that portion of the
|
||||
-- We next copy the source items that follow the space we inserted.
|
||||
-- Index value K is the first index of that portion of the
|
||||
-- destination that receives this slice of the source. (For the
|
||||
-- reasons given above, this slice is guaranteed to be non-empty.)
|
||||
|
||||
|
|
|
@ -499,7 +499,6 @@ package body Ada.Containers.Ordered_Maps is
|
|||
if Object.Container /= null then
|
||||
declare
|
||||
B : Natural renames Object.Container.all.Tree.Busy;
|
||||
|
||||
begin
|
||||
B := B - 1;
|
||||
end;
|
||||
|
@ -512,13 +511,9 @@ package body Ada.Containers.Ordered_Maps is
|
|||
|
||||
function Find (Container : Map; Key : Key_Type) return Cursor is
|
||||
Node : constant Node_Access := Key_Ops.Find (Container.Tree, Key);
|
||||
|
||||
begin
|
||||
if Node = null then
|
||||
return No_Element;
|
||||
end if;
|
||||
|
||||
return Cursor'(Container'Unrestricted_Access, Node);
|
||||
return (if Node = null then No_Element
|
||||
else Cursor'(Container'Unrestricted_Access, Node));
|
||||
end Find;
|
||||
|
||||
-----------
|
||||
|
@ -778,10 +773,8 @@ package body Ada.Containers.Ordered_Maps is
|
|||
begin
|
||||
if L.Key < R.Key then
|
||||
return False;
|
||||
|
||||
elsif R.Key < L.Key then
|
||||
return False;
|
||||
|
||||
else
|
||||
return L.Element = R.Element;
|
||||
end if;
|
||||
|
|
|
@ -1555,11 +1555,8 @@ package body Ada.Containers.Ordered_Multisets is
|
|||
Node : constant Node_Access :=
|
||||
Tree_Operations.Previous (Position.Node);
|
||||
begin
|
||||
if Node = null then
|
||||
return No_Element;
|
||||
end if;
|
||||
|
||||
return Cursor'(Position.Container, Node);
|
||||
return (if Node = null then No_Element
|
||||
else Cursor'(Position.Container, Node));
|
||||
end;
|
||||
end Previous;
|
||||
|
||||
|
|
|
@ -523,7 +523,6 @@ package body Ada.Containers.Ordered_Sets is
|
|||
if Object.Container /= null then
|
||||
declare
|
||||
B : Natural renames Object.Container.all.Tree.Busy;
|
||||
|
||||
begin
|
||||
B := B - 1;
|
||||
end;
|
||||
|
|
|
@ -1356,6 +1356,14 @@ package body Freeze is
|
|||
Bod : constant Node_Id := Next (After);
|
||||
|
||||
begin
|
||||
-- The presence of a body freezes all entities previously
|
||||
-- declared in the current list of declarations, but this
|
||||
-- does not apply if the body does not come from source.
|
||||
-- A type invariant is transformed into a subprogram body
|
||||
-- which is placed at the end of the private part of the
|
||||
-- current package, but this body does not freeze incomplete
|
||||
-- types that may be declared in this private part.
|
||||
|
||||
if (Nkind_In (Bod, N_Subprogram_Body,
|
||||
N_Entry_Body,
|
||||
N_Package_Body,
|
||||
|
@ -1363,7 +1371,7 @@ package body Freeze is
|
|||
N_Task_Body)
|
||||
or else Nkind (Bod) in N_Body_Stub)
|
||||
and then
|
||||
List_Containing (After) = List_Containing (Parent (E))
|
||||
List_Containing (After) = List_Containing (Parent (E))
|
||||
and then Comes_From_Source (Bod)
|
||||
then
|
||||
Error_Msg_Sloc := Sloc (Next (After));
|
||||
|
|
Loading…
Reference in New Issue