mirror of git://gcc.gnu.org/git/gcc.git
a-rbtgbo.adb, [...]: Minor reformatting.
2011-08-31 Robert Dewar <dewar@adacore.com> * a-rbtgbo.adb, alfa_test.adb: Minor reformatting. From-SVN: r178366
This commit is contained in:
parent
36b8f95fd0
commit
876d4394d2
|
|
@ -1,3 +1,7 @@
|
|||
2011-08-31 Robert Dewar <dewar@adacore.com>
|
||||
|
||||
* a-rbtgbo.adb, alfa_test.adb: Minor reformatting.
|
||||
|
||||
2011-08-31 Tristan Gingold <gingold@adacore.com>
|
||||
|
||||
* exp_ch7.ads, exp_ch7.adb (Finalization_Exception_Data): New type to
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
Node : Count_Type)
|
||||
is
|
||||
|
||||
-- CLR p274
|
||||
-- CLR p. 274
|
||||
|
||||
X : Count_Type;
|
||||
W : Count_Type;
|
||||
|
|
@ -187,7 +187,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
(Tree : in out Tree_Type'Class;
|
||||
Node : Count_Type)
|
||||
is
|
||||
-- CLR p273
|
||||
-- CLR p. 273
|
||||
|
||||
X, Y : Count_Type;
|
||||
|
||||
|
|
@ -333,6 +333,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
Set_Left (N (Y), Left (N (Z)));
|
||||
Set_Parent (N (Left (N (Y))), Y);
|
||||
Set_Right (N (Y), Z);
|
||||
|
||||
Set_Parent (N (Z), Y);
|
||||
Set_Left (N (Z), 0);
|
||||
Set_Right (N (Z), 0);
|
||||
|
|
@ -526,11 +527,10 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
-- node onto the head of the free store.
|
||||
|
||||
-- ???
|
||||
-- See the comments above for an optimization opportunity. If
|
||||
-- the next link for a node on the free store is negative, then
|
||||
-- this means the remaining nodes on the free store are
|
||||
-- physically contiguous, starting as the absolute value of
|
||||
-- that index value.
|
||||
-- See the comments above for an optimization opportunity. If the
|
||||
-- next link for a node on the free store is negative, then this
|
||||
-- means the remaining nodes on the free store are physically
|
||||
-- contiguous, starting as the absolute value of that index value.
|
||||
|
||||
Tree.Free := abs Tree.Free;
|
||||
|
||||
|
|
@ -587,6 +587,11 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
Tree.Free := Tree.Free - 1;
|
||||
end if;
|
||||
|
||||
-- When a node is allocated from the free store, its pointer components
|
||||
-- (the links to other nodes in the tree) must also be initialized (to
|
||||
-- 0, the equivalent of null). This simplifies the post-allocation
|
||||
-- handling of nodes inserted into terminal positions.
|
||||
|
||||
Set_Parent (N (Node), Parent => 0);
|
||||
Set_Left (N (Node), Left => 0);
|
||||
Set_Right (N (Node), Right => 0);
|
||||
|
|
@ -747,8 +752,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
procedure Process (Node : Count_Type);
|
||||
pragma Inline (Process);
|
||||
|
||||
procedure Iterate is
|
||||
new Generic_Iteration (Process);
|
||||
procedure Iterate is new Generic_Iteration (Process);
|
||||
|
||||
-------------
|
||||
-- Process --
|
||||
|
|
@ -771,7 +775,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
-----------------
|
||||
|
||||
procedure Left_Rotate (Tree : in out Tree_Type'Class; X : Count_Type) is
|
||||
-- CLR p266
|
||||
-- CLR p. 266
|
||||
|
||||
N : Nodes_Type renames Tree.Nodes;
|
||||
|
||||
|
|
@ -808,7 +812,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
(Tree : Tree_Type'Class;
|
||||
Node : Count_Type) return Count_Type
|
||||
is
|
||||
-- CLR p248
|
||||
-- CLR p. 248
|
||||
|
||||
X : Count_Type := Node;
|
||||
Y : Count_Type;
|
||||
|
|
@ -833,7 +837,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
(Tree : Tree_Type'Class;
|
||||
Node : Count_Type) return Count_Type
|
||||
is
|
||||
-- CLR p248
|
||||
-- CLR p. 248
|
||||
|
||||
X : Count_Type := Node;
|
||||
Y : Count_Type;
|
||||
|
|
@ -859,7 +863,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
|
|||
Node : Count_Type) return Count_Type
|
||||
is
|
||||
begin
|
||||
-- CLR p249
|
||||
-- CLR p. 249
|
||||
|
||||
if Node = 0 then
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue