Commit 987b2901 by Matthew Heaney Committed by Arnaud Charlet

g-dyntab.adb (Index_Of): conversion from Natural can no longer raise Constraint_Error.

2006-02-13  Matthew Heaney  <heaney@adacore.com>

	*  g-dyntab.adb (Index_Of): conversion from Natural can no longer raise
	Constraint_Error.

From-SVN: r111073
parent 99c22291
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2000-2005, AdaCore -- -- Copyright (C) 2000-2006, AdaCore --
-- -- -- --
-- 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- --
...@@ -165,7 +165,7 @@ package body GNAT.Dynamic_Tables is ...@@ -165,7 +165,7 @@ package body GNAT.Dynamic_Tables is
-- Last -- -- Last --
---------- ----------
function Last (T : in Instance) return Table_Index_Type is function Last (T : Instance) return Table_Index_Type is
begin begin
return Table_Index_Type (T.P.Last_Val); return Table_Index_Type (T.P.Last_Val);
end Last; end Last;
...@@ -284,8 +284,11 @@ package body GNAT.Dynamic_Tables is ...@@ -284,8 +284,11 @@ package body GNAT.Dynamic_Tables is
-------------- --------------
function Index_Of (Idx : Natural) return Table_Index_Type is function Index_Of (Idx : Natural) return Table_Index_Type is
J : constant Integer'Base :=
Table_Index_Type'Pos (First) + Idx - 1;
begin begin
return First + Table_Index_Type (Idx) - 1; return Table_Index_Type'Val (J);
end Index_Of; end Index_Of;
---------- ----------
......
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