diff options
author | Matthew Heaney <heaney@adacore.com> | 2005-09-05 10:05:32 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-09-05 10:05:32 +0200 |
commit | ba355842e8ff8cbcb8552b99f6098b333512cc81 (patch) | |
tree | 7b4be4425a576dfefafcfd6533af08d710bea8f0 /gcc/ada/a-ciorse.adb | |
parent | c1cd0d96753eff81ceba44eaa371931e993e539d (diff) | |
download | gcc-ba355842e8ff8cbcb8552b99f6098b333512cc81.zip gcc-ba355842e8ff8cbcb8552b99f6098b333512cc81.tar.gz gcc-ba355842e8ff8cbcb8552b99f6098b333512cc81.tar.bz2 |
a-cihase.adb, [...]: Synchronized with latest draft (Draft 13, August 2005) of Ada Amendment 1.
2005-09-01 Matthew Heaney <heaney@adacore.com>
* a-cihase.adb, a-coorse.ads, a-coorse.adb, a-cohama.adb,
a-ciorse.ads, a-ciorse.adb, a-cihama.adb, a-cdlili.adb,
a-cidlli.adb, a-chtgop.adb, a-cihase.adb, a-cihase.ads,
a-cohase.adb, a-cohase.adb, a-cohase.ads: Synchronized with latest
draft (Draft 13, August 2005) of Ada Amendment 1.
From-SVN: r103892
Diffstat (limited to 'gcc/ada/a-ciorse.adb')
-rw-r--r-- | gcc/ada/a-ciorse.adb | 78 |
1 files changed, 37 insertions, 41 deletions
diff --git a/gcc/ada/a-ciorse.adb b/gcc/ada/a-ciorse.adb index ed42d01..2de8cda 100644 --- a/gcc/ada/a-ciorse.adb +++ b/gcc/ada/a-ciorse.adb @@ -369,6 +369,21 @@ package body Ada.Containers.Indefinite_Ordered_Sets is return Position.Node.Element.all; end Element; + ------------------------- + -- Equivalent_Elements -- + ------------------------- + + function Equivalent_Elements (Left, Right : Element_Type) return Boolean is + begin + if Left < Right + or else Right < Left + then + return False; + else + return True; + end if; + end Equivalent_Elements; + --------------------- -- Equivalent_Sets -- --------------------- @@ -528,34 +543,6 @@ package body Ada.Containers.Indefinite_Ordered_Sets is Is_Less_Key_Node => Is_Less_Key_Node, Is_Greater_Key_Node => Is_Greater_Key_Node); - --------- - -- "<" -- - --------- - - function "<" (Left : Key_Type; Right : Cursor) return Boolean is - begin - return Left < Right.Node.Element.all; - end "<"; - - function "<" (Left : Cursor; Right : Key_Type) return Boolean is - begin - return Right > Left.Node.Element.all; - end "<"; - - --------- - -- ">" -- - --------- - - function ">" (Left : Key_Type; Right : Cursor) return Boolean is - begin - return Left > Right.Node.Element.all; - end ">"; - - function ">" (Left : Cursor; Right : Key_Type) return Boolean is - begin - return Right < Left.Node.Element.all; - end ">"; - ------------- -- Ceiling -- ------------- @@ -609,6 +596,21 @@ package body Ada.Containers.Indefinite_Ordered_Sets is return Node.Element.all; end Element; + --------------------- + -- Equivalent_Keys -- + --------------------- + + function Equivalent_Keys (Left, Right : Key_Type) return Boolean is + begin + if Left < Right + or else Right < Left + then + return False; + else + return True; + end if; + end Equivalent_Keys; + ------------- -- Exclude -- ------------- @@ -663,7 +665,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is (Left : Key_Type; Right : Node_Access) return Boolean is begin - return Left > Right.Element.all; + return Key (Right.Element.all) < Left; end Is_Greater_Key_Node; ---------------------- @@ -674,7 +676,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is (Left : Key_Type; Right : Node_Access) return Boolean is begin - return Left < Right.Element.all; + return Left < Key (Right.Element.all); end Is_Less_Key_Node; --------- @@ -728,7 +730,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is declare E : Element_Type renames Position.Node.Element.all; - K : Key_Type renames Key (E); + K : constant Key_Type := Key (E); B : Natural renames Tree.Busy; L : Natural renames Tree.Lock; @@ -749,11 +751,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is L := L - 1; B := B - 1; - if K < E - or else K > E - then - null; - else + if Equivalent_Keys (K, Key (E)) then return; end if; end; @@ -1365,12 +1363,10 @@ package body Ada.Containers.Indefinite_Ordered_Sets is end Replace_Element; procedure Replace_Element - (Container : Set; + (Container : in out Set; Position : Cursor; - By : Element_Type) + New_Item : Element_Type) is - Tree : Tree_Type renames Position.Container.Tree'Unrestricted_Access.all; - begin if Position.Node = null then raise Constraint_Error; @@ -1380,7 +1376,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is raise Program_Error; end if; - Replace_Element (Tree, Position.Node, By); + Replace_Element (Container.Tree, Position.Node, New_Item); end Replace_Element; --------------------- |