diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-30 15:15:00 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-30 15:15:00 +0000 |
commit | 2beb22b15d7d2e8f781929a08cc8b6f31ec516e6 (patch) | |
tree | 10b4ccca210f1b877b9404f282c4e6fd1996100a /gcc/ada/a-cihase.adb | |
parent | 7c3537be7ec41897478ec5b892df75ceb71c6980 (diff) | |
download | gcc-2beb22b15d7d2e8f781929a08cc8b6f31ec516e6.tar.gz |
2012-07-30 Robert Dewar <dewar@adacore.com>
* par_sco.adb, a-cihama.adb, a-coinve.adb, exp_ch7.adb, a-ciorse.adb,
exp_ch9.adb, sem_dim.adb, par-ch13.adb, sem_ch9.adb, a-cidlli.adb,
a-cimutr.adb, freeze.adb, a-ciormu.adb, sem_res.adb, sem_attr.adb,
a-cihase.adb, exp_ch4.adb, sem_ch4.adb, a-ciorma.adb,
s-tasinf-linux.ads, sem_ch13.adb, a-coinho.adb: Minor reformatting.
Add comments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189977 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-cihase.adb')
-rw-r--r-- | gcc/ada/a-cihase.adb | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/gcc/ada/a-cihase.adb b/gcc/ada/a-cihase.adb index 034cfce67ec..9d96b6c6452 100644 --- a/gcc/ada/a-cihase.adb +++ b/gcc/ada/a-cihase.adb @@ -186,10 +186,12 @@ package body Ada.Containers.Indefinite_Hashed_Sets is procedure Assign (Node : Node_Access; Item : Element_Type) is X : Element_Access := Node.Element; - pragma Unsuppress (Accessibility_Check); -- The element allocator may need an accessibility check in the case the -- actual type is class-wide or has access discriminants (RM 4.8(10.1) -- and AI12-0035). + + pragma Unsuppress (Accessibility_Check); + begin Node.Element := new Element_Type'(Item); Free_Element (X); @@ -199,10 +201,10 @@ package body Ada.Containers.Indefinite_Hashed_Sets is begin if Target'Address = Source'Address then return; + else + Target.Clear; + Target.Union (Source); end if; - - Target.Clear; - Target.Union (Source); end Assign; -------------- @@ -813,10 +815,12 @@ package body Ada.Containers.Indefinite_Hashed_Sets is X := Position.Node.Element; declare - pragma Unsuppress (Accessibility_Check); -- The element allocator may need an accessibility check in the -- case the actual type is class-wide or has access discriminants -- (see RM 4.8(10.1) and AI12-0035). + + pragma Unsuppress (Accessibility_Check); + begin Position.Node.Element := new Element_Type'(New_Item); end; @@ -875,14 +879,18 @@ package body Ada.Containers.Indefinite_Hashed_Sets is -------------- function New_Node (Next : Node_Access) return Node_Access is - pragma Unsuppress (Accessibility_Check); + -- The element allocator may need an accessibility check in the case -- the actual type is class-wide or has access discriminants (see -- RM 4.8(10.1) and AI12-0035). + pragma Unsuppress (Accessibility_Check); + Element : Element_Access := new Element_Type'(New_Item); + begin return new Node_Type'(Element, Next); + exception when others => Free_Element (Element); @@ -898,9 +906,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is Local_Insert (HT, New_Item, Node, Inserted); - if Inserted - and then HT.Length > HT_Ops.Capacity (HT) - then + if Inserted and then HT.Length > HT_Ops.Capacity (HT) then HT_Ops.Reserve_Capacity (HT, HT.Length); end if; end Insert; @@ -1335,10 +1341,12 @@ package body Ada.Containers.Indefinite_Hashed_Sets is X := Node.Element; declare - pragma Unsuppress (Accessibility_Check); -- The element allocator may need an accessibility check in the case -- the actual type is class-wide or has access discriminants (see -- RM 4.8(10.1) and AI12-0035). + + pragma Unsuppress (Accessibility_Check); + begin Node.Element := new Element_Type'(New_Item); end; |