aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/g-dyntab.adb
diff options
context:
space:
mode:
authorMatthew Heaney <heaney@adacore.com>2006-02-15 10:40:52 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2006-02-15 10:40:52 +0100
commit987b2901fd0d851c7c053d82745967481c399cba (patch)
treebc3b4643bc1bee6acbe4abbe02699e6ee94d0a79 /gcc/ada/g-dyntab.adb
parent99c222911bb37a9103ebb2c46f3bb194b1548191 (diff)
downloadgcc-987b2901fd0d851c7c053d82745967481c399cba.zip
gcc-987b2901fd0d851c7c053d82745967481c399cba.tar.gz
gcc-987b2901fd0d851c7c053d82745967481c399cba.tar.bz2
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
Diffstat (limited to 'gcc/ada/g-dyntab.adb')
-rw-r--r--gcc/ada/g-dyntab.adb9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/g-dyntab.adb b/gcc/ada/g-dyntab.adb
index 1944097..3cab6bf6 100644
--- a/gcc/ada/g-dyntab.adb
+++ b/gcc/ada/g-dyntab.adb
@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -165,7 +165,7 @@ package body GNAT.Dynamic_Tables is
-- Last --
----------
- function Last (T : in Instance) return Table_Index_Type is
+ function Last (T : Instance) return Table_Index_Type is
begin
return Table_Index_Type (T.P.Last_Val);
end Last;
@@ -284,8 +284,11 @@ package body GNAT.Dynamic_Tables is
--------------
function Index_Of (Idx : Natural) return Table_Index_Type is
+ J : constant Integer'Base :=
+ Table_Index_Type'Pos (First) + Idx - 1;
+
begin
- return First + Table_Index_Type (Idx) - 1;
+ return Table_Index_Type'Val (J);
end Index_Of;
----------