diff options
author | Matthew Heaney <heaney@adacore.com> | 2005-11-15 14:54:02 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-11-15 14:54:02 +0100 |
commit | 2368f04ec19f5d2aa5439e2454217d3135603dd0 (patch) | |
tree | 129bc8844811a17598b415668a54b3f7b4c278d7 /gcc/ada/a-cihama.adb | |
parent | 5e61ef090a8910843dd421fad19eae41c4fca816 (diff) | |
download | gcc-2368f04ec19f5d2aa5439e2454217d3135603dd0.tar.gz |
a-crbtgo.ads, [...]: Compiles against the spec for ordered maps described in sections A.18.6 of the...
2005-11-14 Matthew Heaney <heaney@adacore.com>
* a-crbtgo.ads, a-crbtgo.adb, a-coorse.ads, a-coorse.adb, a-convec.ads,
a-convec.adb, a-coinve.ads, a-coinve.adb, a-cohama.ads, a-cohama.adb,
a-ciorse.ads, a-ciorse.adb, a-cihama.ads, a-cihama.adb, a-cidlli.ads,
a-cidlli.adb, a-cdlili.ads, a-cdlili.adb, a-coormu.adb, a-ciormu.adb,
a-cihase.adb, a-cihase.ads, a-cohase.adb, a-cohase.ads, a-ciorma.ads,
a-coorma.ads, a-ciormu.ads, a-coormu.ads, a-ciorma.adb, a-coorma.adb:
Compiles against the spec for ordered maps described in sections
A.18.6 of the most recent (August 2005) AI-302 draft.
From-SVN: r106962
Diffstat (limited to 'gcc/ada/a-cihama.adb')
-rw-r--r-- | gcc/ada/a-cihama.adb | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/gcc/ada/a-cihama.adb b/gcc/ada/a-cihama.adb index dc5fa0f82cb..3836f7eb035 100644 --- a/gcc/ada/a-cihama.adb +++ b/gcc/ada/a-cihama.adb @@ -7,7 +7,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2005, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -713,6 +713,14 @@ package body Ada.Containers.Indefinite_Hashed_Maps is Read_Nodes (Stream, Container.HT); end Read; + procedure Read + (Stream : access Root_Stream_Type'Class; + Item : out Cursor) + is + begin + raise Program_Error; + end Read; + --------------- -- Read_Node -- --------------- @@ -787,7 +795,11 @@ package body Ada.Containers.Indefinite_Hashed_Maps is -- Replace_Element -- --------------------- - procedure Replace_Element (Position : Cursor; By : Element_Type) is + procedure Replace_Element + (Container : in out Map; + Position : Cursor; + New_Item : Element_Type) + is begin pragma Assert (Vet (Position), "bad cursor in Replace_Element"); @@ -795,6 +807,10 @@ package body Ada.Containers.Indefinite_Hashed_Maps is raise Constraint_Error; end if; + if Position.Container /= Container'Unrestricted_Access then + raise Program_Error; + end if; + if Position.Container.HT.Lock > 0 then raise Program_Error; end if; @@ -803,7 +819,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is X : Element_Access := Position.Node.Element; begin - Position.Node.Element := new Element_Type'(By); + Position.Node.Element := new Element_Type'(New_Item); Free_Element (X); end; end Replace_Element; @@ -834,9 +850,10 @@ package body Ada.Containers.Indefinite_Hashed_Maps is -------------------- procedure Update_Element - (Position : Cursor; - Process : not null access procedure (Key : Key_Type; - Element : in out Element_Type)) + (Container : in out Map; + Position : Cursor; + Process : not null access procedure (Key : Key_Type; + Element : in out Element_Type)) is begin pragma Assert (Vet (Position), "bad cursor in Update_Element"); @@ -845,9 +862,12 @@ package body Ada.Containers.Indefinite_Hashed_Maps is raise Constraint_Error; end if; + if Position.Container /= Container'Unrestricted_Access then + raise Program_Error; + end if; + declare - M : Map renames Position.Container.all; - HT : Hash_Table_Type renames M.HT'Unrestricted_Access.all; + HT : Hash_Table_Type renames Container.HT; B : Natural renames HT.Busy; L : Natural renames HT.Lock; @@ -859,7 +879,6 @@ package body Ada.Containers.Indefinite_Hashed_Maps is declare K : Key_Type renames Position.Node.Key.all; E : Element_Type renames Position.Node.Element.all; - begin Process (K, E); exception @@ -951,6 +970,14 @@ package body Ada.Containers.Indefinite_Hashed_Maps is Write_Nodes (Stream, Container.HT); end Write; + procedure Write + (Stream : access Root_Stream_Type'Class; + Item : Cursor) + is + begin + raise Program_Error; + end Write; + ---------------- -- Write_Node -- ---------------- |