a-coinho.adb, [...]: Fix parameter mode of Update_Element.
authorVadim Godunko <godunko@adacore.com>
Wed, 16 Jul 2014 13:54:43 +0000 (13:54 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 16 Jul 2014 13:54:43 +0000 (15:54 +0200)
2014-07-16  Vadim Godunko  <godunko@adacore.com>

* a-coinho.adb, a-coinho-shared.adb, a-coinho.ads, a-coinho-shared.ads:
Fix parameter mode of Update_Element.

From-SVN: r212644

gcc/ada/ChangeLog
gcc/ada/a-coinho-shared.adb
gcc/ada/a-coinho-shared.ads
gcc/ada/a-coinho.adb
gcc/ada/a-coinho.ads

index 2ff7226..0134a76 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-16  Vadim Godunko  <godunko@adacore.com>
+
+       * a-coinho.adb, a-coinho-shared.adb, a-coinho.ads, a-coinho-shared.ads:
+       Fix parameter mode of Update_Element.
+
 2014-07-16  Robert Dewar  <dewar@adacore.com>
 
        * a-coinho.adb, a-coinho-shared.adb, a-coinho-shared.ads: Minor
index df2d55a..defdf3a 100644 (file)
@@ -67,12 +67,7 @@ package body Ada.Containers.Indefinite_Holders is
    begin
       if Control.Container /= null then
          Reference (Control.Container.Reference);
-
-         declare
-            B : Natural renames Control.Container.Busy;
-         begin
-            B := B + 1;
-         end;
+         Control.Container.Busy := Control.Container.Busy + 1;
       end if;
    end Adjust;
 
@@ -179,9 +174,8 @@ package body Ada.Containers.Indefinite_Holders is
       if Control.Container /= null then
          Unreference (Control.Container.Reference);
          Control.Container.Busy := Control.Container.Busy - 1;
+         Control.Container := null;
       end if;
-
-      Control.Container := null;
    end Finalize;
 
    --------------
@@ -385,10 +379,10 @@ package body Ada.Containers.Indefinite_Holders is
    --------------------
 
    procedure Update_Element
-     (Container : Holder;
+     (Container : in out Holder;
       Process   : not null access procedure (Element : in out Element_Type))
    is
-      B : Natural renames Container'Unrestricted_Access.Busy;
+      B : Natural renames Container.Busy;
 
    begin
       if Container.Reference = null then
index 3e1ed18..df364b3 100644 (file)
@@ -64,7 +64,7 @@ package Ada.Containers.Indefinite_Holders is
      (Container : Holder;
       Process   : not null access procedure (Element : Element_Type));
    procedure Update_Element
-     (Container : Holder;
+     (Container : in out Holder;
       Process   : not null access procedure (Element : in out Element_Type));
 
    type Constant_Reference_Type
index 9fe4c14..2cdba99 100644 (file)
@@ -325,10 +325,10 @@ package body Ada.Containers.Indefinite_Holders is
    --------------------
 
    procedure Update_Element
-     (Container : Holder;
+     (Container : in out Holder;
       Process   : not null access procedure (Element : in out Element_Type))
    is
-      B : Natural renames Container'Unrestricted_Access.Busy;
+      B : Natural renames Container.Busy;
 
    begin
       if Container.Element = null then
index c5f45f5..2f81d75 100644 (file)
@@ -64,7 +64,7 @@ package Ada.Containers.Indefinite_Holders is
       Process   : not null access procedure (Element : Element_Type));
 
    procedure Update_Element
-     (Container : Holder;
+     (Container : in out Holder;
       Process   : not null access procedure (Element : in out Element_Type));
 
    type Constant_Reference_Type