Commit a18e3d62 by Arnaud Charlet

[multiple changes]

2014-07-30  Ed Schonberg  <schonberg@adacore.com>

	* a-crdlli.ads: Place declaration of Empty_List after full type
	declaration for Curosr, to prevent freezing error.

2014-07-30  Robert Dewar  <dewar@adacore.com>

	* get_targ.adb: Minor code reorganization.
	* prj-proc.adb, prj-proc.ads, get_targ.ads, sem_ch6.adb: Minor
	reformatting.

2014-07-30  Ed Schonberg  <schonberg@adacore.com>

	* a-cbhase.adb: a-cbhase.adb (Insert): Raise Constraint_Error,
	not Program_Error, when attempting to remove an element not in
	the set. This is the given semantics for all set containers.

2014-07-30  Ed Schonberg  <schonberg@adacore.com>

	* a-rbtgbo.adb: -rbtgbo.adb (Delete_Node_Sans_Free): If
	element is not present in tree return rather than violating
	an assertion. Constraint_Error will be raised in the caller if
	element is not in the container.

From-SVN: r213300
parent 1ebc2612
2014-07-30 Ed Schonberg <schonberg@adacore.com>
* a-crdlli.ads: Place declaration of Empty_List after full type
declaration for Curosr, to prevent freezing error.
2014-07-30 Robert Dewar <dewar@adacore.com>
* get_targ.adb: Minor code reorganization.
* prj-proc.adb, prj-proc.ads, get_targ.ads, sem_ch6.adb: Minor
reformatting.
2014-07-30 Ed Schonberg <schonberg@adacore.com>
* a-cbhase.adb: a-cbhase.adb (Insert): Raise Constraint_Error,
not Program_Error, when attempting to remove an element not in
the set. This is the given semantics for all set containers.
2014-07-30 Ed Schonberg <schonberg@adacore.com>
* a-rbtgbo.adb: -rbtgbo.adb (Delete_Node_Sans_Free): If
element is not present in tree return rather than violating
an assertion. Constraint_Error will be raised in the caller if
element is not in the container.
2014-07-30 Arnaud Charlet <charlet@adacore.com> 2014-07-30 Arnaud Charlet <charlet@adacore.com>
* set_targ.adb (Read_Target_Dependent_Values): New subprogram. * set_targ.adb (Read_Target_Dependent_Values): New subprogram.
......
...@@ -762,7 +762,8 @@ package body Ada.Containers.Bounded_Hashed_Sets is ...@@ -762,7 +762,8 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Insert (Container, New_Item, Position, Inserted); Insert (Container, New_Item, Position, Inserted);
if not Inserted then if not Inserted then
raise Program_Error with "attempt to insert element already in set"; raise Constraint_Error with
"attempt to insert element already in set";
end if; end if;
end Insert; end Insert;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2014, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -321,8 +321,6 @@ private ...@@ -321,8 +321,6 @@ private
Length : Count_Type := 0; Length : Count_Type := 0;
end record; end record;
Empty_List : constant List := (0, others => <>);
type List_Access is access all List; type List_Access is access all List;
for List_Access'Storage_Size use 0; for List_Access'Storage_Size use 0;
...@@ -332,6 +330,8 @@ private ...@@ -332,6 +330,8 @@ private
Node : Count_Type := 0; Node : Count_Type := 0;
end record; end record;
Empty_List : constant List := (0, others => <>);
No_Element : constant Cursor := (null, 0); No_Element : constant Cursor := (null, 0);
end Ada.Containers.Restricted_Doubly_Linked_Lists; end Ada.Containers.Restricted_Doubly_Linked_Lists;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2013, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2014, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -196,7 +196,6 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is ...@@ -196,7 +196,6 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
X, Y : Count_Type; X, Y : Count_Type;
Z : constant Count_Type := Node; Z : constant Count_Type := Node;
pragma Assert (Z /= 0);
N : Nodes_Type renames Tree.Nodes; N : Nodes_Type renames Tree.Nodes;
...@@ -206,6 +205,12 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is ...@@ -206,6 +205,12 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
"attempt to tamper with cursors (container is busy)"; "attempt to tamper with cursors (container is busy)";
end if; end if;
-- If node is not present, return. Exception will be raised in caller.
if Z = 0 then
return;
end if;
pragma Assert (Tree.Length > 0); pragma Assert (Tree.Length > 0);
pragma Assert (Tree.Root /= 0); pragma Assert (Tree.Root /= 0);
pragma Assert (Tree.First /= 0); pragma Assert (Tree.First /= 0);
......
...@@ -308,19 +308,14 @@ package body Get_Targ is ...@@ -308,19 +308,14 @@ package body Get_Targ is
function Digits_From_Size (Size : Pos) return Pos is function Digits_From_Size (Size : Pos) return Pos is
begin begin
if Size = 32 then case Size is
return 6; when 32 => return 6;
elsif Size = 48 then when 48 => return 9;
return 9; when 64 => return 15;
elsif Size = 64 then when 96 => return 18;
return 15; when 128 => return 18;
elsif Size = 96 then when others => raise Program_Error;
return 18; end case;
elsif Size = 128 then
return 18;
else
raise Program_Error;
end if;
end Digits_From_Size; end Digits_From_Size;
----------------------------- -----------------------------
...@@ -349,17 +344,13 @@ package body Get_Targ is ...@@ -349,17 +344,13 @@ package body Get_Targ is
function Width_From_Size (Size : Pos) return Pos is function Width_From_Size (Size : Pos) return Pos is
begin begin
if Size = 8 then case Size is
return 4; when 8 => return 4;
elsif Size = 16 then when 16 => return 6;
return 6; when 32 => return 11;
elsif Size = 32 then when 64 => return 21;
return 11; when others => raise Program_Error;
elsif Size = 64 then end case;
return 21;
else
raise Program_Error;
end if;
end Width_From_Size; end Width_From_Size;
end Get_Targ; end Get_Targ;
...@@ -146,8 +146,8 @@ package Get_Targ is ...@@ -146,8 +146,8 @@ package Get_Targ is
-- Calls the Call_Back function with information for each supported type -- Calls the Call_Back function with information for each supported type
function Get_Back_End_Config_File return String_Ptr; function Get_Back_End_Config_File return String_Ptr;
-- Return the back end configuration file, or null if none. -- Return the back end configuration file, or null if none. If non-null,
-- If non null, this file should be used instead of calling the various -- this file should be used instead of calling the various Get_xxx
-- Get_xxx functions in this package. -- functions in this package.
end Get_Targ; end Get_Targ;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-- -- -- --
-- GNAT COMPILER COMPONENTS -- -- GNAT COMPILER COMPONENTS --
-- -- -- --
-- P R J . P R O C -- -- P R J . P R O C --
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
...@@ -2848,6 +2848,7 @@ package body Prj.Proc is ...@@ -2848,6 +2848,7 @@ package body Prj.Proc is
-- Check if the project is already in the tree -- Check if the project is already in the tree
Project := No_Project; Project := No_Project;
declare declare
List : Project_List := In_Tree.Projects; List : Project_List := In_Tree.Projects;
Path : constant Path_Name_Type := Path : constant Path_Name_Type :=
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
-- -- -- --
-- GNAT COMPILER COMPONENTS -- -- GNAT COMPILER COMPONENTS --
-- -- -- --
-- P R J . P R O C -- -- P R J . P R O C --
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2013, Free Software Foundation, Inc. -- -- Copyright (C) 2001-2014, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -9891,6 +9891,7 @@ package body Sem_Ch6 is ...@@ -9891,6 +9891,7 @@ package body Sem_Ch6 is
-- in bodies. Limited views of either kind are not allowed -- in bodies. Limited views of either kind are not allowed
-- if there is no place at which the non-limited view can -- if there is no place at which the non-limited view can
-- become available. -- become available.
-- Incomplete formal untagged types are not allowed in -- Incomplete formal untagged types are not allowed in
-- subprogram bodies (but are legal in their declarations). -- subprogram bodies (but are legal in their declarations).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment