]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sem_ch3.adb, [...]: Minor reformatting.
authorRobert Dewar <dewar@adacore.com>
Fri, 13 Jun 2014 10:26:34 +0000 (10:26 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 13 Jun 2014 10:26:34 +0000 (12:26 +0200)
2014-06-13  Robert Dewar  <dewar@adacore.com>

* sem_ch3.adb, sem_ch9.adb, a-coinho.adb, a-coinho.ads: Minor
reformatting.

From-SVN: r211628

gcc/ada/ChangeLog
gcc/ada/a-coinho.adb
gcc/ada/a-coinho.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch9.adb

index 7dc730c0ffd5e2a6fce109cc36d53478b42864be..22557b214096f4e5ee0def60fb14e6feca55c6a3 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-13  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch3.adb, sem_ch9.adb, a-coinho.adb, a-coinho.ads: Minor
+       reformatting.
+
 2014-06-13  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * sem_prag.adb (Analyze_Pragma): Add local
index 7fb7bece45dab179b22b22e5d2a3d1a7e4fdace5..4cb717936d68702bcc7eebb1393a34474bd98c00 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---             Copyright (C) 2014, Free Software Foundation, Inc.           --
+--          Copyright (C) 2012-2014, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -65,7 +65,11 @@ package body Ada.Containers.Indefinite_Holders is
    overriding procedure Adjust (Control : in out Reference_Control_Type) is
    begin
       if Control.Container /= null then
-         Control.Container.Busy := Control.Container.Busy + 1;
+         declare
+            B : Natural renames Control.Container.Busy;
+         begin
+            B := B + 1;
+         end;
       end if;
    end Adjust;
 
@@ -109,9 +113,11 @@ package body Ada.Containers.Indefinite_Holders is
      (Container : aliased Holder) return Constant_Reference_Type
    is
       Ref : constant Constant_Reference_Type :=
-              (Element => Container.Element,
+              (Element => Container.Element.all'Access,
                Control => (Controlled with Container'Unrestricted_Access));
+      B : Natural renames Ref.Control.Container.Busy;
    begin
+      B := B + 1;
       return Ref;
    end Constant_Reference;
 
@@ -154,13 +160,16 @@ package body Ada.Containers.Indefinite_Holders is
       Free (Container.Element);
    end Finalize;
 
-   overriding procedure Finalize (Control : in out Reference_Control_Type)
-   is
+   overriding procedure Finalize (Control : in out Reference_Control_Type) is
    begin
       if Control.Container /= null then
-         Control.Container.Busy := Control.Container.Busy - 1;
-
+         declare
+            B : Natural renames Control.Container.Busy;
+         begin
+            B := B - 1;
+         end;
       end if;
+
       Control.Container := null;
    end Finalize;
 
@@ -262,9 +271,10 @@ package body Ada.Containers.Indefinite_Holders is
      (Container : aliased in out Holder) return Reference_Type
    is
       Ref : constant Reference_Type :=
-              (Element => Container.Element,
+              (Element => Container.Element.all'Access,
                Control => (Controlled with Container'Unrestricted_Access));
    begin
+      Container.Busy := Container.Busy + 1;
       return Ref;
    end Reference;
 
@@ -301,6 +311,7 @@ package body Ada.Containers.Indefinite_Holders is
    ---------------
 
    function To_Holder (New_Item : Element_Type) return Holder is
+
       --  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).
@@ -354,6 +365,7 @@ package body Ada.Containers.Indefinite_Holders is
          Element_Type'Output (Stream, Container.Element.all);
       end if;
    end Write;
+
    procedure Write
      (Stream : not null access Root_Stream_Type'Class;
       Item   : Reference_Type)
index 5edfc64770be73bc46a7c40a28367a5b2d5cbbc2..c5f45f5463632118025aa9a892d72a2943027d0b 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---             Copyright (C) 2014, Free Software Foundation, Inc.           --
+--          Copyright (C) 2011-2014, 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 --
@@ -131,8 +131,8 @@ private
    pragma Inline (Finalize);
 
    type Constant_Reference_Type
-      (Element : not null access constant Element_Type)
-   is record
+      (Element : not null access constant Element_Type) is
+   record
       Control : Reference_Control_Type;
    end record;
 
@@ -148,9 +148,7 @@ private
 
    for Constant_Reference_Type'Read use Read;
 
-   type Reference_Type
-     (Element : not null access Element_Type)
-   is record
+   type Reference_Type (Element : not null access Element_Type) is record
       Control : Reference_Control_Type;
    end record;
 
index b899e0116bc76bec2ff6b67e82aa4704b8d1cf7c..9dc8d1281d7d2851491d6236cb7daedff13b5e09 100644 (file)
@@ -15598,11 +15598,10 @@ package body Sem_Ch3 is
                   end if;
 
                elsif Nkind (N) = N_Full_Type_Declaration
-                 and then
-                   (Nkind (Type_Definition (N)) = N_Record_Definition
-                     or else Nkind (Type_Definition (N))
-                                 = N_Derived_Type_Definition)
-                      and then Interface_Present (Type_Definition (N))
+                 and then Nkind_In
+                            (Type_Definition (N), N_Record_Definition,
+                                                  N_Derived_Type_Definition)
+                 and then Interface_Present (Type_Definition (N))
                then
                   Error_Msg_N
                     ("completion of private type cannot be an interface", N);
@@ -18309,16 +18308,16 @@ package body Sem_Ch3 is
 
             if Present (Iface) then
                Error_Msg_NE
-                 ("interface in partial view& not implemented by full type " &
-                  "(RM-2005 7.3 (7.3/2))", Full_T, Iface);
+                 ("interface in partial view& not implemented by full type "
+                  "(RM-2005 7.3 (7.3/2))", Full_T, Iface);
             end if;
 
             Iface := Find_Hidden_Interface (Full_T_Ifaces, Priv_T_Ifaces);
 
             if Present (Iface) then
                Error_Msg_NE
-                 ("interface & not implemented by partial view " &
-                  "(RM-2005 7.3 (7.3/2))", Full_T, Iface);
+                 ("interface & not implemented by partial view "
+                  "(RM-2005 7.3 (7.3/2))", Full_T, Iface);
             end if;
          end;
       end if;
@@ -18349,7 +18348,7 @@ package body Sem_Ch3 is
          if Priv_Parent = Any_Type or else Full_Parent = Any_Type then
             return;
 
-         --  Ada 2005 (AI-251): Interfaces in the full-typ can be given in
+         --  Ada 2005 (AI-251): Interfaces in the full type can be given in
          --  any order. Therefore we don't have to check that its parent must
          --  be a descendant of the parent of the private type declaration.
 
index be4642788390e60dba33e815a9c73272854e0ae7..9dcd7de94aa562c6ffb11e49774a238db994b301 100644 (file)
@@ -3328,7 +3328,7 @@ package body Sem_Ch9 is
                if Present (Iface) then
                   Error_Msg_NE
                     ("interface in partial view& not implemented by full "
-                      & "type (RM-2005 7.3 (7.3/2))", T, Iface);
+                     & "type (RM-2005 7.3 (7.3/2))", T, Iface);
                end if;
 
                Iface := Find_Hidden_Interface (Full_T_Ifaces, Priv_T_Ifaces);