sem_ch3.adb, [...]: Minor reformatting.

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
This commit is contained in:
Robert Dewar 2014-06-13 10:26:34 +00:00 committed by Arnaud Charlet
parent aca670a0a9
commit 129bbe4330
5 changed files with 39 additions and 25 deletions

View 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

View 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)

View 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;

View 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.

View 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);