[Ada] code clean up in containers
Arnaud Charlet
charlet@adacore.com
Wed Mar 26 11:07:00 GMT 2008
Tested on i686-linux, committed on trunk
As part of regular maintenance, the with clauses for packages used only in the
private part of the spec were changed to private with clauses. (The container
packages were originally written in Ada95, when the language did not support
private withs.)
Also, controlled operations were explicitly declared as overriding operations,
using the new keyword.
2008-03-26 Matthew Heaney <heaney@adacore.com>
* a-ciorse.ads, a-cidlli.ads, a-cdlili.ads, a-cihase.ads, a-cohase.ads,
a-ciorma.ads, a-coorma.ads, a-ciormu.ads, a-coormu.ads, a-coorse.ads:
Marked with clauses as private, and controlled operations as overriding
-------------- next part --------------
Index: a-ciorse.ads
===================================================================
--- a-ciorse.ads (revision 133430)
+++ a-ciorse.ads (working copy)
@@ -2,12 +2,11 @@
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
--- A D A . C O N T A I N E R S . --
--- I N D E F I N I T E _ O R D E R E D _ S E T S --
+-- ADA.CONTAINERS.INDEFINITE_ORDERED_SETS --
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -34,9 +33,9 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Containers.Red_Black_Trees;
-with Ada.Finalization;
-with Ada.Streams;
+private with Ada.Containers.Red_Black_Trees;
+private with Ada.Finalization;
+private with Ada.Streams;
generic
type Element_Type (<>) is private;
@@ -267,8 +266,10 @@ private
Tree : Tree_Types.Tree_Type;
end record;
+ overriding
procedure Adjust (Container : in out Set);
+ overriding
procedure Finalize (Container : in out Set) renames Clear;
use Red_Black_Trees;
Index: a-cidlli.ads
===================================================================
--- a-cidlli.ads (revision 133430)
+++ a-cidlli.ads (working copy)
@@ -2,12 +2,11 @@
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
--- A D A . C O N T A I N E R S . --
--- I N D E F I N I T E _ D O U B L Y _ L I N K E D _ L I S T S --
+-- ADA.CONTAINERS.INDEFINITE_DOUBLY_LINKED_LISTS --
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -34,8 +33,8 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Finalization;
-with Ada.Streams;
+private with Ada.Finalization;
+private with Ada.Streams;
generic
type Element_Type (<>) is private;
@@ -223,8 +222,10 @@ private
Lock : Natural := 0;
end record;
+ overriding
procedure Adjust (Container : in out List);
+ overriding
procedure Finalize (Container : in out List) renames Clear;
use Ada.Streams;
Index: a-cdlili.ads
===================================================================
--- a-cdlili.ads (revision 133430)
+++ a-cdlili.ads (working copy)
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -33,8 +33,8 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Finalization;
-with Ada.Streams;
+private with Ada.Finalization;
+private with Ada.Streams;
generic
type Element_Type is private;
@@ -230,8 +230,10 @@ private
Lock : Natural := 0;
end record;
+ overriding
procedure Adjust (Container : in out List);
+ overriding
procedure Finalize (Container : in out List) renames Clear;
use Ada.Streams;
Index: a-cihase.ads
===================================================================
--- a-cihase.ads (revision 133430)
+++ a-cihase.ads (working copy)
@@ -2,12 +2,11 @@
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
--- A D A . C O N T A I N E R S . --
--- I N D E F I N I T E _ H A S H E D _ S E T S --
+-- ADA.CONTAINERS.INDEFINITE_HASHED_SETS --
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -34,9 +33,9 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Containers.Hash_Tables;
-with Ada.Streams;
-with Ada.Finalization;
+private with Ada.Containers.Hash_Tables;
+private with Ada.Streams;
+private with Ada.Finalization;
generic
type Element_Type (<>) is private;
@@ -417,8 +416,10 @@ private
HT : HT_Types.Hash_Table_Type;
end record;
+ overriding
procedure Adjust (Container : in out Set);
+ overriding
procedure Finalize (Container : in out Set);
use HT_Types;
Index: a-cohase.ads
===================================================================
--- a-cohase.ads (revision 133430)
+++ a-cohase.ads (working copy)
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -33,9 +33,9 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Containers.Hash_Tables;
-with Ada.Streams;
-with Ada.Finalization;
+private with Ada.Containers.Hash_Tables;
+private with Ada.Streams;
+private with Ada.Finalization;
generic
type Element_Type is private;
@@ -416,8 +416,10 @@ private
HT : HT_Types.Hash_Table_Type;
end record;
+ overriding
procedure Adjust (Container : in out Set);
+ overriding
procedure Finalize (Container : in out Set);
use HT_Types;
Index: a-ciorma.ads
===================================================================
--- a-ciorma.ads (revision 133430)
+++ a-ciorma.ads (working copy)
@@ -2,12 +2,11 @@
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
--- A D A . C O N T A I N E R S . --
--- I N D E F I N I T E _ O R D E R E D _ M A P S --
+-- ADA.CONTAINERS.INDEFINITE_ORDERED_MAPS --
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -34,9 +33,9 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Containers.Red_Black_Trees;
-with Ada.Finalization;
-with Ada.Streams;
+private with Ada.Containers.Red_Black_Trees;
+private with Ada.Finalization;
+private with Ada.Streams;
generic
type Key_Type (<>) is private;
@@ -203,8 +202,10 @@ private
Tree : Tree_Types.Tree_Type;
end record;
+ overriding
procedure Adjust (Container : in out Map);
+ overriding
procedure Finalize (Container : in out Map) renames Clear;
use Red_Black_Trees;
Index: a-coorma.ads
===================================================================
--- a-coorma.ads (revision 133430)
+++ a-coorma.ads (working copy)
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -33,9 +33,9 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Containers.Red_Black_Trees;
-with Ada.Finalization;
-with Ada.Streams;
+private with Ada.Containers.Red_Black_Trees;
+private with Ada.Finalization;
+private with Ada.Streams;
generic
type Key_Type is private;
@@ -205,8 +205,10 @@ private
Tree : Tree_Types.Tree_Type;
end record;
+ overriding
procedure Adjust (Container : in out Map);
+ overriding
procedure Finalize (Container : in out Map) renames Clear;
use Red_Black_Trees;
Index: a-ciormu.ads
===================================================================
--- a-ciormu.ads (revision 133430)
+++ a-ciormu.ads (working copy)
@@ -2,12 +2,11 @@
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
--- A D A . C O N T A I N E R S . --
--- I N D E F I N I T E _ O R D E R E D _ M U L T I S E T S --
+-- ADA.CONTAINERS.INDEFINITE_ORDERED_MULTISETS --
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -34,9 +33,11 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Containers.Red_Black_Trees;
-with Ada.Finalization;
-with Ada.Streams;
+-- Documentation of this unit is needed ???
+
+private with Ada.Containers.Red_Black_Trees;
+private with Ada.Finalization;
+private with Ada.Streams;
generic
type Element_Type (<>) is private;
@@ -263,8 +264,10 @@ private
Tree : Tree_Types.Tree_Type;
end record;
+ overriding
procedure Adjust (Container : in out Set);
+ overriding
procedure Finalize (Container : in out Set) renames Clear;
use Red_Black_Trees;
Index: a-coormu.ads
===================================================================
--- a-coormu.ads (revision 133430)
+++ a-coormu.ads (working copy)
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -33,9 +33,11 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Containers.Red_Black_Trees;
-with Ada.Finalization;
-with Ada.Streams;
+-- Documentation is needed for this unit ???
+
+private with Ada.Containers.Red_Black_Trees;
+private with Ada.Finalization;
+private with Ada.Streams;
generic
type Element_Type is private;
@@ -268,8 +270,10 @@ private
Tree : Tree_Types.Tree_Type;
end record;
+ overriding
procedure Adjust (Container : in out Set);
+ overriding
procedure Finalize (Container : in out Set) renames Clear;
use Red_Black_Trees;
Index: a-coorse.ads
===================================================================
--- a-coorse.ads (revision 133430)
+++ a-coorse.ads (working copy)
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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 --
@@ -33,9 +33,9 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-with Ada.Containers.Red_Black_Trees;
-with Ada.Finalization;
-with Ada.Streams;
+private with Ada.Containers.Red_Black_Trees;
+private with Ada.Finalization;
+private with Ada.Streams;
generic
type Element_Type is private;
@@ -256,8 +256,10 @@ private
Tree : Tree_Types.Tree_Type;
end record;
+ overriding
procedure Adjust (Container : in out Set);
+ overriding
procedure Finalize (Container : in out Set) renames Clear;
use Red_Black_Trees;
More information about the Gcc-patches
mailing list